@@ -232,20 +232,27 @@ func Test_ServerUpdateCustom(t *testing.T) {
232
232
// Volumes cases.
233
233
t .Run ("Volumes" , func (t * testing.T ) {
234
234
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
+ ),
236
239
BeforeFunc : core .BeforeFuncCombine (
237
240
createServerBionic ("Server" ),
238
241
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
+ },
239
255
),
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
- },
249
256
AfterFunc : deleteServer ("Server" ),
250
257
}))
251
258
0 commit comments