Commit f623cc78 authored by Iustin Pop's avatar Iustin Pop

QA: replace ping with fping

This allows a lot of simplification in the TestIcmpPing, as fping can
take multiple arguments so we don't need anymore to create many
commands joined with &&.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent b04808ea
#
#
# Copyright (C) 2007, 2010 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
......@@ -68,19 +68,22 @@ def TestIcmpPing():
"""
nodes = qa_config.get('nodes')
pingargs = ['-w', '3', '-c', '1 ']
pingprimary = "ping"
pingprimary = pingsecondary = "fping"
if qa_config.get("primary_ip_version") == 6:
pingprimary = "ping6"
pingprimary = "fping6"
check = []
pricmd = [pingprimary, "-e"]
seccmd = [pingsecondary, "-e"]
for i in nodes:
cmd = [pingprimary] + pingargs + [i["primary"]]
check.append(utils.ShellQuoteArgs(cmd))
pricmd.append(i["primary"])
if i.has_key("secondary"):
cmd = ["ping"] + pingargs + [i["secondary"]]
check.append(utils.ShellQuoteArgs(cmd))
cmdall = " && ".join(check)
seccmd.append(i["secondary"])
pristr = utils.ShellQuoteArgs(pricmd)
if seccmd:
cmdall = "%s && %s" % (pristr, utils.ShellQuoteArgs(seccmd))
else:
cmdall = pristr
for node in nodes:
AssertCommand(cmdall, node=node)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment