@@ -43,42 +43,42 @@ func Test_CreateServer(t *testing.T) {
4343
4444 t .Run ("GP1-XS" , core .Test (& core.TestConfig {
4545 Commands : instance .GetCommands (),
46- Cmd : "scw instance server create type=GP1-XS image=ubuntu_bionic stopped=true" ,
46+ Cmd : "scw instance server create type=GP1-XS image=ubuntu_jammy stopped=true" ,
4747 Check : core .TestCheckCombine (
48+ core .TestCheckExitCode (0 ),
4849 func (t * testing.T , ctx * core.CheckFuncCtx ) {
4950 t .Helper ()
5051 assert .NotNil (t , ctx .Result )
5152 assert .Equal (t , "GP1-XS" , ctx .Result .(* instanceSDK.Server ).CommercialType )
5253 },
53- core .TestCheckExitCode (0 ),
5454 ),
5555 AfterFunc : deleteServerAfterFunc (),
5656 }))
5757
5858 t .Run ("With name" , core .Test (& core.TestConfig {
5959 Commands : instance .GetCommands (),
60- Cmd : testServerCommand ("image=ubuntu_bionic name=yo stopped=true" ),
60+ Cmd : testServerCommand ("image=ubuntu_jammy name=yo stopped=true" ),
6161 Check : core .TestCheckCombine (
62+ core .TestCheckExitCode (0 ),
6263 func (t * testing.T , ctx * core.CheckFuncCtx ) {
6364 t .Helper ()
6465 assert .NotNil (t , ctx .Result )
6566 assert .Equal (t , "yo" , ctx .Result .(* instanceSDK.Server ).Name )
6667 },
67- core .TestCheckExitCode (0 ),
6868 ),
6969 AfterFunc : deleteServerAfterFunc (),
7070 }))
7171
7272 t .Run ("With start" , core .Test (& core.TestConfig {
7373 Commands : instance .GetCommands (),
74- Cmd : testServerCommand ("image=ubuntu_bionic -w" ),
74+ Cmd : testServerCommand ("image=ubuntu_jammy -w" ),
7575 Check : core .TestCheckCombine (
76+ core .TestCheckExitCode (0 ),
7677 func (t * testing.T , ctx * core.CheckFuncCtx ) {
7778 t .Helper ()
7879 assert .NotNil (t , ctx .Result )
7980 assert .Equal (t , instanceSDK .ServerStateRunning , ctx .Result .(* instanceSDK.Server ).State )
8081 },
81- core .TestCheckExitCode (0 ),
8282 ),
8383 AfterFunc : deleteServerAfterFunc (),
8484 }))
@@ -99,15 +99,15 @@ func Test_CreateServer(t *testing.T) {
9999
100100 t .Run ("Tags" , core .Test (& core.TestConfig {
101101 Commands : instance .GetCommands (),
102- Cmd : testServerCommand ("image=ubuntu_bionic tags.0=prod tags.1=blue stopped=true" ),
102+ Cmd : testServerCommand ("image=ubuntu_jammy tags.0=prod tags.1=blue stopped=true" ),
103103 Check : core .TestCheckCombine (
104+ core .TestCheckExitCode (0 ),
104105 func (t * testing.T , ctx * core.CheckFuncCtx ) {
105106 t .Helper ()
106107 assert .NotNil (t , ctx .Result )
107108 assert .Equal (t , "prod" , ctx .Result .(* instanceSDK.Server ).Tags [0 ])
108109 assert .Equal (t , "blue" , ctx .Result .(* instanceSDK.Server ).Tags [1 ])
109110 },
110- core .TestCheckExitCode (0 ),
111111 ),
112112 AfterFunc : deleteServerAfterFunc (),
113113 }))
@@ -226,7 +226,7 @@ func Test_CreateServer(t *testing.T) {
226226
227227 t .Run ("valid additional block volumes" , core .Test (& core.TestConfig {
228228 Commands : instance .GetCommands (),
229- Cmd : testServerCommand ("image=ubuntu_bionic additional-volumes.0=b:1G additional-volumes.1=b:5G additional-volumes.2=b:10G stopped=true" ),
229+ Cmd : testServerCommand ("image=ubuntu_jammy additional-volumes.0=b:1G additional-volumes.1=b:5G additional-volumes.2=b:10G stopped=true" ),
230230 Check : core .TestCheckCombine (
231231 core .TestCheckExitCode (0 ),
232232 testServerSBSVolumeSize ("1" , 1 ),
@@ -365,7 +365,7 @@ func Test_CreateServer(t *testing.T) {
365365 t .Run ("IPs" , func (t * testing.T ) {
366366 t .Run ("explicit new IP" , core .Test (& core.TestConfig {
367367 Commands : instance .GetCommands (),
368- Cmd : testServerCommand ("image=ubuntu_bionic ip=new stopped=true" ),
368+ Cmd : testServerCommand ("ip=new stopped=true" ),
369369 Check : core .TestCheckCombine (
370370 func (t * testing.T , ctx * core.CheckFuncCtx ) {
371371 t .Helper ()
@@ -382,7 +382,7 @@ func Test_CreateServer(t *testing.T) {
382382
383383 t .Run ("run with dynamic IP" , core .Test (& core.TestConfig {
384384 Commands : instance .GetCommands (),
385- Cmd : testServerCommand ("image=ubuntu_bionic ip=dynamic -w" ), // dynamic IP is created at runtime
385+ Cmd : testServerCommand ("ip=dynamic -w" ), // dynamic IP is created at runtime
386386 Check : core .TestCheckCombine (
387387 func (t * testing.T , ctx * core.CheckFuncCtx ) {
388388 t .Helper ()
@@ -401,7 +401,7 @@ func Test_CreateServer(t *testing.T) {
401401 t .Run ("existing IP" , core .Test (& core.TestConfig {
402402 Commands : instance .GetCommands (),
403403 BeforeFunc : createIP ("IP" ),
404- Cmd : testServerCommand ("image=ubuntu_bionic ip={{ .IP.Address }} stopped=true" ),
404+ Cmd : testServerCommand ("ip={{ .IP.Address }} stopped=true" ),
405405 Check : core .TestCheckCombine (
406406 func (t * testing.T , ctx * core.CheckFuncCtx ) {
407407 t .Helper ()
@@ -419,7 +419,7 @@ func Test_CreateServer(t *testing.T) {
419419 t .Run ("existing IP ID" , core .Test (& core.TestConfig {
420420 Commands : instance .GetCommands (),
421421 BeforeFunc : createIP ("IP" ),
422- Cmd : testServerCommand ("image=ubuntu_bionic ip={{ .IP.ID }} stopped=true" ),
422+ Cmd : testServerCommand ("ip={{ .IP.ID }} stopped=true" ),
423423 Check : core .TestCheckCombine (
424424 func (t * testing.T , ctx * core.CheckFuncCtx ) {
425425 t .Helper ()
@@ -436,7 +436,7 @@ func Test_CreateServer(t *testing.T) {
436436
437437 t .Run ("with ipv6" , core .Test (& core.TestConfig {
438438 Commands : instance .GetCommands (),
439- Cmd : testServerCommand ("image=ubuntu_bionic ip=ipv6 dynamic-ip-required=false -w" ), // IPv6 is created at runtime
439+ Cmd : testServerCommand ("ip=ipv6 dynamic-ip-required=false -w" ), // IPv6 is created at runtime
440440 Check : core .TestCheckCombine (
441441 func (t * testing.T , ctx * core.CheckFuncCtx ) {
442442 t .Helper ()
@@ -452,7 +452,7 @@ func Test_CreateServer(t *testing.T) {
452452
453453 t .Run ("with ipv6 and dynamic ip" , core .Test (& core.TestConfig {
454454 Commands : instance .GetCommands (),
455- Cmd : testServerCommand ("image=ubuntu_bionic dynamic-ip-required=true ip=ipv6 -w" ), // IPv6 is created at runtime
455+ Cmd : testServerCommand ("dynamic-ip-required=true ip=ipv6 -w" ), // IPv6 is created at runtime
456456 Check : core .TestCheckCombine (
457457 core .TestCheckExitCode (0 ),
458458 func (t * testing.T , ctx * core.CheckFuncCtx ) {
@@ -470,7 +470,7 @@ func Test_CreateServer(t *testing.T) {
470470
471471 t .Run ("with ipv6 and ipv4" , core .Test (& core.TestConfig {
472472 Commands : instance .GetCommands (),
473- Cmd : testServerCommand ("image=ubuntu_bionic ip=both -w" ), // IPv6 is created at runtime
473+ Cmd : testServerCommand ("ip=both -w" ), // IPv6 is created at runtime
474474 Check : core .TestCheckCombine (
475475 core .TestCheckExitCode (0 ),
476476 func (t * testing.T , ctx * core.CheckFuncCtx ) {
@@ -573,7 +573,7 @@ func Test_CreateServerErrors(t *testing.T) {
573573
574574 t .Run ("Error: invalid total local volumes size: too high 2" , core .Test (& core.TestConfig {
575575 Commands : instance .GetCommands (),
576- Cmd : testServerCommand ("image=ubuntu_jammy additional-volumes.0=local:20GB " ),
576+ Cmd : testServerCommand ("image=ubuntu_jammy additional-volumes.0=local:30GB " ),
577577 Check : core .TestCheckCombine (
578578 core .TestCheckGolden (),
579579 core .TestCheckExitCode (1 ),
0 commit comments