QA: Rename OS state test for clarification
authorMichael Hanselmann <hansmi@google.com>
Mon, 7 Mar 2011 16:46:33 +0000 (17:46 +0100)
committerMichael Hanselmann <hansmi@google.com>
Tue, 8 Mar 2011 10:55:19 +0000 (11:55 +0100)
Also add an additional check to ensure the OS does not exist.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

qa/ganeti-qa.py
qa/qa_os.py

index 3402bc5..e0c62d7 100755 (executable)
@@ -188,7 +188,7 @@ def RunOsTests():
     qa_os.TestOsPartiallyValid,
     qa_os.TestOsModifyValid,
     qa_os.TestOsModifyInvalid,
-    qa_os.TestOsStates,
+    qa_os.TestOsStatesNonExisting,
     ]:
     RunTestIf("os", fn)
 
index 740c8c5..cbc3142 100644 (file)
@@ -68,13 +68,13 @@ def _TestOsModify(hvp_dict, fail=False):
   AssertCommand(cmd, fail=fail)
 
 
-def _TestOsStates():
+def _TestOsStates(os_name):
   """gnt-os modify, more stuff"""
   cmd = ["gnt-os", "modify"]
 
   for param in ["hidden", "blacklisted"]:
     for val in ["yes", "no"]:
-      new_cmd = cmd + ["--%s" % param, val, _TEMP_OS_NAME]
+      new_cmd = cmd + ["--%s" % param, val, os_name]
       AssertCommand(new_cmd)
       # check that double-running the command is OK
       AssertCommand(new_cmd)
@@ -179,7 +179,7 @@ def TestOsModifyInvalid():
   return _TestOsModify(hv_dict, fail=True)
 
 
-def TestOsStates():
-  """Testing OS states"""
-
-  return _TestOsStates()
+def TestOsStatesNonExisting():
+  """Testing OS states with non-existing OS"""
+  AssertCommand(["test", "-e", _TEMP_OS_PATH], fail=True)
+  return _TestOsStates(_TEMP_OS_NAME)