Modify Disk.GetNodes() to support LD_FILE
[ganeti-local] / qa / qa_node.py
index 5691511..26ecceb 100644 (file)
@@ -1,3 +1,6 @@
+#
+#
+
 # Copyright (C) 2007 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -25,6 +28,7 @@ import qa_utils
 from qa_utils import AssertEqual, StartSSH
 
 
+@qa_utils.DefineHook('node-add')
 def _NodeAdd(node):
   master = qa_config.GetMasterNode()
 
@@ -41,6 +45,7 @@ def _NodeAdd(node):
   node['_added'] = True
 
 
+@qa_utils.DefineHook('node-remove')
 def _NodeRemove(node):
   master = qa_config.GetMasterNode()
 
@@ -66,6 +71,7 @@ def TestNodeRemoveAll():
       _NodeRemove(node)
 
 
+@qa_utils.DefineHook('node-info')
 def TestNodeInfo():
   """gnt-node info"""
   master = qa_config.GetMasterNode()
@@ -75,6 +81,7 @@ def TestNodeInfo():
                        utils.ShellQuoteArgs(cmd)).wait(), 0)
 
 
+@qa_utils.DefineHook('node-volumes')
 def TestNodeVolumes():
   """gnt-node volumes"""
   master = qa_config.GetMasterNode()
@@ -84,14 +91,15 @@ def TestNodeVolumes():
                        utils.ShellQuoteArgs(cmd)).wait(), 0)
 
 
+@qa_utils.DefineHook('node-failover')
 def TestNodeFailover(node, node2):
   """gnt-node failover"""
   master = qa_config.GetMasterNode()
 
   if qa_utils.GetNodeInstances(node2, secondaries=False):
-    raise qa_error.UnusableNodeError("Secondary node has at least one "
-                                     "primary instance. This test requires "
-                                     "it to have no primary instances.")
+    raise qa_error.UnusableNodeError("Secondary node has at least one"
+                                     " primary instance. This test requires"
+                                     " it to have no primary instances.")
 
   # Fail over to secondary node
   cmd = ['gnt-node', 'failover', '-f', node['primary']]
@@ -104,6 +112,7 @@ def TestNodeFailover(node, node2):
                        utils.ShellQuoteArgs(cmd)).wait(), 0)
 
 
+@qa_utils.DefineHook('node-evacuate')
 def TestNodeEvacuate(node, node2):
   """gnt-node evacuate"""
   master = qa_config.GetMasterNode()
@@ -111,9 +120,9 @@ def TestNodeEvacuate(node, node2):
   node3 = qa_config.AcquireNode(exclude=[node, node2])
   try:
     if qa_utils.GetNodeInstances(node3, secondaries=True):
-      raise qa_error.UnusableNodeError("Evacuation node has at least one "
-                                       "secondary instance. This test requires "
-                                       "it to have no secondary instances.")
+      raise qa_error.UnusableNodeError("Evacuation node has at least one"
+                                       " secondary instance. This test requires"
+                                       " it to have no secondary instances.")
 
     # Evacuate all secondary instances
     cmd = ['gnt-node', 'evacuate', '-f', node2['primary'], node3['primary']]