#
#
-# 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
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()
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."""
# 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)
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)
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)
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"]])