@@ -43,42 +43,42 @@ func Test_CreateServer(t *testing.T) {
43
43
44
44
t .Run ("GP1-XS" , core .Test (& core.TestConfig {
45
45
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" ,
47
47
Check : core .TestCheckCombine (
48
+ core .TestCheckExitCode (0 ),
48
49
func (t * testing.T , ctx * core.CheckFuncCtx ) {
49
50
t .Helper ()
50
51
assert .NotNil (t , ctx .Result )
51
52
assert .Equal (t , "GP1-XS" , ctx .Result .(* instanceSDK.Server ).CommercialType )
52
53
},
53
- core .TestCheckExitCode (0 ),
54
54
),
55
55
AfterFunc : deleteServerAfterFunc (),
56
56
}))
57
57
58
58
t .Run ("With name" , core .Test (& core.TestConfig {
59
59
Commands : instance .GetCommands (),
60
- Cmd : testServerCommand ("image=ubuntu_bionic name=yo stopped=true" ),
60
+ Cmd : testServerCommand ("image=ubuntu_jammy name=yo stopped=true" ),
61
61
Check : core .TestCheckCombine (
62
+ core .TestCheckExitCode (0 ),
62
63
func (t * testing.T , ctx * core.CheckFuncCtx ) {
63
64
t .Helper ()
64
65
assert .NotNil (t , ctx .Result )
65
66
assert .Equal (t , "yo" , ctx .Result .(* instanceSDK.Server ).Name )
66
67
},
67
- core .TestCheckExitCode (0 ),
68
68
),
69
69
AfterFunc : deleteServerAfterFunc (),
70
70
}))
71
71
72
72
t .Run ("With start" , core .Test (& core.TestConfig {
73
73
Commands : instance .GetCommands (),
74
- Cmd : testServerCommand ("image=ubuntu_bionic -w" ),
74
+ Cmd : testServerCommand ("image=ubuntu_jammy -w" ),
75
75
Check : core .TestCheckCombine (
76
+ core .TestCheckExitCode (0 ),
76
77
func (t * testing.T , ctx * core.CheckFuncCtx ) {
77
78
t .Helper ()
78
79
assert .NotNil (t , ctx .Result )
79
80
assert .Equal (t , instanceSDK .ServerStateRunning , ctx .Result .(* instanceSDK.Server ).State )
80
81
},
81
- core .TestCheckExitCode (0 ),
82
82
),
83
83
AfterFunc : deleteServerAfterFunc (),
84
84
}))
@@ -99,15 +99,15 @@ func Test_CreateServer(t *testing.T) {
99
99
100
100
t .Run ("Tags" , core .Test (& core.TestConfig {
101
101
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" ),
103
103
Check : core .TestCheckCombine (
104
+ core .TestCheckExitCode (0 ),
104
105
func (t * testing.T , ctx * core.CheckFuncCtx ) {
105
106
t .Helper ()
106
107
assert .NotNil (t , ctx .Result )
107
108
assert .Equal (t , "prod" , ctx .Result .(* instanceSDK.Server ).Tags [0 ])
108
109
assert .Equal (t , "blue" , ctx .Result .(* instanceSDK.Server ).Tags [1 ])
109
110
},
110
- core .TestCheckExitCode (0 ),
111
111
),
112
112
AfterFunc : deleteServerAfterFunc (),
113
113
}))
@@ -226,7 +226,7 @@ func Test_CreateServer(t *testing.T) {
226
226
227
227
t .Run ("valid additional block volumes" , core .Test (& core.TestConfig {
228
228
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" ),
230
230
Check : core .TestCheckCombine (
231
231
core .TestCheckExitCode (0 ),
232
232
testServerSBSVolumeSize ("1" , 1 ),
@@ -365,7 +365,7 @@ func Test_CreateServer(t *testing.T) {
365
365
t .Run ("IPs" , func (t * testing.T ) {
366
366
t .Run ("explicit new IP" , core .Test (& core.TestConfig {
367
367
Commands : instance .GetCommands (),
368
- Cmd : testServerCommand ("image=ubuntu_bionic ip=new stopped=true" ),
368
+ Cmd : testServerCommand ("ip=new stopped=true" ),
369
369
Check : core .TestCheckCombine (
370
370
func (t * testing.T , ctx * core.CheckFuncCtx ) {
371
371
t .Helper ()
@@ -382,7 +382,7 @@ func Test_CreateServer(t *testing.T) {
382
382
383
383
t .Run ("run with dynamic IP" , core .Test (& core.TestConfig {
384
384
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
386
386
Check : core .TestCheckCombine (
387
387
func (t * testing.T , ctx * core.CheckFuncCtx ) {
388
388
t .Helper ()
@@ -401,7 +401,7 @@ func Test_CreateServer(t *testing.T) {
401
401
t .Run ("existing IP" , core .Test (& core.TestConfig {
402
402
Commands : instance .GetCommands (),
403
403
BeforeFunc : createIP ("IP" ),
404
- Cmd : testServerCommand ("image=ubuntu_bionic ip={{ .IP.Address }} stopped=true" ),
404
+ Cmd : testServerCommand ("ip={{ .IP.Address }} stopped=true" ),
405
405
Check : core .TestCheckCombine (
406
406
func (t * testing.T , ctx * core.CheckFuncCtx ) {
407
407
t .Helper ()
@@ -419,7 +419,7 @@ func Test_CreateServer(t *testing.T) {
419
419
t .Run ("existing IP ID" , core .Test (& core.TestConfig {
420
420
Commands : instance .GetCommands (),
421
421
BeforeFunc : createIP ("IP" ),
422
- Cmd : testServerCommand ("image=ubuntu_bionic ip={{ .IP.ID }} stopped=true" ),
422
+ Cmd : testServerCommand ("ip={{ .IP.ID }} stopped=true" ),
423
423
Check : core .TestCheckCombine (
424
424
func (t * testing.T , ctx * core.CheckFuncCtx ) {
425
425
t .Helper ()
@@ -436,7 +436,7 @@ func Test_CreateServer(t *testing.T) {
436
436
437
437
t .Run ("with ipv6" , core .Test (& core.TestConfig {
438
438
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
440
440
Check : core .TestCheckCombine (
441
441
func (t * testing.T , ctx * core.CheckFuncCtx ) {
442
442
t .Helper ()
@@ -452,7 +452,7 @@ func Test_CreateServer(t *testing.T) {
452
452
453
453
t .Run ("with ipv6 and dynamic ip" , core .Test (& core.TestConfig {
454
454
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
456
456
Check : core .TestCheckCombine (
457
457
core .TestCheckExitCode (0 ),
458
458
func (t * testing.T , ctx * core.CheckFuncCtx ) {
@@ -470,7 +470,7 @@ func Test_CreateServer(t *testing.T) {
470
470
471
471
t .Run ("with ipv6 and ipv4" , core .Test (& core.TestConfig {
472
472
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
474
474
Check : core .TestCheckCombine (
475
475
core .TestCheckExitCode (0 ),
476
476
func (t * testing.T , ctx * core.CheckFuncCtx ) {
@@ -573,7 +573,7 @@ func Test_CreateServerErrors(t *testing.T) {
573
573
574
574
t .Run ("Error: invalid total local volumes size: too high 2" , core .Test (& core.TestConfig {
575
575
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 " ),
577
577
Check : core .TestCheckCombine (
578
578
core .TestCheckGolden (),
579
579
core .TestCheckExitCode (1 ),
0 commit comments