@@ -14,6 +14,7 @@ import (
14
14
"net/http"
15
15
"os"
16
16
"reflect"
17
+ "time"
17
18
)
18
19
19
20
var source_vm_uuid = os .Getenv ("SOURCE_VM_UUID" )
@@ -196,6 +197,9 @@ func CleanUpPowerState(host string, client *http.Client) {
196
197
197
198
fmt .Println ("Response Status:" , resp .Status )
198
199
fmt .Println ("Response Body:" , string (body ))
200
+
201
+ // wait 15 seconds for VM to shutdown and then proceed with other cleanup tasks
202
+ time .Sleep (15 * time .Second )
199
203
}
200
204
func CleanUpBootOrder (host string , client * http.Client ) {
201
205
bootOrder := []string {source_disk_uuid , source_nic_uuid }
@@ -253,21 +257,28 @@ func main() {
253
257
// We are doing env prepare here, make sure all the necessary entities are setup and present
254
258
if ! AreEnvVariablesLoaded () {
255
259
log .Fatal ("Environment variables aren't loaded, check env file in /acceptance/setup directory" )
260
+ } else {
261
+ fmt .Println ("Environment variables are loaded correctly" )
256
262
}
257
-
258
263
if ! DoesTestVMExist (host ) {
259
264
log .Fatal ("Acceptance test VM is missing in your testing environment" )
265
+ } else {
266
+ fmt .Println ("Acceptance test VM is present in the testing environment" )
260
267
}
261
-
262
268
if IsTestVMRunning (host ) {
263
269
log .Fatal ("Acceptance test VM is RUNNING and should be turned off before the testing begins" )
270
+ } else {
271
+ fmt .Println ("Acceptance test VM is in the correct SHUTOFF state" )
264
272
}
265
-
266
273
if ! DoesVirtualDiskExist (host ) {
267
274
log .Fatal ("Acceptance test Virtual disk is missing in your testing environment" )
275
+ } else {
276
+ fmt .Println ("Acceptance test Virtual disk is present in your testing environment" )
268
277
}
269
278
if IsBootOrderCorrect (host ) {
270
279
log .Fatal ("Acceptance test Boot order is incorrect on the test VM, should be disk followed by network interface" )
280
+ } else {
281
+ fmt .Println ("Acceptance test Boot order is in correct order" )
271
282
}
272
283
}
273
284
}
0 commit comments