[dts] [PATCH] tests/vf_macfilter: move function description into the right place

Lijuan Tu lijuan.tu at intel.com
Wed Nov 28 18:31:00 CET 2018


align with pep8, function description should be put under the function name
and before the implementing codes.

Signed-off-by: Lijuan Tu <lijuan.tu at intel.com>
---
 tests/TestSuite_vf_macfilter.py | 61 +++++++++++++++++++++++++----------------
 1 file changed, 37 insertions(+), 24 deletions(-)

diff --git a/tests/TestSuite_vf_macfilter.py b/tests/TestSuite_vf_macfilter.py
index 5998d38..9e6db42 100644
--- a/tests/TestSuite_vf_macfilter.py
+++ b/tests/TestSuite_vf_macfilter.py
@@ -118,13 +118,16 @@ class TestVfMacFilter(TestCase):
             port.bind_driver()
 
         self.setup_2pf_2vf_1vm_env_flag = 0
-
-######1. test case for kernel pf and dpdk vf 2pf_2vf_1vm MAC filter scenario
-###### kernel pf will first run 'ip link set pf_interface vf 0 mac xx:xx:xx:xx:xx:xx, then 
-###### in the vm, send packets with this MAC to VF, check if the MAC filter works. Also 
-###### send the packets with wrong MAC address to VF, check if the VF will not RX the packets.
  
     def test_kernel_2pf_2vf_1vm_iplink_macfilter(self):
+        """
+        test case for kernel pf and dpdk vf 2pf_2vf_1vm MAC filter
+        scenario
+        kernel pf will first run 'ip link set pf_interface vf 0 mac
+        xx:xx:xx:xx:xx:xx', then send packets with this MAC to VF, check
+        if the MAC filter works. Also send the packets with wrong MAC
+        address to VF, check if the VF will not RX the packets.
+        """
         self.setup_2pf_2vf_1vm_env(driver='',True)
         self.result_verify_iplink(True)
 
@@ -162,34 +165,44 @@ class TestVfMacFilter(TestCase):
         print "\nshow port stats in testpmd for double check: \n", self.vm0_testpmd.execute_cmd('show port stats all')
         self.verify(result2 != True, "VF0 failed to forward packets to VF1")
 
-
-#######2. test case for kernel pf and dpdk vf 2pf_2vf_1vm MAC filter scenario.
-####### kernel pf will not set MAC address and the VF will get a random generated MAC
-####### in the testpmd in VM, and then add VF mac address in the testpmd,for example, VF_MAC1
-####### then send packets to the VF with the random generated MAC and the new added VF_MAC1 
-####### and the expected result is that all packets can be RXed and TXed. What's more, send
-####### packets with a wrong MAC address to the VF will not received by the VF. 
-
     def test_kernel_2pf_2vf_1vm_mac_add_filter(self):
-
+        """
+        test case for kernel pf and dpdk vf 2pf_2vf_1vm MAC filter
+        scenario.
+        kernel pf will not set MAC address and the VF will get a random
+        generated MAC in the testpmd in VM, and then add VF mac address
+        in the testpmd,for example, VF_MAC1 then send packets to the VF
+        with the random generated MAC and the new added VF_MAC1 and the
+        expected result is that all packets can be RXed and TXed.
+        What's more, send packets with a wrong MAC address to the VF will
+        not received by the VF.
+        """
         self.setup_2pf_2vf_1vm_env(driver='',False)
         self.send_packet_and_verify()
 
-#######3. test case for dpdk pf and dpdk vf 2pf_2vf_1vm MAC filter scenario.
-####### kernel pf will not set MAC address and the VF will get a random generated MAC
-####### in the testpmd in VM, and then add VF mac address in the testpmd,for example, VF_MAC1
-####### then send packets to the VF with the random generated MAC and the new added VF_MAC1
-####### and the expected result is that all packets can be RXed and TXed. What's more, send
-####### packets with a wrong MAC address to the VF will not received by the VF.
     def test_dpdk_2pf_2vf_1vm_mac_add_filter(self):
+        """
+        test case for dpdk pf and dpdk vf 2pf_2vf_1vm MAC filter scenario
+        dpdk pf will not set MAC address and the VF will get a random
+        generated MAC in the testpmd in VM, and then add VF mac address
+        in the testpmd,for example, VF_MAC1 then send packets to the VF
+        with the random generated MAC and the new added VF_MAC1 and the
+        expected result is that all packets can be RXed and TXed.
+        What's more, send packets with a wrong MAC address to the VF will
+        not received by the VF.
+        """
         self.setup_2pf_2vf_1vm_env(driver='igb_uio',False)
         self.send_packet_and_verify()
 
-######4. test case for dpdk pf and dpdk vf 2pf_2vf_1vm MAC filter scenario
-###### dpdk pf will first run 'set vf mac addr 0 0 xx:xx:xx:xx:xx:xx, then
-###### in the vm, send packets with this MAC to VF, check if the MAC filter works. Also
-###### send the packets with wrong MAC address to VF, check if the VF will not RX the packets.
     def test_dpdk_2pf_2vf_1vm_iplink_macfilter(self):
+        """
+        test case for dpdk pf and dpdk vf 2pf_2vf_1vm MAC filter scenario
+        dpdk pf will first run 'set vf mac addr 0 0 xx:xx:xx:xx:xx:xx,
+        then send packets with this MAC to VF, check if the MAC filter
+        send the packets with wrong MAC address to VF, check if the VF will
+        not RX the packets works. Also send the packets with wrong MAC
+        address to VF, check if the VF will not RX the packets.
+        """
         self.setup_2pf_2vf_1vm_env(driver='igb_uio',False)
         self.result_verify_iplink(False)
 
-- 
1.8.3.1



More information about the dts mailing list