X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/ed54b47eec1194dd6f669144f33bf5e734d1f255..dce9bbb32b95f9a352933e483138e1789fc8635d:/qa/qa_env.py diff --git a/qa/qa_env.py b/qa/qa_env.py index b2dff2e..986128b 100644 --- a/qa/qa_env.py +++ b/qa/qa_env.py @@ -1,7 +1,7 @@ # # -# Copyright (C) 2007 Google Inc. +# Copyright (C) 2007, 2010, 2011 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 @@ -26,51 +26,64 @@ from ganeti import utils import qa_config -import qa_utils -from qa_utils import AssertEqual, StartSSH +from qa_utils import AssertCommand def TestSshConnection(): """Test SSH connection. """ - for node in qa_config.get('nodes'): - AssertEqual(StartSSH(node['primary'], 'exit').wait(), 0) + for node in qa_config.get("nodes"): + AssertCommand("exit", node=node) def TestGanetiCommands(): """Test availibility of Ganeti commands. """ - cmds = ( ['gnt-cluster', '--version'], - ['gnt-os', '--version'], - ['gnt-node', '--version'], - ['gnt-instance', '--version'], - ['gnt-backup', '--version'], - ['ganeti-noded', '--version'], - ['ganeti-watcher', '--version'] ) - - cmd = ' && '.join([utils.ShellQuoteArgs(i) for i in cmds]) - - for node in qa_config.get('nodes'): - AssertEqual(StartSSH(node['primary'], cmd).wait(), 0) + cmds = (["gnt-backup", "--version"], + ["gnt-cluster", "--version"], + ["gnt-debug", "--version"], + ["gnt-instance", "--version"], + ["gnt-job", "--version"], + ["gnt-node", "--version"], + ["gnt-os", "--version"], + ["ganeti-masterd", "--version"], + ["ganeti-noded", "--version"], + ["ganeti-rapi", "--version"], + ["ganeti-watcher", "--version"], + ["ganeti-confd", "--version"], + ) + + cmd = " && ".join([utils.ShellQuoteArgs(i) for i in cmds]) + + for node in qa_config.get("nodes"): + AssertCommand(cmd, node=node) def TestIcmpPing(): """ICMP ping each node. """ - nodes = qa_config.get('nodes') + nodes = qa_config.get("nodes") - for node in nodes: - check = [] - for i in nodes: - check.append(i['primary']) - if i.has_key('secondary'): - check.append(i['secondary']) + pingprimary = pingsecondary = "fping" + if qa_config.get("primary_ip_version") == 6: + pingprimary = "fping6" - ping = lambda ip: utils.ShellQuoteArgs(['ping', '-w', '3', '-c', '1', ip]) - cmd = ' && '.join([ping(i) for i in check]) + pricmd = [pingprimary, "-e"] + seccmd = [pingsecondary, "-e"] + for i in nodes: + pricmd.append(i["primary"]) + if "secondary" in i: + seccmd.append(i["secondary"]) - AssertEqual(StartSSH(node['primary'], cmd).wait(), 0) + pristr = utils.ShellQuoteArgs(pricmd) + if seccmd: + cmdall = "%s && %s" % (pristr, utils.ShellQuoteArgs(seccmd)) + else: + cmdall = pristr + + for node in nodes: + AssertCommand(cmdall, node=node)