@@ -143,6 +143,27 @@ func Test_CreateServer(t *testing.T) {
143
143
),
144
144
}))
145
145
146
+ t .Run ("valid single local snapshot without image" , core .Test (& core.TestConfig {
147
+ Commands : instance .GetCommands (),
148
+ BeforeFunc : core .BeforeFuncCombine (
149
+ core .ExecStoreBeforeCmd ("Server" , "scw instance server create image=ubuntu_bionic root-volume=local:20GB stopped=true" ),
150
+ core .ExecStoreBeforeCmd ("Snapshot" , `scw instance snapshot create volume-id={{ (index .Server.Volumes "0").ID }}` ),
151
+ ),
152
+ Cmd : "scw instance server create image=none root-volume=local:{{ .Snapshot.Snapshot.ID }} stopped=true" ,
153
+ Check : core .TestCheckCombine (
154
+ core .TestCheckExitCode (0 ),
155
+ func (t * testing.T , ctx * core.CheckFuncCtx ) {
156
+ assert .NotNil (t , ctx .Result )
157
+ assert .Equal (t , 20 * scw .GB , ctx .Result .(* instanceSDK.Server ).Volumes ["0" ].Size )
158
+ },
159
+ ),
160
+ AfterFunc : core .AfterFuncCombine (
161
+ deleteServer ("Server" ),
162
+ deleteServerAfterFunc (),
163
+ deleteSnapshot ("Snapshot" ),
164
+ ),
165
+ }))
166
+
146
167
t .Run ("valid double local volumes" , core .Test (& core.TestConfig {
147
168
Commands : instance .GetCommands (),
148
169
Cmd : "scw instance server create image=ubuntu_bionic root-volume=local:10GB additional-volumes.0=l:10G stopped=true" ,
0 commit comments