@@ -72,7 +72,7 @@ func Test_ImageDelete(t *testing.T) {
7272
7373func createImage (metaKey string ) core.BeforeFunc {
7474 return core .BeforeFuncCombine (
75- createServerBionic ("Server" ),
75+ createServer ("Server" ),
7676 core .ExecStoreBeforeCmd ("Snapshot" , `scw instance snapshot create volume-id={{ (index .Server.Volumes "0").ID }}` ),
7777 core .ExecStoreBeforeCmd (metaKey , `scw instance image create snapshot-id={{ .Snapshot.Snapshot.ID }} arch=x86_64` ),
7878 )
@@ -102,6 +102,7 @@ func Test_ImageUpdate(t *testing.T) {
102102 Cmd : "scw instance image update {{ .ImageName.Image.ID }} name=foo" ,
103103 Check : core .TestCheckCombine (
104104 func (t * testing.T , ctx * core.CheckFuncCtx ) {
105+ assert .NotNil (t , ctx .Result )
105106 assert .Equal (t , "foo" , ctx .Result .(* instance.UpdateImageResponse ).Image .Name )
106107 },
107108 core .TestCheckGolden (),
@@ -118,11 +119,12 @@ func Test_ImageUpdate(t *testing.T) {
118119 Commands : GetCommands (),
119120 Cmd : "scw instance image update {{ .ImagePub.Image.ID }} public=true" ,
120121 Check : core .TestCheckCombine (
122+ core .TestCheckGolden (),
123+ core .TestCheckExitCode (0 ),
121124 func (t * testing.T , ctx * core.CheckFuncCtx ) {
125+ assert .NotNil (t , ctx .Result )
122126 assert .Equal (t , true , ctx .Result .(* instance.UpdateImageResponse ).Image .Public )
123127 },
124- core .TestCheckGolden (),
125- core .TestCheckExitCode (0 ),
126128 ),
127129 AfterFunc : core .AfterFuncCombine (
128130 deleteServer ("Server" ),
@@ -140,6 +142,7 @@ func Test_ImageUpdate(t *testing.T) {
140142 Cmd : "scw instance image update {{ .ImageExtraVol.Image.ID }} extra-volumes.1.id={{ .SnapshotVol.ID }}" ,
141143 Check : core .TestCheckCombine (
142144 func (t * testing.T , ctx * core.CheckFuncCtx ) {
145+ assert .NotNil (t , ctx .Result )
143146 assert .Equal (t , "snapVol" , ctx .Result .(* instance.UpdateImageResponse ).Image .ExtraVolumes ["1" ].Name )
144147 },
145148 core .TestCheckGolden (),
0 commit comments