@@ -232,20 +232,27 @@ func Test_ServerUpdateCustom(t *testing.T) {
232232 // Volumes cases.
233233 t .Run ("Volumes" , func (t * testing.T ) {
234234 t .Run ("valid simple block volume" , core .Test (& core.TestConfig {
235- Commands : instance .GetCommands (),
235+ Commands : core .NewCommandsMerge (
236+ block .GetCommands (),
237+ instance .GetCommands (),
238+ ),
236239 BeforeFunc : core .BeforeFuncCombine (
237240 createServerBionic ("Server" ),
238241 createVolume ("Volume" , 10 , instanceSDK .VolumeVolumeTypeBSSD ),
242+ createSbsVolume ("VolumeSBS" , 10 ),
243+ ),
244+ Cmd : `scw instance server update {{ .Server.ID }} volume-ids.0={{ (index .Server.Volumes "0").ID }} volume-ids.1={{ .Volume.ID }} volume-ids.2={{ .VolumeSBS.ID }}` ,
245+ Check : core .TestCheckCombine (
246+ func (t * testing.T , ctx * core.CheckFuncCtx ) {
247+ t .Helper ()
248+ require .NoError (t , ctx .Err )
249+ size0 := ctx .Result .(* instanceSDK.UpdateServerResponse ).Server .Volumes ["0" ].Size
250+ size1 := ctx .Result .(* instanceSDK.UpdateServerResponse ).Server .Volumes ["1" ].Size
251+ assert .Equal (t , 20 * scw .GB , instance .SizeValue (size0 ), "Size of volume should be 20 GB" )
252+ assert .Equal (t , 10 * scw .GB , instance .SizeValue (size1 ), "Size of volume should be 10 GB" )
253+ assert .Equal (t , instanceSDK .VolumeServerVolumeTypeSbsVolume , ctx .Result .(* instanceSDK.UpdateServerResponse ).Server .Volumes ["2" ].VolumeType )
254+ },
239255 ),
240- Cmd : `scw instance server update {{ .Server.ID }} volume-ids.0={{ (index .Server.Volumes "0").ID }} volume-ids.1={{ .Volume.ID }}` ,
241- Check : func (t * testing.T , ctx * core.CheckFuncCtx ) {
242- t .Helper ()
243- require .NoError (t , ctx .Err )
244- size0 := ctx .Result .(* instanceSDK.UpdateServerResponse ).Server .Volumes ["0" ].Size
245- size1 := ctx .Result .(* instanceSDK.UpdateServerResponse ).Server .Volumes ["1" ].Size
246- assert .Equal (t , 20 * scw .GB , instance .SizeValue (size0 ), "Size of volume should be 20 GB" )
247- assert .Equal (t , 10 * scw .GB , instance .SizeValue (size1 ), "Size of volume should be 10 GB" )
248- },
249256 AfterFunc : deleteServer ("Server" ),
250257 }))
251258
0 commit comments