Add QA for recreating single instance disks
authorBernardo Dal Seno <bdalseno@google.com>
Fri, 10 May 2013 23:37:45 +0000 (01:37 +0200)
committerBernardo Dal Seno <bdalseno@google.com>
Tue, 14 May 2013 16:04:50 +0000 (18:04 +0200)
So far QA only recreated the whole set of disks at once.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

qa/qa_instance.py

index e856523..55d5fb7 100644 (file)
@@ -750,7 +750,13 @@ def TestRecreateDisks(instance, inodes, othernodes):
   else:
     _AssertRecreateDisks(["-n", other_seq], instance)
   # Move disks back
-  _AssertRecreateDisks(["-n", orig_seq], instance, check=False)
+  _AssertRecreateDisks(["-n", orig_seq], instance)
+  # Recreate the disks one by one
+  for idx in range(0, len(qa_config.get("disk"))):
+    # Only the first call should destroy all the disk
+    destroy = (idx == 0)
+    _AssertRecreateDisks(["--disk=%s" % idx], instance, destroy=destroy,
+                         check=False)
   # This and InstanceCheck decoration check that the disks are working
   AssertCommand(["gnt-instance", "reinstall", "-f", instance["name"]])
   AssertCommand(["gnt-instance", "start", instance["name"]])