QA: Adjust test whether file storage is enabled
authorHelga Velroyen <helgav@google.com>
Tue, 9 Jul 2013 16:20:04 +0000 (18:20 +0200)
committerHelga Velroyen <helgav@google.com>
Mon, 15 Jul 2013 09:34:36 +0000 (11:34 +0200)
This patch fixes the node storage QA, which checked whether
file storage is enabled by looking at the constant
'ENABLE_FILE_STORAGE'. QA should rather retrieve this
information from the QA config.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

qa/qa_node.py

index 2d33699..18a981d 100644 (file)
@@ -113,6 +113,7 @@ def TestNodeVolumes():
 def TestNodeStorage():
   """gnt-node storage"""
   master = qa_config.GetMasterNode()
+  enabled_disk_templates = qa_config.GetEnabledDiskTemplates()
 
   # FIXME: test all storage_types in constants.VALID_STORAGE_TYPES
   # as soon as they are implemented.
@@ -124,7 +125,9 @@ def TestNodeStorage():
     # Skip file storage if not enabled, otherwise QA will fail; we
     # just test for basic failure, but otherwise skip the rest of the
     # tests
-    if storage_type == constants.ST_FILE and not constants.ENABLE_FILE_STORAGE:
+    if storage_type == constants.ST_FILE and not \
+        ((constants.DT_FILE in enabled_disk_templates) or
+         (constants.DT_SHARED_FILE in enabled_disk_templates)):
       AssertCommand(cmd, fail=True)
       continue