From: Jiale Song <songx.jiale@intel.com>
To: dts@dpdk.org
Cc: Jiale Song <songx.jiale@intel.com>
Subject: [dts] [PATCH V1] tests/userspace_ethtool: fix script
Date: Fri, 27 May 2022 13:53:04 +0800 [thread overview]
Message-ID: <20220527055304.179776-2-songx.jiale@intel.com> (raw)
In-Reply-To: <20220527055304.179776-1-songx.jiale@intel.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 6142 bytes --]
fix 4 issue:
1.check and wait for the port status of the tester and dut to be up and delete some unnecessary delays.
2.700 Series not support port disconnect by tools of linux, add 'I40E_10G-10G_BASE_T_X722'
and 'I40E_10G-10G_BASE_T_BC'.
3.ensure that the dpdk app has exited and rebind the driver.
4.the driver of 'IGC-I225_LM' is i40e, not support the case, add to checklist.
Signed-off-by: Jiale Song <songx.jiale@intel.com>
---
conf/test_case_checklist.json | 3 ++-
tests/TestSuite_userspace_ethtool.py | 29 ++++++++++++++++------------
2 files changed, 19 insertions(+), 13 deletions(-)
mode change 100755 => 100644 tests/TestSuite_userspace_ethtool.py
diff --git a/conf/test_case_checklist.json b/conf/test_case_checklist.json
index 2185fcaf..87882f60 100644
--- a/conf/test_case_checklist.json
+++ b/conf/test_case_checklist.json
@@ -2131,7 +2131,8 @@
"I40E_10G-SFP_X722",
"I40E_10G-10G_BASE_T_X722",
"IAVF_10G-X722_VF",
- "I40E_10G-10G_BASE_T_BC"
+ "I40E_10G-10G_BASE_T_BC",
+ "IGC-I225_LM"
],
"Target": [
"ALL"
diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py
old mode 100755
new mode 100644
index 8a056ea2..a0a6f9c2
--- a/tests/TestSuite_userspace_ethtool.py
+++ b/tests/TestSuite_userspace_ethtool.py
@@ -55,7 +55,7 @@ class TestUserspaceEthtool(TestCase):
"""
self.ports = self.dut.get_ports()
self.verify(len(self.ports) >= 2, "No ports found for " + self.nic)
-
+ self.other_700_nic = ['I40E_10G-10G_BASE_T_X722', 'I40E_10G-10G_BASE_T_BC']
# build sample app
out = self.dut.build_dpdk_apps("examples/ethtool")
self.verify("Error" not in out, "compilation error 1")
@@ -290,18 +290,21 @@ class TestUserspaceEthtool(TestCase):
portinfo["net_dev"].bind_driver(portinfo["ori_driver"])
self.dut.send_expect(self.cmd, "EthApp>", 60)
+ for port in self.ports:
+ tester_port = self.tester.get_local_port(port)
+ intf = self.tester.get_interface(tester_port)
+ self.tester.is_interface_up(intf)
# ethtool doesn't support port disconnect by tools of linux
# only detect physical link disconnect status
verify_pass = True
verify_msg = ""
- if not (self.is_eth_series_nic(700) or self.is_eth_series_nic(800)):
+ if not (self.is_eth_series_nic(700) or self.other_700_nic or self.is_eth_series_nic(800)):
# check link status dump function
for port in self.ports:
tester_port = self.tester.get_local_port(port)
intf = self.tester.get_interface(tester_port)
self.tester.send_expect("ip link set dev %s down" % intf, "# ")
- # wait for link stable
- time.sleep(5)
+ self.tester.is_interface_down(intf)
out = self.dut.send_expect("link", "EthApp>", 60)
link_pattern = r"Port (\d+): (.*)"
@@ -326,8 +329,7 @@ class TestUserspaceEthtool(TestCase):
tester_port = self.tester.get_local_port(port)
intf = self.tester.get_interface(tester_port)
self.tester.send_expect("ip link set dev %s up" % intf, "# ")
- # wait for link stable
- time.sleep(5)
+ self.tester.is_interface_up(intf)
# check port stats function
pkt = Packet(pkt_type="UDP")
@@ -474,12 +476,13 @@ class TestUserspaceEthtool(TestCase):
)
pkt = Packet(pkt_type="UDP")
tester_port = self.tester.get_local_port(port)
+ intf = self.tester.get_interface(tester_port)
+ self.tester.is_interface_up(intf)
self.verify(
self.ethapp_check_link_status(index, "Up") == True,
"Fail to Open port{}".format(index),
)
-
- intf = self.tester.get_interface(tester_port)
+ time.sleep(1)
pkt.send_pkt(self.tester, tx_port=intf, count=4)
rx_pkts, tx_pkts = self.strip_portstats(index)
self.verify(
@@ -559,6 +562,7 @@ class TestUserspaceEthtool(TestCase):
pkt = Packet(pkt_type="UDP")
tester_port = self.tester.get_local_port(port)
intf = self.tester.get_interface(tester_port)
+ self.tester.is_interface_up(intf)
pkt.send_pkt(self.tester, tx_port=intf, count=4)
rx_pkts, tx_pkts = self.strip_portstats(index)
self.verify(rx_pkts == ori_rx_pkts, "Failed to stop port")
@@ -602,7 +606,6 @@ class TestUserspaceEthtool(TestCase):
# Intel® Ethernet 800 Series should stop port before set mtu
if self.nic in ["ICE_25G-E810C_SFP", "ICE_100G-E810C_QSFP"]:
self.dut.send_expect("stop %s" % index, "EthApp>")
-
# The mtu threshold is 2022,When it is greater than 2022, the open/stop port is required.
if mtu > mtu_threshold:
if self.nic in [
@@ -619,7 +622,10 @@ class TestUserspaceEthtool(TestCase):
if self.nic in ["ICE_25G-E810C_SFP", "ICE_100G-E810C_QSFP"]:
self.dut.send_expect("open %s" % index, "EthApp>")
- time.sleep(5)
+ self.tester.is_interface_up(intf)
+ self.verify(
+ self.ethapp_check_link_status(index, "Up") == True,
+ "Fail to Open port{}".format(index))
ori_rx_pkts, _ = self.strip_portstats(index)
pkt_size = mtu + HEADER_SIZE["eth"] + offset
pkt = Packet(pkt_type="UDP", pkt_len=pkt_size)
@@ -704,9 +710,8 @@ class TestUserspaceEthtool(TestCase):
"""
Run after each test case.
"""
- self.dut.bind_interfaces_linux(self.drivername)
self.dut.kill_all()
- pass
+ self.dut.bind_interfaces_linux(self.drivername)
def tear_down_all(self):
"""
--
2.17.1
prev parent reply other threads:[~2022-05-27 5:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 5:53 [dts] [PATCH V1] short_live: " Jiale Song
2022-05-27 5:53 ` Jiale Song [this message]
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=20220527055304.179776-2-songx.jiale@intel.com \
--to=songx.jiale@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).