Add server action: change admin password
diff --git a/acceptance/openstack/tools_test.go b/acceptance/openstack/tools_test.go
index c9a004f..0743221 100644
--- a/acceptance/openstack/tools_test.go
+++ b/acceptance/openstack/tools_test.go
@@ -169,13 +169,13 @@
}
if ts.gottenServer.Status == s {
- fmt.Printf("Server created after %d seconds (approximately)\n", 300-timeout)
+ fmt.Printf("Server reached state %s after %d seconds (approximately)\n", s, 300-timeout)
break
}
}
if err == errTimeout {
- fmt.Printf("I'm not waiting around.\n")
+ fmt.Printf("Time out -- I'm not waiting around.\n")
err = nil
}
@@ -229,6 +229,27 @@
return err
}
+func changeAdminPassword(ts *testState) error {
+ fmt.Println("Current password: "+ts.createdServer.AdminPass)
+ randomPassword := randomString("", 16)
+ for randomPassword == ts.createdServer.AdminPass {
+ randomPassword = randomString("", 16)
+ }
+ fmt.Println(" New password: "+randomPassword)
+
+ err := servers.ChangeAdminPassword(ts.client, ts.createdServer.Id, randomPassword)
+ if err != nil {
+ return err
+ }
+
+ err = waitForStatus(ts, "PASSWORD")
+ if err != nil {
+ return err
+ }
+
+ return waitForStatus(ts, "ACTIVE")
+}
+
// randomString generates a string of given length, but random content.
// All content will be within the ASCII graphic character set.
// (Implementation from Even Shaw's contribution on