Skip to content

Commit 3cde585

Browse files
committed
Env prepare script update
1 parent 1a63002 commit 3cde585

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

internal/provider/tests/acceptance/setup/acceptance_test_env_prepare.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"net/http"
1515
"os"
1616
"reflect"
17+
"time"
1718
)
1819

1920
var source_vm_uuid = os.Getenv("SOURCE_VM_UUID")
@@ -196,6 +197,9 @@ func CleanUpPowerState(host string, client *http.Client) {
196197

197198
fmt.Println("Response Status:", resp.Status)
198199
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)
199203
}
200204
func CleanUpBootOrder(host string, client *http.Client) {
201205
bootOrder := []string{source_disk_uuid, source_nic_uuid}
@@ -253,21 +257,28 @@ func main() {
253257
// We are doing env prepare here, make sure all the necessary entities are setup and present
254258
if !AreEnvVariablesLoaded() {
255259
log.Fatal("Environment variables aren't loaded, check env file in /acceptance/setup directory")
260+
} else {
261+
fmt.Println("Environment variables are loaded correctly")
256262
}
257-
258263
if !DoesTestVMExist(host) {
259264
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")
260267
}
261-
262268
if IsTestVMRunning(host) {
263269
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")
264272
}
265-
266273
if !DoesVirtualDiskExist(host) {
267274
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")
268277
}
269278
if IsBootOrderCorrect(host) {
270279
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")
271282
}
272283
}
273284
}

0 commit comments

Comments
 (0)