Add logrotate example
[ganeti-local] / qa / qa_group.py
index b72ff02..67211b2 100644 (file)
@@ -43,12 +43,9 @@ def GetDefaultGroup():
 
 def TestGroupAddRemoveRename():
   """gnt-group add/remove/rename"""
-  groups = qa_config.get("groups", {})
-
   existing_group_with_nodes = GetDefaultGroup()
 
-  group1, group2, group3 = groups.get("inexistent-groups",
-                                      ["group1", "group2", "group3"])[:3]
+  (group1, group2, group3) = qa_utils.GetNonexistentGroups(3)
 
   AssertCommand(["gnt-group", "add", group1])
   AssertCommand(["gnt-group", "add", group2])
@@ -71,8 +68,7 @@ def TestGroupAddRemoveRename():
 
 def TestGroupAddWithOptions():
   """gnt-group add with options"""
-  groups = qa_config.get("groups", {})
-  group1 = groups.get("inexistent-groups", ["group1"])[0]
+  (group1, ) = qa_utils.GetNonexistentGroups(1)
 
   AssertCommand(["gnt-group", "add", "--alloc-policy", "notvalid", group1],
                 fail=True)
@@ -85,8 +81,7 @@ def TestGroupAddWithOptions():
 
 def TestGroupModify():
   """gnt-group modify"""
-  groups = qa_config.get("groups", {})
-  group1 = groups.get("inexistent-groups", ["group1"])[0]
+  (group1, ) = qa_utils.GetNonexistentGroups(1)
 
   AssertCommand(["gnt-group", "add", group1])
 
@@ -103,6 +98,12 @@ def TestGroupModify():
                    "min=%s,max=%s,std=0" % (min_v, max_v), group1], fail=True)
     AssertCommand(["gnt-group", "modify", "--specs-mem-size",
                    "min=%s,max=%s" % (min_v, max_v), group1])
+    AssertCommand(["gnt-group", "modify", "--specs-mem-size",
+                   "min=default,max=default", group1])
+    AssertCommand(["gnt-group", "modify", "--ipolicy-vcpu-ratio",
+                   "3.5", group1])
+    AssertCommand(["gnt-group", "modify", "--ipolicy-vcpu-ratio",
+                   "default", group1])
     AssertCommand(["gnt-group", "modify",
                    "--node-parameters", "spindle_count=10", group1])
     if qa_config.TestEnabled("htools"):
@@ -130,8 +131,8 @@ def TestAssignNodesIncludingSplit(orig_group, node1, node2):
 
   """
   assert node1 != node2
-  groups = qa_config.get("groups", {})
-  other_group = groups.get("inexistent-groups", ["group1"])[0]
+
+  (other_group, ) = qa_utils.GetNonexistentGroups(1)
 
   master_node = qa_config.GetMasterNode()["primary"]