projects
/
ganeti-local
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert snapshot_export rpc to new style
[ganeti-local]
/
qa
/
qa_node.py
diff --git
a/qa/qa_node.py
b/qa/qa_node.py
index
26ecceb
..
6caa48e
100644
(file)
--- a/
qa/qa_node.py
+++ b/
qa/qa_node.py
@@
-28,16
+28,19
@@
import qa_utils
from qa_utils import AssertEqual, StartSSH
from qa_utils import AssertEqual, StartSSH
-@qa_utils.DefineHook('node-add')
-def _NodeAdd(node):
+def _NodeAdd(node, readd=False):
master = qa_config.GetMasterNode()
master = qa_config.GetMasterNode()
- if node.get('_added', False):
+ if not readd and node.get('_added', False):
raise qa_error.Error("Node %s already in cluster" % node['primary'])
raise qa_error.Error("Node %s already in cluster" % node['primary'])
+ elif readd and not node.get('_added', False):
+ raise qa_error.Error("Node %s not yet in cluster" % node['primary'])
- cmd = ['gnt-node', 'add']
+ cmd = ['gnt-node', 'add', "--no-ssh-key-check"]
if node.get('secondary', None):
cmd.append('--secondary-ip=%s' % node['secondary'])
if node.get('secondary', None):
cmd.append('--secondary-ip=%s' % node['secondary'])
+ if readd:
+ cmd.append('--readd')
cmd.append(node['primary'])
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
cmd.append(node['primary'])
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
@@
-45,7
+48,6
@@
def _NodeAdd(node):
node['_added'] = True
node['_added'] = True
-@qa_utils.DefineHook('node-remove')
def _NodeRemove(node):
master = qa_config.GetMasterNode()
def _NodeRemove(node):
master = qa_config.GetMasterNode()
@@
-60,7
+62,7
@@
def TestNodeAddAll():
master = qa_config.GetMasterNode()
for node in qa_config.get('nodes'):
if node != master:
master = qa_config.GetMasterNode()
for node in qa_config.get('nodes'):
if node != master:
- _NodeAdd(node)
+ _NodeAdd(node, readd=False)
def TestNodeRemoveAll():
def TestNodeRemoveAll():
@@
-71,7
+73,11
@@
def TestNodeRemoveAll():
_NodeRemove(node)
_NodeRemove(node)
-@qa_utils.DefineHook('node-info')
+def TestNodeReadd(node):
+ """gnt-node add --readd"""
+ _NodeAdd(node, readd=True)
+
+
def TestNodeInfo():
"""gnt-node info"""
master = qa_config.GetMasterNode()
def TestNodeInfo():
"""gnt-node info"""
master = qa_config.GetMasterNode()
@@
-81,7
+87,6
@@
def TestNodeInfo():
utils.ShellQuoteArgs(cmd)).wait(), 0)
utils.ShellQuoteArgs(cmd)).wait(), 0)
-@qa_utils.DefineHook('node-volumes')
def TestNodeVolumes():
"""gnt-node volumes"""
master = qa_config.GetMasterNode()
def TestNodeVolumes():
"""gnt-node volumes"""
master = qa_config.GetMasterNode()
@@
-91,7
+96,6
@@
def TestNodeVolumes():
utils.ShellQuoteArgs(cmd)).wait(), 0)
utils.ShellQuoteArgs(cmd)).wait(), 0)
-@qa_utils.DefineHook('node-failover')
def TestNodeFailover(node, node2):
"""gnt-node failover"""
master = qa_config.GetMasterNode()
def TestNodeFailover(node, node2):
"""gnt-node failover"""
master = qa_config.GetMasterNode()
@@
-112,7
+116,6
@@
def TestNodeFailover(node, node2):
utils.ShellQuoteArgs(cmd)).wait(), 0)
utils.ShellQuoteArgs(cmd)).wait(), 0)
-@qa_utils.DefineHook('node-evacuate')
def TestNodeEvacuate(node, node2):
"""gnt-node evacuate"""
master = qa_config.GetMasterNode()
def TestNodeEvacuate(node, node2):
"""gnt-node evacuate"""
master = qa_config.GetMasterNode()