Revision 2f4b4f78 qa/qa_env.py

b/qa/qa_env.py
26 26
from ganeti import utils
27 27

  
28 28
import qa_config
29
import qa_utils
30 29

  
31
from qa_utils import AssertEqual, StartSSH
30
from qa_utils import AssertCommand
32 31

  
33 32

  
34 33
def TestSshConnection():
35 34
  """Test SSH connection.
36 35

  
37 36
  """
38
  for node in qa_config.get('nodes'):
39
    AssertEqual(StartSSH(node['primary'], 'exit').wait(), 0)
37
  for node in qa_config.get("nodes"):
38
    AssertCommand("exit", node=node)
40 39

  
41 40

  
42 41
def TestGanetiCommands():
......
60 59
  cmd = ' && '.join([utils.ShellQuoteArgs(i) for i in cmds])
61 60

  
62 61
  for node in qa_config.get('nodes'):
63
    AssertEqual(StartSSH(node['primary'], cmd).wait(), 0)
62
    AssertCommand(cmd, node=node)
64 63

  
65 64

  
66 65
def TestIcmpPing():
......
74 73
  if qa_config.get("primary_ip_version") == 6:
75 74
    pingprimary = "ping6"
76 75

  
77
  for node in nodes:
78
    check = []
79
    for i in nodes:
80
      cmd = [pingprimary] + pingargs + [i['primary']]
76
  check = []
77
  for i in nodes:
78
    cmd = [pingprimary] + pingargs + [i["primary"]]
79
    check.append(utils.ShellQuoteArgs(cmd))
80
    if i.has_key("secondary"):
81
      cmd = ["ping"] + pingargs + [i["secondary"]]
81 82
      check.append(utils.ShellQuoteArgs(cmd))
82
      if i.has_key('secondary'):
83
        cmd = ["ping"] + pingargs + [i["secondary"]]
84
        check.append(utils.ShellQuoteArgs(cmd))
83
  cmdall = " && ".join(check)
85 84

  
86
    cmdall = ' && '.join(check)
87
    AssertEqual(StartSSH(node['primary'], cmdall).wait(), 0)
85
  for node in nodes:
86
    AssertCommand(cmdall, node=node)

Also available in: Unified diff