diff mbox series

[V2,04/10] tests/cvl_dcf_switch_filter: update case code for driver change

Message ID 1635840720-90878-4-git-send-email-songx.jiale@intel.com (mailing list archive)
State Accepted
Headers show
Series [V2,01/10] tests/cvl_dcf_flow_priority: update case code for driver change | expand

Commit Message

Jiale Song Nov. 2, 2021, 8:11 a.m. UTC
Signed-off-by: Jiale Song <songx.jiale@intel.com>
---
 tests/TestSuite_cvl_dcf_switch_filter.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tests/TestSuite_cvl_dcf_switch_filter.py b/tests/TestSuite_cvl_dcf_switch_filter.py
index e319366d..f65d0452 100755
--- a/tests/TestSuite_cvl_dcf_switch_filter.py
+++ b/tests/TestSuite_cvl_dcf_switch_filter.py
@@ -1031,6 +1031,9 @@  class CVLDCFSwitchFilterTest(TestCase):
         self.testpmd_status = "close"
         #bind pf to kernel
         self.bind_nics_driver(self.dut_ports, driver="ice")
+        # get priv-flags default stats
+        self.flag = 'vf-vlan-pruning'
+        self.default_stats = self.dut.get_priv_flags_state(self.pf0_intf, self.flag)
 
         #set vf driver
         self.vf_driver = 'vfio-pci'
@@ -1043,7 +1046,8 @@  class CVLDCFSwitchFilterTest(TestCase):
         #get PF interface name
         self.pf0_intf = self.dut.ports_info[self.used_dut_port_0]['intf']
         out = self.dut.send_expect('ethtool -i %s' % self.pf0_intf, '#')
-        self.dut.send_expect('ethtool --set-priv-flags {} vf-vlan-prune-disable on'.format(self.pf0_intf), '#')
+        if self.default_stats:
+            self.dut.send_expect('ethtool --set-priv-flags %s %s off' % (self.pf0_intf, self.flag), "# ")
         #generate 4 VFs on PF
         self.dut.generate_sriov_vfs_by_port(self.used_dut_port_0, 4, driver=driver)
         self.sriov_vfs_port_0 = self.dut.ports_info[self.used_dut_port_0]['vfs_port']
@@ -1880,5 +1884,6 @@  class CVLDCFSwitchFilterTest(TestCase):
         """
         Run after each test suite.
         """
-        self.dut.send_expect('ethtool --set-priv-flags {} vf-vlan-prune-disable off'.format(self.pf0_intf), '#')
         self.dut.kill_all()
+        if self.default_stats:
+            self.dut.send_expect('ethtool --set-priv-flags %s %s %s' % (self.pf0_intf, self.flag, self.default_stats), "# ")