Hs2Py constants: update Python references
[ganeti-local] / qa / qa_node.py
index 2d33699..a2928d6 100644 (file)
@@ -114,27 +114,22 @@ def TestNodeStorage():
   """gnt-node storage"""
   master = qa_config.GetMasterNode()
 
-  # FIXME: test all storage_types in constants.VALID_STORAGE_TYPES
+  # FIXME: test all storage_types in constants.STORAGE_TYPES
   # as soon as they are implemented.
-  for storage_type in [constants.ST_FILE, constants.ST_LVM_VG,
-                       constants.ST_LVM_PV]:
+  enabled_storage_types = qa_config.GetEnabledStorageTypes()
+  testable_storage_types = list(set(enabled_storage_types).intersection(
+      set([constants.ST_FILE, constants.ST_LVM_VG, constants.ST_LVM_PV])))
 
-    cmd = ["gnt-node", "list-storage", "--storage-type", storage_type]
+  for storage_type in testable_storage_types:
 
-    # 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:
-      AssertCommand(cmd, fail=True)
-      continue
+    cmd = ["gnt-node", "list-storage", "--storage-type", storage_type]
 
     # Test simple list
     AssertCommand(cmd)
 
     # Test all storage fields
     cmd = ["gnt-node", "list-storage", "--storage-type", storage_type,
-           "--output=%s" % ",".join(list(constants.VALID_STORAGE_FIELDS) +
-                                    [constants.SF_NODE, constants.SF_TYPE])]
+           "--output=%s" % ",".join(list(constants.VALID_STORAGE_FIELDS))]
     AssertCommand(cmd)
 
     # Get list of valid storage devices