From: Weiyuan Li <weiyuanx.li@intel.com>
To: dts@dpdk.org
Cc: Weiyuan Li <weiyuanx.li@intel.com>
Subject: [dts][PATCH V1] tests/vf_pmd_stacked_bonded: optimize script to check link status
Date: Mon, 29 May 2023 15:41:11 +0000 [thread overview]
Message-ID: <20230529154112.84789-1-weiyuanx.li@intel.com> (raw)
Optimize the testing script to check the status of the link. If the status is down, execute the up command.
Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---
tests/TestSuite_vf_pmd_stacked_bonded.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/TestSuite_vf_pmd_stacked_bonded.py b/tests/TestSuite_vf_pmd_stacked_bonded.py
index 615e9517..0a5bc2be 100644
--- a/tests/TestSuite_vf_pmd_stacked_bonded.py
+++ b/tests/TestSuite_vf_pmd_stacked_bonded.py
@@ -403,7 +403,8 @@ class TestVFPmdStackedBonded(TestCase):
self.verify("bsdapp" not in self.target, "Bonding not support freebsd")
self.dut_ports = self.dut.get_ports()
self.dport_info0 = self.dut.ports_info[self.dut_ports[0]]
- self.dport_ifaces = self.dport_info0["intf"]
+ self.dport_ifaces_port0 = self.dport_info0["intf"]
+ self.dport_ifaces_port1 = self.dut.ports_info[self.dut_ports[1]]["intf"]
num_ports = len(self.dut_ports)
self.verify(num_ports == 2 or num_ports == 4, "Insufficient ports")
tester_port0 = self.tester.get_local_port(self.dut_ports[0])
@@ -444,6 +445,11 @@ class TestVFPmdStackedBonded(TestCase):
Run before each test case.
"""
self.create_vfs(pf_list=self.dut_ports, vf_num=1)
+ port0_stats = self.dut.is_interface_up(self.dport_ifaces_port0)
+ port1_stats = self.dut.is_interface_up(self.dport_ifaces_port1)
+ if not all([port0_stats, port1_stats]):
+ self.dut.send_expect(f"ip link set {self.dport_ifaces_port0} up", "# ")
+ self.dut.send_expect(f"ip link set {self.dport_ifaces_port1} up", "# ")
self.eal_param = ""
for pci in self.vfs_pci:
self.eal_param += " -a %s" % pci
--
2.34.1
next reply other threads:[~2023-05-29 7:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-29 15:41 Weiyuan Li [this message]
2023-06-07 5:58 ` lijuan.tu
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=20230529154112.84789-1-weiyuanx.li@intel.com \
--to=weiyuanx.li@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).