Skip to content
Snippets Groups Projects
Commit f623cc78 authored by Iustin Pop's avatar Iustin Pop
Browse files

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
No related branches found
No related tags found
No related merge requests found
# #
# #
# 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 # 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 # it under the terms of the GNU General Public License as published by
...@@ -68,19 +68,22 @@ def TestIcmpPing(): ...@@ -68,19 +68,22 @@ def TestIcmpPing():
""" """
nodes = qa_config.get('nodes') nodes = qa_config.get('nodes')
pingargs = ['-w', '3', '-c', '1 '] pingprimary = pingsecondary = "fping"
pingprimary = "ping"
if qa_config.get("primary_ip_version") == 6: if qa_config.get("primary_ip_version") == 6:
pingprimary = "ping6" pingprimary = "fping6"
check = [] pricmd = [pingprimary, "-e"]
seccmd = [pingsecondary, "-e"]
for i in nodes: for i in nodes:
cmd = [pingprimary] + pingargs + [i["primary"]] pricmd.append(i["primary"])
check.append(utils.ShellQuoteArgs(cmd))
if i.has_key("secondary"): if i.has_key("secondary"):
cmd = ["ping"] + pingargs + [i["secondary"]] seccmd.append(i["secondary"])
check.append(utils.ShellQuoteArgs(cmd))
cmdall = " && ".join(check) pristr = utils.ShellQuoteArgs(pricmd)
if seccmd:
cmdall = "%s && %s" % (pristr, utils.ShellQuoteArgs(seccmd))
else:
cmdall = pristr
for node in nodes: for node in nodes:
AssertCommand(cmdall, node=node) AssertCommand(cmdall, node=node)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment