* [dts] [PATCH V1 0/1] tests/kni: resolve ping command compatibility
@ 2020-04-30 8:55 yufengmx
2020-04-30 8:55 ` [dts] [PATCH V1 1/1] " yufengmx
2020-05-06 1:42 ` [dts] [PATCH V1 0/1] " Mo, YufengX
0 siblings, 2 replies; 7+ messages in thread
From: yufengmx @ 2020-04-30 8:55 UTC (permalink / raw)
To: dts, lihongx.ma; +Cc: yufengmx
resolve ping/ping6 command compatibility in low version linux os and high version linux os.
yufengmx (1):
tests/kni: resolve ping command compatibility
tests/TestSuite_kni.py | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dts] [PATCH V1 1/1] tests/kni: resolve ping command compatibility
2020-04-30 8:55 [dts] [PATCH V1 0/1] tests/kni: resolve ping command compatibility yufengmx
@ 2020-04-30 8:55 ` yufengmx
2020-05-06 5:47 ` Tu, Lijuan
2020-05-06 1:42 ` [dts] [PATCH V1 0/1] " Mo, YufengX
1 sibling, 1 reply; 7+ messages in thread
From: yufengmx @ 2020-04-30 8:55 UTC (permalink / raw)
To: dts, lihongx.ma; +Cc: yufengmx
resolve ping/ping6 command compatibility in low version linux os and high version linux os.
-I interface can be either an address, or an interface name.
Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
tests/TestSuite_kni.py | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py
index 3cbd457..41d8fbe 100644
--- a/tests/TestSuite_kni.py
+++ b/tests/TestSuite_kni.py
@@ -559,6 +559,7 @@ class TestKni(TestCase):
# Setup IP address on virtual interfaces and tester ports
self.dut.kill_all()
self.start_kni()
+ ports_ips = {}
for port in self.config['ports']:
virtual_interface = self.virtual_interface_name(port)
@@ -567,14 +568,18 @@ class TestKni(TestCase):
out = self.dut.send_expect(
"ifconfig %s up" % virtual_interface, "# ")
time.sleep(5)
+ v_intf_ip = f"192.168.{port}.1"
+ tx_intf_ip = f"192.168.{port}.2"
self.dut.send_expect(
- "ifconfig %s 192.168.%d.1 netmask 255.255.255.192" % (virtual_interface, port), "# ")
+ "ifconfig %s %s netmask 255.255.255.192" % (v_intf_ip, port), "# ")
self.tester.send_expect(
- "ifconfig %s 192.168.%d.2 netmask 255.255.255.192" % (tx_interface, port), "# ")
+ "ifconfig %s %s netmask 255.255.255.192" % (tx_intf_ip, port), "# ")
+ ports_ips[port] = [tx_intf_ip, v_intf_ip]
self.tester.enable_ipv6(tx_interface)
time.sleep(5)
# Send ping requests and check for answers
for port in self.config['ports']:
+ tx_intf_ip, v_intf_ip = ports_ips[port]
tx_port = self.tester.get_local_port(port)
tx_interface = self.tester.get_interface(tx_port)
@@ -582,17 +587,17 @@ class TestKni(TestCase):
virtual_interface = self.virtual_interface_name(port)
out = self.dut.send_expect(
- "ping -w 2 -I %s 192.168.%d.2" % (virtual_interface, port), "# ", 10)
+ "ping -w 2 -I %s 192.168.%d.2" % (v_intf_ip, port), "# ", 10)
self.verify("64 bytes from 192.168.%d.2:" %
port in out, "ping not supported")
out = self.tester.send_expect(
- "ping -w 1 -I %s 192.168.%d.1" % (tx_interface, port), "# ", 10)
+ "ping -w 1 -I %s 192.168.%d.1" % (tx_intf_ip, port), "# ", 10)
self.verify("64 bytes from 192.168.%d.1:" %
port in out, "kni cannot reply ping packet")
out = self.dut.send_expect(
- "ping -w 1 -I %s 192.168.%d.123" % (virtual_interface, port), "# ", 10)
+ "ping -w 1 -I %s 192.168.%d.123" % (v_intf_ip, port), "# ", 10)
self.verify(
"0 received, 100% packet loss" in out, "ping not supported")
@@ -601,14 +606,14 @@ class TestKni(TestCase):
ipv6_address = out.split('\r\n')[0]
out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
- (virtual_interface, str(ipv6_address)), "# ", 10)
+ (v_intf_ip, str(ipv6_address)), "# ", 10)
# FC25 ping6 output info is "64 bytes from ipv6_address%v: icmp_seq=1 ttl=64"
# other os ping6 output is "64 bytes from ipv6_address: icmp_seq=1 ttl=64"
self.verify("64 bytes from %s" %
ipv6_address in out, "ping6 not supported")
out = self.tester.send_expect(
- "ping6 -w 1 -I %s %s" % (tx_interface, str(ipv6_address)), "# ", 10)
+ "ping6 -w 1 -I %s %s" % (tx_intf_ip, str(ipv6_address)), "# ", 10)
self.verify("64 bytes from %s" %
ipv6_address in out, "kni cannot reply ping6 packet")
@@ -621,7 +626,7 @@ class TestKni(TestCase):
break
out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
- (virtual_interface, ''.join(ipv6list)), "# ", 10)
+ (v_intf_ip, ''.join(ipv6list)), "# ", 10)
self.verify(
"0 received, 100% packet loss" in out, "ping6 not supported")
# remove ip from tester
--
2.21.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH V1 0/1] tests/kni: resolve ping command compatibility
2020-04-30 8:55 [dts] [PATCH V1 0/1] tests/kni: resolve ping command compatibility yufengmx
2020-04-30 8:55 ` [dts] [PATCH V1 1/1] " yufengmx
@ 2020-05-06 1:42 ` Mo, YufengX
1 sibling, 0 replies; 7+ messages in thread
From: Mo, YufengX @ 2020-05-06 1:42 UTC (permalink / raw)
To: dts, Ma, LihongX; +Cc: Mo, YufengX
Tested by Mo, YufengX <yufengx.mo@intel.com>
> -----Original Message-----
> From: Mo, YufengX
> Sent: Thursday, April 30, 2020 4:56 PM
> To: dts@dpdk.org; Ma, LihongX <lihongx.ma@intel.com>
> Cc: Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts][PATCH V1 0/1] tests/kni: resolve ping command compatibility
>
> resolve ping/ping6 command compatibility in low version linux os and high version linux os.
>
> yufengmx (1):
> tests/kni: resolve ping command compatibility
>
> tests/TestSuite_kni.py | 21 +++++++++++++--------
> 1 file changed, 13 insertions(+), 8 deletions(-)
>
> --
> 2.21.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH V1 1/1] tests/kni: resolve ping command compatibility
2020-04-30 8:55 ` [dts] [PATCH V1 1/1] " yufengmx
@ 2020-05-06 5:47 ` Tu, Lijuan
0 siblings, 0 replies; 7+ messages in thread
From: Tu, Lijuan @ 2020-05-06 5:47 UTC (permalink / raw)
To: Mo, YufengX, dts, Ma, LihongX; +Cc: Mo, YufengX
Applied, thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx
> Sent: Thursday, April 30, 2020 4:56 PM
> To: dts@dpdk.org; Ma, LihongX <lihongx.ma@intel.com>
> Cc: Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts] [PATCH V1 1/1] tests/kni: resolve ping command compatibility
>
>
> resolve ping/ping6 command compatibility in low version linux os and high
> version linux os.
>
> -I interface can be either an address, or an interface name.
>
> Signed-off-by: yufengmx <yufengx.mo@intel.com>
> ---
> tests/TestSuite_kni.py | 21 +++++++++++++--------
> 1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index
> 3cbd457..41d8fbe 100644
> --- a/tests/TestSuite_kni.py
> +++ b/tests/TestSuite_kni.py
> @@ -559,6 +559,7 @@ class TestKni(TestCase):
> # Setup IP address on virtual interfaces and tester ports
> self.dut.kill_all()
> self.start_kni()
> + ports_ips = {}
> for port in self.config['ports']:
> virtual_interface = self.virtual_interface_name(port)
>
> @@ -567,14 +568,18 @@ class TestKni(TestCase):
> out = self.dut.send_expect(
> "ifconfig %s up" % virtual_interface, "# ")
> time.sleep(5)
> + v_intf_ip = f"192.168.{port}.1"
> + tx_intf_ip = f"192.168.{port}.2"
> self.dut.send_expect(
> - "ifconfig %s 192.168.%d.1 netmask 255.255.255.192" %
> (virtual_interface, port), "# ")
> + "ifconfig %s %s netmask 255.255.255.192" % (v_intf_ip,
> + port), "# ")
> self.tester.send_expect(
> - "ifconfig %s 192.168.%d.2 netmask 255.255.255.192" %
> (tx_interface, port), "# ")
> + "ifconfig %s %s netmask 255.255.255.192" % (tx_intf_ip, port), "# ")
> + ports_ips[port] = [tx_intf_ip, v_intf_ip]
> self.tester.enable_ipv6(tx_interface)
> time.sleep(5)
> # Send ping requests and check for answers
> for port in self.config['ports']:
> + tx_intf_ip, v_intf_ip = ports_ips[port]
>
> tx_port = self.tester.get_local_port(port)
> tx_interface = self.tester.get_interface(tx_port)
> @@ -582,17 +587,17 @@ class TestKni(TestCase):
> virtual_interface = self.virtual_interface_name(port)
>
> out = self.dut.send_expect(
> - "ping -w 2 -I %s 192.168.%d.2" % (virtual_interface, port), "# ", 10)
> + "ping -w 2 -I %s 192.168.%d.2" % (v_intf_ip, port), "#
> + ", 10)
> self.verify("64 bytes from 192.168.%d.2:" %
> port in out, "ping not supported")
>
> out = self.tester.send_expect(
> - "ping -w 1 -I %s 192.168.%d.1" % (tx_interface, port), "# ", 10)
> + "ping -w 1 -I %s 192.168.%d.1" % (tx_intf_ip, port), "#
> + ", 10)
> self.verify("64 bytes from 192.168.%d.1:" %
> port in out, "kni cannot reply ping packet")
>
> out = self.dut.send_expect(
> - "ping -w 1 -I %s 192.168.%d.123" % (virtual_interface, port), "# ", 10)
> + "ping -w 1 -I %s 192.168.%d.123" % (v_intf_ip, port),
> + "# ", 10)
> self.verify(
> "0 received, 100% packet loss" in out, "ping not supported")
>
> @@ -601,14 +606,14 @@ class TestKni(TestCase):
> ipv6_address = out.split('\r\n')[0]
>
> out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
> - (virtual_interface, str(ipv6_address)), "# ", 10)
> + (v_intf_ip, str(ipv6_address)),
> + "# ", 10)
> # FC25 ping6 output info is "64 bytes from ipv6_address%v:
> icmp_seq=1 ttl=64"
> # other os ping6 output is "64 bytes from ipv6_address: icmp_seq=1
> ttl=64"
> self.verify("64 bytes from %s" %
> ipv6_address in out, "ping6 not supported")
>
> out = self.tester.send_expect(
> - "ping6 -w 1 -I %s %s" % (tx_interface, str(ipv6_address)), "# ", 10)
> + "ping6 -w 1 -I %s %s" % (tx_intf_ip,
> + str(ipv6_address)), "# ", 10)
> self.verify("64 bytes from %s" %
> ipv6_address in out, "kni cannot reply ping6 packet")
>
> @@ -621,7 +626,7 @@ class TestKni(TestCase):
> break
>
> out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
> - (virtual_interface, ''.join(ipv6list)), "# ", 10)
> + (v_intf_ip, ''.join(ipv6list)),
> + "# ", 10)
> self.verify(
> "0 received, 100% packet loss" in out, "ping6 not supported")
> # remove ip from tester
> --
> 2.21.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH V1 1/1] tests/kni: resolve ping command compatibility
2020-05-11 2:29 ` [dts] [PATCH V1 1/1] " yufengmx
2020-05-11 2:34 ` Zhang, XiX
@ 2020-05-12 7:37 ` Tu, Lijuan
1 sibling, 0 replies; 7+ messages in thread
From: Tu, Lijuan @ 2020-05-12 7:37 UTC (permalink / raw)
To: Mo, YufengX, dts, Ma, LihongX, Zhang, XiX; +Cc: Mo, YufengX
Applied, thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx
> Sent: Monday, May 11, 2020 10:30 AM
> To: dts@dpdk.org; Ma, LihongX <lihongx.ma@intel.com>; Zhang, XiX
> <xix.zhang@intel.com>
> Cc: Mo, YufengX <yufengx.mo@intel.com>
> Subject: [dts] [PATCH V1 1/1] tests/kni: resolve ping command compatibility
>
>
> fix previous version missing merged code.
> add more redundant processing.
>
> Signed-off-by: yufengmx <yufengx.mo@intel.com>
> ---
> tests/TestSuite_kni.py | 53 ++++++++++++++++++++++++++----------------
> 1 file changed, 33 insertions(+), 20 deletions(-)
>
> diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index
> 41d8fbe..2b2281d 100644
> --- a/tests/TestSuite_kni.py
> +++ b/tests/TestSuite_kni.py
> @@ -571,9 +571,9 @@ class TestKni(TestCase):
> v_intf_ip = f"192.168.{port}.1"
> tx_intf_ip = f"192.168.{port}.2"
> self.dut.send_expect(
> - "ifconfig %s %s netmask 255.255.255.192" % (v_intf_ip, port), "# ")
> + "ifconfig %s %s netmask 255.255.255.192" %
> + (virtual_interface, v_intf_ip), "# ")
> self.tester.send_expect(
> - "ifconfig %s %s netmask 255.255.255.192" % (tx_intf_ip, port), "# ")
> + "ifconfig %s %s netmask 255.255.255.192" %
> + (tx_interface, tx_intf_ip), "# ")
> ports_ips[port] = [tx_intf_ip, v_intf_ip]
> self.tester.enable_ipv6(tx_interface)
> time.sleep(5)
> @@ -588,35 +588,45 @@ class TestKni(TestCase):
>
> out = self.dut.send_expect(
> "ping -w 2 -I %s 192.168.%d.2" % (v_intf_ip, port), "# ", 10)
> - self.verify("64 bytes from 192.168.%d.2:" %
> - port in out, "ping not supported")
> -
> + out1 = self.dut.send_expect(
> + "ping -w 2 -I %s 192.168.%d.2" % (virtual_interface, port), "# ", 10)
> + expected_str = "64 bytes from 192.168.%d.2:" % port
> + self.verify(any([expected_str in out, expected_str in out1]),
> + "ping not supported")
> out = self.tester.send_expect(
> "ping -w 1 -I %s 192.168.%d.1" % (tx_intf_ip, port), "# ", 10)
> - self.verify("64 bytes from 192.168.%d.1:" %
> - port in out, "kni cannot reply ping packet")
> -
> + out1 = self.tester.send_expect(
> + "ping -w 1 -I %s 192.168.%d.1" % (tx_interface, port), "# ", 10)
> + expected_str = "64 bytes from 192.168.%d.1:" % port
> + self.verify(any([expected_str in out, expected_str in out1]),
> + "kni cannot reply ping packet")
> out = self.dut.send_expect(
> "ping -w 1 -I %s 192.168.%d.123" % (v_intf_ip, port), "# ", 10)
> - self.verify(
> - "0 received, 100% packet loss" in out, "ping not supported")
> -
> + out1 = self.dut.send_expect(
> + "ping -w 1 -I %s 192.168.%d.123" % (virtual_interface, port), "# ",
> 10)
> + expected_str = "0 received, 100% packet loss"
> + self.verify(all([expected_str in out, expected_str in out1]),
> + "ping not supported")
> out = self.dut.send_expect(
> "ip -family inet6 address show dev %s | awk '/inet6/ { print $2 }'|
> cut -d'/' -f1" % virtual_interface, "# ", 10)
> ipv6_address = out.split('\r\n')[0]
> -
> + self.tester.send_expect("ifconfig %s up" % tx_interface, "#
> + ")
> out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
> (v_intf_ip, str(ipv6_address)), "# ", 10)
> + out1 = self.dut.send_expect("ping6 -w 1 -I %s %s" %
> + (virtual_interface,
> + str(ipv6_address)), "# ", 10)
> # FC25 ping6 output info is "64 bytes from ipv6_address%v:
> icmp_seq=1 ttl=64"
> # other os ping6 output is "64 bytes from ipv6_address: icmp_seq=1
> ttl=64"
> - self.verify("64 bytes from %s" %
> - ipv6_address in out, "ping6 not supported")
> -
> + expected_str = "64 bytes from %s" % ipv6_address
> + self.verify(any([expected_str in out, expected_str in out1]),
> + "ping6 not supported")
> out = self.tester.send_expect(
> "ping6 -w 1 -I %s %s" % (tx_intf_ip, str(ipv6_address)), "# ", 10)
> - self.verify("64 bytes from %s" %
> - ipv6_address in out, "kni cannot reply ping6 packet")
> -
> + out1 = self.tester.send_expect(
> + "ping6 -w 1 -I %s %s" % (tx_interface, str(ipv6_address)), "# ", 10)
> + expected_str = "64 bytes from %s" % ipv6_address
> + self.verify(any([expected_str in out, expected_str in out1]),
> + "kni cannot reply ping6 packet")
> ipv6list = list(ipv6_address)
> for j in range(10):
> if str(j) == ipv6list[-1]:
> @@ -627,8 +637,11 @@ class TestKni(TestCase):
>
> out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
> (v_intf_ip, ''.join(ipv6list)), "# ", 10)
> - self.verify(
> - "0 received, 100% packet loss" in out, "ping6 not supported")
> + out1 = self.dut.send_expect("ping6 -w 1 -I %s %s" %
> + (virtual_interface, ''.join(ipv6list)), "# ", 10)
> + expected_str = "0 received, 100% packet loss"
> + self.verify(any([expected_str in out, expected_str in out1]),
> + "ping6 not supported")
> # remove ip from tester
> self.tester.send_expect(
> "ip addr del 192.168.%d.2 dev %s" % (port, tx_interface), "# ")
> --
> 2.21.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH V1 1/1] tests/kni: resolve ping command compatibility
2020-05-11 2:29 ` [dts] [PATCH V1 1/1] " yufengmx
@ 2020-05-11 2:34 ` Zhang, XiX
2020-05-12 7:37 ` Tu, Lijuan
1 sibling, 0 replies; 7+ messages in thread
From: Zhang, XiX @ 2020-05-11 2:34 UTC (permalink / raw)
To: Mo, YufengX, dts, Ma, LihongX
[-- Attachment #1: Type: text/plain, Size: 5861 bytes --]
Tested-by:xix.zhang@intel.com
-----Original Message-----
From: Mo, YufengX
Sent: Monday, May 11, 2020 10:30 AM
To: dts@dpdk.org; Ma, LihongX <lihongx.ma@intel.com>; Zhang, XiX <xix.zhang@intel.com>
Cc: Mo, YufengX <yufengx.mo@intel.com>
Subject: [dts][PATCH V1 1/1] tests/kni: resolve ping command compatibility
fix previous version missing merged code.
add more redundant processing.
Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
tests/TestSuite_kni.py | 53 ++++++++++++++++++++++++++----------------
1 file changed, 33 insertions(+), 20 deletions(-)
diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index 41d8fbe..2b2281d 100644
--- a/tests/TestSuite_kni.py
+++ b/tests/TestSuite_kni.py
@@ -571,9 +571,9 @@ class TestKni(TestCase):
v_intf_ip = f"192.168.{port}.1"
tx_intf_ip = f"192.168.{port}.2"
self.dut.send_expect(
- "ifconfig %s %s netmask 255.255.255.192" % (v_intf_ip, port), "# ")
+ "ifconfig %s %s netmask 255.255.255.192" %
+ (virtual_interface, v_intf_ip), "# ")
self.tester.send_expect(
- "ifconfig %s %s netmask 255.255.255.192" % (tx_intf_ip, port), "# ")
+ "ifconfig %s %s netmask 255.255.255.192" %
+ (tx_interface, tx_intf_ip), "# ")
ports_ips[port] = [tx_intf_ip, v_intf_ip]
self.tester.enable_ipv6(tx_interface)
time.sleep(5)
@@ -588,35 +588,45 @@ class TestKni(TestCase):
out = self.dut.send_expect(
"ping -w 2 -I %s 192.168.%d.2" % (v_intf_ip, port), "# ", 10)
- self.verify("64 bytes from 192.168.%d.2:" %
- port in out, "ping not supported")
-
+ out1 = self.dut.send_expect(
+ "ping -w 2 -I %s 192.168.%d.2" % (virtual_interface, port), "# ", 10)
+ expected_str = "64 bytes from 192.168.%d.2:" % port
+ self.verify(any([expected_str in out, expected_str in out1]),
+ "ping not supported")
out = self.tester.send_expect(
"ping -w 1 -I %s 192.168.%d.1" % (tx_intf_ip, port), "# ", 10)
- self.verify("64 bytes from 192.168.%d.1:" %
- port in out, "kni cannot reply ping packet")
-
+ out1 = self.tester.send_expect(
+ "ping -w 1 -I %s 192.168.%d.1" % (tx_interface, port), "# ", 10)
+ expected_str = "64 bytes from 192.168.%d.1:" % port
+ self.verify(any([expected_str in out, expected_str in out1]),
+ "kni cannot reply ping packet")
out = self.dut.send_expect(
"ping -w 1 -I %s 192.168.%d.123" % (v_intf_ip, port), "# ", 10)
- self.verify(
- "0 received, 100% packet loss" in out, "ping not supported")
-
+ out1 = self.dut.send_expect(
+ "ping -w 1 -I %s 192.168.%d.123" % (virtual_interface, port), "# ", 10)
+ expected_str = "0 received, 100% packet loss"
+ self.verify(all([expected_str in out, expected_str in out1]),
+ "ping not supported")
out = self.dut.send_expect(
"ip -family inet6 address show dev %s | awk '/inet6/ { print $2 }'| cut -d'/' -f1" % virtual_interface, "# ", 10)
ipv6_address = out.split('\r\n')[0]
-
+ self.tester.send_expect("ifconfig %s up" % tx_interface, "#
+ ")
out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
(v_intf_ip, str(ipv6_address)), "# ", 10)
+ out1 = self.dut.send_expect("ping6 -w 1 -I %s %s" %
+ (virtual_interface,
+ str(ipv6_address)), "# ", 10)
# FC25 ping6 output info is "64 bytes from ipv6_address%v: icmp_seq=1 ttl=64"
# other os ping6 output is "64 bytes from ipv6_address: icmp_seq=1 ttl=64"
- self.verify("64 bytes from %s" %
- ipv6_address in out, "ping6 not supported")
-
+ expected_str = "64 bytes from %s" % ipv6_address
+ self.verify(any([expected_str in out, expected_str in out1]),
+ "ping6 not supported")
out = self.tester.send_expect(
"ping6 -w 1 -I %s %s" % (tx_intf_ip, str(ipv6_address)), "# ", 10)
- self.verify("64 bytes from %s" %
- ipv6_address in out, "kni cannot reply ping6 packet")
-
+ out1 = self.tester.send_expect(
+ "ping6 -w 1 -I %s %s" % (tx_interface, str(ipv6_address)), "# ", 10)
+ expected_str = "64 bytes from %s" % ipv6_address
+ self.verify(any([expected_str in out, expected_str in out1]),
+ "kni cannot reply ping6 packet")
ipv6list = list(ipv6_address)
for j in range(10):
if str(j) == ipv6list[-1]:
@@ -627,8 +637,11 @@ class TestKni(TestCase):
out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
(v_intf_ip, ''.join(ipv6list)), "# ", 10)
- self.verify(
- "0 received, 100% packet loss" in out, "ping6 not supported")
+ out1 = self.dut.send_expect("ping6 -w 1 -I %s %s" %
+ (virtual_interface, ''.join(ipv6list)), "# ", 10)
+ expected_str = "0 received, 100% packet loss"
+ self.verify(any([expected_str in out, expected_str in out1]),
+ "ping6 not supported")
# remove ip from tester
self.tester.send_expect(
"ip addr del 192.168.%d.2 dev %s" % (port, tx_interface), "# ")
--
2.21.0
[-- Attachment #2: TestKni.log --]
[-- Type: application/octet-stream, Size: 6665343 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dts] [PATCH V1 1/1] tests/kni: resolve ping command compatibility
2020-05-11 2:29 yufengmx
@ 2020-05-11 2:29 ` yufengmx
2020-05-11 2:34 ` Zhang, XiX
2020-05-12 7:37 ` Tu, Lijuan
0 siblings, 2 replies; 7+ messages in thread
From: yufengmx @ 2020-05-11 2:29 UTC (permalink / raw)
To: dts, lihongx.ma, xix.zhang; +Cc: yufengmx
fix previous version missing merged code.
add more redundant processing.
Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
tests/TestSuite_kni.py | 53 ++++++++++++++++++++++++++----------------
1 file changed, 33 insertions(+), 20 deletions(-)
diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py
index 41d8fbe..2b2281d 100644
--- a/tests/TestSuite_kni.py
+++ b/tests/TestSuite_kni.py
@@ -571,9 +571,9 @@ class TestKni(TestCase):
v_intf_ip = f"192.168.{port}.1"
tx_intf_ip = f"192.168.{port}.2"
self.dut.send_expect(
- "ifconfig %s %s netmask 255.255.255.192" % (v_intf_ip, port), "# ")
+ "ifconfig %s %s netmask 255.255.255.192" % (virtual_interface, v_intf_ip), "# ")
self.tester.send_expect(
- "ifconfig %s %s netmask 255.255.255.192" % (tx_intf_ip, port), "# ")
+ "ifconfig %s %s netmask 255.255.255.192" % (tx_interface, tx_intf_ip), "# ")
ports_ips[port] = [tx_intf_ip, v_intf_ip]
self.tester.enable_ipv6(tx_interface)
time.sleep(5)
@@ -588,35 +588,45 @@ class TestKni(TestCase):
out = self.dut.send_expect(
"ping -w 2 -I %s 192.168.%d.2" % (v_intf_ip, port), "# ", 10)
- self.verify("64 bytes from 192.168.%d.2:" %
- port in out, "ping not supported")
-
+ out1 = self.dut.send_expect(
+ "ping -w 2 -I %s 192.168.%d.2" % (virtual_interface, port), "# ", 10)
+ expected_str = "64 bytes from 192.168.%d.2:" % port
+ self.verify(any([expected_str in out, expected_str in out1]),
+ "ping not supported")
out = self.tester.send_expect(
"ping -w 1 -I %s 192.168.%d.1" % (tx_intf_ip, port), "# ", 10)
- self.verify("64 bytes from 192.168.%d.1:" %
- port in out, "kni cannot reply ping packet")
-
+ out1 = self.tester.send_expect(
+ "ping -w 1 -I %s 192.168.%d.1" % (tx_interface, port), "# ", 10)
+ expected_str = "64 bytes from 192.168.%d.1:" % port
+ self.verify(any([expected_str in out, expected_str in out1]),
+ "kni cannot reply ping packet")
out = self.dut.send_expect(
"ping -w 1 -I %s 192.168.%d.123" % (v_intf_ip, port), "# ", 10)
- self.verify(
- "0 received, 100% packet loss" in out, "ping not supported")
-
+ out1 = self.dut.send_expect(
+ "ping -w 1 -I %s 192.168.%d.123" % (virtual_interface, port), "# ", 10)
+ expected_str = "0 received, 100% packet loss"
+ self.verify(all([expected_str in out, expected_str in out1]),
+ "ping not supported")
out = self.dut.send_expect(
"ip -family inet6 address show dev %s | awk '/inet6/ { print $2 }'| cut -d'/' -f1" % virtual_interface, "# ", 10)
ipv6_address = out.split('\r\n')[0]
-
+ self.tester.send_expect("ifconfig %s up" % tx_interface, "# ")
out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
(v_intf_ip, str(ipv6_address)), "# ", 10)
+ out1 = self.dut.send_expect("ping6 -w 1 -I %s %s" %
+ (virtual_interface, str(ipv6_address)), "# ", 10)
# FC25 ping6 output info is "64 bytes from ipv6_address%v: icmp_seq=1 ttl=64"
# other os ping6 output is "64 bytes from ipv6_address: icmp_seq=1 ttl=64"
- self.verify("64 bytes from %s" %
- ipv6_address in out, "ping6 not supported")
-
+ expected_str = "64 bytes from %s" % ipv6_address
+ self.verify(any([expected_str in out, expected_str in out1]),
+ "ping6 not supported")
out = self.tester.send_expect(
"ping6 -w 1 -I %s %s" % (tx_intf_ip, str(ipv6_address)), "# ", 10)
- self.verify("64 bytes from %s" %
- ipv6_address in out, "kni cannot reply ping6 packet")
-
+ out1 = self.tester.send_expect(
+ "ping6 -w 1 -I %s %s" % (tx_interface, str(ipv6_address)), "# ", 10)
+ expected_str = "64 bytes from %s" % ipv6_address
+ self.verify(any([expected_str in out, expected_str in out1]),
+ "kni cannot reply ping6 packet")
ipv6list = list(ipv6_address)
for j in range(10):
if str(j) == ipv6list[-1]:
@@ -627,8 +637,11 @@ class TestKni(TestCase):
out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
(v_intf_ip, ''.join(ipv6list)), "# ", 10)
- self.verify(
- "0 received, 100% packet loss" in out, "ping6 not supported")
+ out1 = self.dut.send_expect("ping6 -w 1 -I %s %s" %
+ (virtual_interface, ''.join(ipv6list)), "# ", 10)
+ expected_str = "0 received, 100% packet loss"
+ self.verify(any([expected_str in out, expected_str in out1]),
+ "ping6 not supported")
# remove ip from tester
self.tester.send_expect(
"ip addr del 192.168.%d.2 dev %s" % (port, tx_interface), "# ")
--
2.21.0
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-05-12 7:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 8:55 [dts] [PATCH V1 0/1] tests/kni: resolve ping command compatibility yufengmx
2020-04-30 8:55 ` [dts] [PATCH V1 1/1] " yufengmx
2020-05-06 5:47 ` Tu, Lijuan
2020-05-06 1:42 ` [dts] [PATCH V1 0/1] " Mo, YufengX
2020-05-11 2:29 yufengmx
2020-05-11 2:29 ` [dts] [PATCH V1 1/1] " yufengmx
2020-05-11 2:34 ` Zhang, XiX
2020-05-12 7:37 ` Tu, Lijuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).