From: Ondrej Lichtner <olichtne(a)redhat.com>
Depending on the version of the ping binary this option is required if
the ping command is to be used with an ipv6 address.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Tests/Ping.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lnst/Tests/Ping.py b/lnst/Tests/Ping.py
index 039cb7e..e115cb9 100644
--- a/lnst/Tests/Ping.py
+++ b/lnst/Tests/Ping.py
@@ -4,6 +4,7 @@ import subprocess
from lnst.Common.Parameters import IntParam, FloatParam, IpParam, DeviceOrIpParam
from lnst.Common.ExecCmd import exec_cmd
from lnst.Common.Utils import is_installed
+from lnst.Common.IpAddress import Ip6Address
from lnst.Tests.BaseTestModule import BaseTestModule, TestModuleError
class Ping(BaseTestModule):
@@ -16,6 +17,8 @@ class Ping(BaseTestModule):
def _compose_cmd(self):
cmd = "ping %s" % self.params.dst
+ if isinstance(self.params.dst, Ip6Address):
+ cmd += " -6"
cmd += " -c %d" % self.params.count
cmd += " -i %f" % self.params.interval
if "interface" in self.params:
--
2.19.0