From: Lijuan Tu <lijuanx.a.tu@intel.com>
To: dts@dpdk.org
Subject: [dts] [patch] fix kni (ifconfig/ethtool/tcpdump) test_case failed
Date: Tue, 3 Nov 2015 11:17:44 +0800 [thread overview]
Message-ID: <1446520664-7657-1-git-send-email-lijuanx.a.tu@intel.com> (raw)
From: lijuan tu <lijuanx.a.tu@intel.com>
Signed-off-by: lijuan tu <lijuanx.a.tu@intel.com>
---
tests/TestSuite_kni.py | 43 +++++++++++++++++++++++++------------------
1 file changed, 25 insertions(+), 18 deletions(-)
diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py
index 14c100b..10e922f 100644
--- a/tests/TestSuite_kni.py
+++ b/tests/TestSuite_kni.py
@@ -220,15 +220,15 @@ stress_modes_output = [{'lo_mode': None, 'kthread_mode': None,
{'lo_mode': None, 'kthread_mode': 'multiple',
'output': 'loopback disabled.*DPDK kni module loaded.*Multiple kernel thread'},
{'lo_mode': None, 'kthread_mode': 'singlemulti',
- 'output': 'KNI: Error: Invalid parameter for kthread_mode'},
+ 'output': 'KNI.* Invalid parameter for kthread_mode'},
{'lo_mode': 'lo_mode_fifo', 'kthread_mode': 'multiple',
'output': 'loopback mode=lo_mode_fifo enabled.*Multiple kernel thread'},
{'lo_mode': 'lo_mode_fifo_skb', 'kthread_mode': 'multiple',
'output': 'loopback mode=lo_mode_fifo_skb enabled.*Multiple kernel thread'},
{'lo_mode': 'lo_mode_fifo_skb', 'kthread_mode': 'singlemulti',
- 'output': 'KNI: Error: Invalid parameter for kthread_mode'},
+ 'output': 'Invalid parameter for kthread_mode'},
{'lo_mode': 'lo_mode_random', 'kthread_mode': 'multiple',
- 'output': 'KNI: Incognizant parameter, loopback disabled'}
+ 'output': 'KNI.* Incognizant parameter, loopback disabled'}
]
@@ -262,7 +262,7 @@ class TestKni(TestCase):
self.verify('Error' not in out, "Compilation failed")
self.extract_ports_cores_config(default_1_port_cores_config)
- self.start_kni()
+ out = self.start_kni()
self.verify("Error" not in out, "Error found during kni start")
self.dut.send_expect("service iptables stop", "# ")
@@ -307,8 +307,9 @@ class TestKni(TestCase):
out_kni = self.dut.send_expect(
'./examples/kni/build/app/kni -c %s -n %d -- -P -p %s %s &' %
(core_mask, self.dut.get_memory_channels(), port_mask, config_param),
- "APP: Lcore [0-9]+ is reading from port [0-9]+", 10)
+ "APP: Lcore [0-9]+ is reading from port [0-9]+", 20)
+ time.sleep(5)
if kthread_mode == 'single':
kthread_mask = dts.create_mask(self.config['kernel_cores'])
out = self.dut.send_expect(
@@ -523,6 +524,8 @@ class TestKni(TestCase):
# Ports and cores configuration set in set_up_all function
# Setup IP address on virtual interfaces and tester ports
+ self.dut.kill_all()
+ self.start_kni()
for port in self.config['ports']:
virtual_interface = self.virtual_interface_name(port)
@@ -530,12 +533,13 @@ class TestKni(TestCase):
tx_interface = self.tester.get_interface(tx_port)
out = self.dut.send_expect(
"ifconfig %s up" % virtual_interface, "# ")
+ time.sleep(5)
self.dut.send_expect(
- "ifconfig %s 192.168.%d.1" % (virtual_interface, port), "# ")
+ "ifconfig %s 192.168.%d.1 netmask 255.255.255.192" % (virtual_interface, port), "# ")
self.tester.send_expect(
- "ifconfig %s 192.168.%d.2" % (tx_interface, port), "# ")
+ "ifconfig %s 192.168.%d.2 netmask 255.255.255.192" % (tx_interface, port), "# ")
self.tester.enable_ipv6(tx_interface)
- time.sleep(1)
+ time.sleep(5)
# Send ping requests and check for answers
for port in self.config['ports']:
@@ -545,36 +549,36 @@ class TestKni(TestCase):
virtual_interface = self.virtual_interface_name(port)
out = self.dut.send_expect(
- "ping -w 1 -I %s 192.168.%d.1" % (virtual_interface, port), "# ", 5)
+ "ping -w 2 -I %s 192.168.%d.1" % (virtual_interface, port), "# ", 10)
self.verify("64 bytes from 192.168.%d.1:" %
port in out, "ping not supported")
out = self.dut.send_expect(
- "ping -w 1 -I %s 192.168.%d.2" % (virtual_interface, port), "# ", 5)
+ "ping -w 2 -I %s 192.168.%d.2" % (virtual_interface, 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), "# ", 5)
+ "ping -w 1 -I %s 192.168.%d.1" % (tx_interface, 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), "# ", 5)
+ "ping -w 1 -I %s 192.168.%d.123" % (virtual_interface, port), "# ", 10)
self.verify(
"0 received, 100% packet loss" in out, "ping not supported")
out = self.dut.send_expect(
- "ip -family inet6 address show dev %s | awk '/inet6/ { print $2 }'| cut -d'/' -f1" % virtual_interface, "# ", 5)
+ "ip -family inet6 address show dev %s | awk '/inet6/ { print $2 }'| cut -d'/' -f1" % virtual_interface, "# ", 10)
ipv6_address = out.split('\r\n')[0]
out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
- (virtual_interface, str(ipv6_address)), "# ", 5)
+ (virtual_interface, str(ipv6_address)), "# ", 10)
self.verify("64 bytes from %s: icmp_seq=1 ttl=64" %
ipv6_address in out, "ping6 not supported")
out = self.tester.send_expect(
- "ping6 -w 1 -I %s %s" % (tx_interface, str(ipv6_address)), "# ", 5)
+ "ping6 -w 1 -I %s %s" % (tx_interface, str(ipv6_address)), "# ", 10)
self.verify("64 bytes from %s: icmp_seq=1 ttl=64" %
ipv6_address in out, "kni cannot reply ping6 packet")
@@ -587,7 +591,7 @@ class TestKni(TestCase):
break
out = self.dut.send_expect("ping6 -w 1 -I %s %s" %
- (virtual_interface, ''.join(ipv6list)), "# ", 5)
+ (virtual_interface, ''.join(ipv6list)), "# ", 10)
self.verify(
"0 received, 100% packet loss" in out, "ping6 not supported")
@@ -603,6 +607,8 @@ class TestKni(TestCase):
"""
# Ports and cores configuration set in set_up_all function
+ self.dut.kill_all()
+ self.start_kni()
for port in self.config['ports']:
virtual_interface = self.virtual_interface_name(port)
@@ -613,6 +619,7 @@ class TestKni(TestCase):
tx_interface = self.tester.get_interface(tx_port)
self.dut.send_expect("ifconfig %s up" % virtual_interface, "# ")
+ time.sleep(5)
# Start tcpdump with filters for src and dst MAC address, this avoids
# unwanted broadcast, ICPM6... packets
@@ -711,8 +718,8 @@ class TestKni(TestCase):
# Request register dump
out = self.dut.send_expect("ethtool -d %s" % virtual_interface,
"# ")
- self.verify("Link Status register" in out,
- "'ethtool -d' not supported")
+ expectstring = "0x00000: CTRL.*0x00008: STATUS"
+ self.verify(len(re.findall(expectstring, out , re.DOTALL)) > 0, "'ethtool -d' not supported")
self.verify("Operation not supported" not in out,
"'ethtool -d' not supported")
--
2.1.0
next reply other threads:[~2015-11-03 3:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 3:17 Lijuan Tu [this message]
2015-11-03 3:51 ` Liu, Yong
2015-11-03 5:04 ` Tu, LijuanX A
2015-11-03 5:12 ` Liu, Yong
2015-11-03 8:16 ` Tu, LijuanX A
2015-11-04 3:14 ` Liu, Yong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1446520664-7657-1-git-send-email-lijuanx.a.tu@intel.com \
--to=lijuanx.a.tu@intel.com \
--cc=dts@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).