Revision f623cc78
b/qa/qa_env.py | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2007, 2010 Google Inc. |
|
4 |
# Copyright (C) 2007, 2010, 2011 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 |
... | ... | |
68 | 68 |
""" |
69 | 69 |
nodes = qa_config.get('nodes') |
70 | 70 |
|
71 |
pingargs = ['-w', '3', '-c', '1 '] |
|
72 |
pingprimary = "ping" |
|
71 |
pingprimary = pingsecondary = "fping" |
|
73 | 72 |
if qa_config.get("primary_ip_version") == 6: |
74 |
pingprimary = "ping6" |
|
73 |
pingprimary = "fping6"
|
|
75 | 74 |
|
76 |
check = [] |
|
75 |
pricmd = [pingprimary, "-e"] |
|
76 |
seccmd = [pingsecondary, "-e"] |
|
77 | 77 |
for i in nodes: |
78 |
cmd = [pingprimary] + pingargs + [i["primary"]] |
|
79 |
check.append(utils.ShellQuoteArgs(cmd)) |
|
78 |
pricmd.append(i["primary"]) |
|
80 | 79 |
if i.has_key("secondary"): |
81 |
cmd = ["ping"] + pingargs + [i["secondary"]] |
|
82 |
check.append(utils.ShellQuoteArgs(cmd)) |
|
83 |
cmdall = " && ".join(check) |
|
80 |
seccmd.append(i["secondary"]) |
|
81 |
|
|
82 |
pristr = utils.ShellQuoteArgs(pricmd) |
|
83 |
if seccmd: |
|
84 |
cmdall = "%s && %s" % (pristr, utils.ShellQuoteArgs(seccmd)) |
|
85 |
else: |
|
86 |
cmdall = pristr |
|
84 | 87 |
|
85 | 88 |
for node in nodes: |
86 | 89 |
AssertCommand(cmdall, node=node) |
Also available in: Unified diff