+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
from qa_utils import AssertEqual, StartSSH
+@qa_utils.DefineHook('node-add')
def _NodeAdd(node):
master = qa_config.GetMasterNode()
node['_added'] = True
+@qa_utils.DefineHook('node-remove')
def _NodeRemove(node):
master = qa_config.GetMasterNode()
_NodeRemove(node)
+@qa_utils.DefineHook('node-info')
def TestNodeInfo():
"""gnt-node info"""
master = qa_config.GetMasterNode()
utils.ShellQuoteArgs(cmd)).wait(), 0)
+@qa_utils.DefineHook('node-volumes')
def TestNodeVolumes():
"""gnt-node volumes"""
master = qa_config.GetMasterNode()
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']]
utils.ShellQuoteArgs(cmd)).wait(), 0)
+@qa_utils.DefineHook('node-evacuate')
def TestNodeEvacuate(node, node2):
"""gnt-node evacuate"""
master = qa_config.GetMasterNode()
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']]