[V1] tests/vf_pmd_stacked_bonded: optimize scripts

Message ID 20230630151943.103932-1-songx.jiale@intel.com (mailing list archive)
State New
Headers
Series [V1] tests/vf_pmd_stacked_bonded: optimize scripts |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-suite-test success Testing OK

Commit Message

Jiale, SongX June 30, 2023, 3:19 p.m. UTC
  when rebinding the network card to the kdriver, the network card link
status is down, and the network card should be up first before checking
the status.

Signed-off-by: Jiale Song <songx.jiale@intel.com>
---
 tests/TestSuite_vf_pmd_stacked_bonded.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
  

Patch

diff --git a/tests/TestSuite_vf_pmd_stacked_bonded.py b/tests/TestSuite_vf_pmd_stacked_bonded.py
index 4c3fe634..f330db55 100644
--- a/tests/TestSuite_vf_pmd_stacked_bonded.py
+++ b/tests/TestSuite_vf_pmd_stacked_bonded.py
@@ -445,11 +445,10 @@  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.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.dut.is_interface_up(self.dport_ifaces_port0)
+        self.dut.is_interface_up(self.dport_ifaces_port1)
         self.eal_param = ""
         for pci in self.vfs_pci:
             self.eal_param += " -a %s" % pci