Revision 9486f6ae qa/qa_env.py

b/qa/qa_env.py
1 1
#
2 2
#
3 3

  
4
# Copyright (C) 2007 Google Inc.
4
# Copyright (C) 2007, 2010 Google Inc.
5 5
#
6 6
# This program is free software; you can redistribute it and/or modify
7 7
# it under the terms of the GNU General Public License as published by
......
69 69
  """
70 70
  nodes = qa_config.get('nodes')
71 71

  
72
  pingargs = ['-w', '3', '-c', '1 ']
73
  pingprimary = "ping"
74
  if qa_config.get("primary_ip_version") == 6:
75
    pingprimary = "ping6"
76

  
72 77
  for node in nodes:
73 78
    check = []
74 79
    for i in nodes:
75
      check.append(i['primary'])
80
      cmd = [pingprimary] + pingargs + [i['primary']]
81
      check.append(utils.ShellQuoteArgs(cmd))
76 82
      if i.has_key('secondary'):
77
        check.append(i['secondary'])
78

  
79
    ping = lambda ip: utils.ShellQuoteArgs(['ping', '-w', '3', '-c', '1', ip])
80
    cmd = ' && '.join([ping(i) for i in check])
83
        cmd = ["ping"] + pingargs + [i["secondary"]]
84
        check.append(utils.ShellQuoteArgs(cmd))
81 85

  
82
    AssertEqual(StartSSH(node['primary'], cmd).wait(), 0)
86
    cmdall = ' && '.join(check)
87
    AssertEqual(StartSSH(node['primary'], cmdall).wait(), 0)

Also available in: Unified diff