doc/rapi.rst: Add ECODE_TEMP_NORES
[ganeti-local] / qa / qa_node.py
index 434de38..647af19 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2007, 2011 Google Inc.
+# Copyright (C) 2007, 2011, 2012 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -58,6 +58,12 @@ def _NodeRemove(node):
   node["_added"] = False
 
 
+def MakeNodeOffline(node, value):
+  """gnt-node modify --offline=value"""
+  # value in ["yes", "no"]
+  AssertCommand(["gnt-node", "modify", "--offline", value, node["primary"]])
+
+
 def TestNodeAddAll():
   """Adding all nodes to cluster."""
   master = qa_config.GetMasterNode()
@@ -209,6 +215,10 @@ def TestNodeModify(node):
   AssertCommand(["gnt-node", "modify", "--master-candidate=yes",
                  "--auto-promote", node["primary"]])
 
+  # Test setting secondary IP address
+  AssertCommand(["gnt-node", "modify", "--secondary-ip=%s" % node["secondary"],
+                 node["primary"]])
+
 
 def _CreateOobScriptStructure():
   """Create a simple OOB handling script and its structure."""
@@ -275,7 +285,7 @@ def TestOutOfBand():
     # Power off on master without options should fail
     AssertCommand(["gnt-node", "power", "-f", "off", master_name], fail=True)
     # With force master it should still fail
-    AssertCommand(["gnt-node", "power", "-f",  "--ignore-status", "off",
+    AssertCommand(["gnt-node", "power", "-f", "--ignore-status", "off",
                    master_name],
                   fail=True)
 
@@ -302,7 +312,7 @@ def TestOutOfBand():
     AssertCommand(["gnt-node", "health"], fail=True)
 
     # Correct Data, exit 0
-    _UpdateOobFile(data_path, serializer.DumpJson({ "powered": True }))
+    _UpdateOobFile(data_path, serializer.DumpJson({"powered": True}))
 
     AssertCommand(["gnt-node", "power", "status", node_name])
     _AssertOobCall(verify_path, "power-status %s" % full_node_name)
@@ -315,7 +325,6 @@ def TestOutOfBand():
 
     AssertCommand(["gnt-node", "health"])
 
-
     # Those commands should fail as they expect no data regardless of exit 0
     AssertCommand(["gnt-node", "power", "on", node_name], fail=True)
     _AssertOobCall(verify_path, "power-on %s" % full_node_name)
@@ -408,3 +417,8 @@ def TestNodeList():
 def TestNodeListFields():
   """gnt-node list-fields"""
   qa_utils.GenericQueryFieldsTest("gnt-node", query.NODE_FIELDS.keys())
+
+
+def TestNodeListDrbd(node):
+  """gnt-node list-drbd"""
+  AssertCommand(["gnt-node", "list-drbd", node["primary"]])