[dts] [PATCH 2/2] tests add TestSuite_VEB

Liu, Yong yong.liu at intel.com
Fri Oct 14 16:05:11 CEST 2016


This patch look like small patch for the first one. You can just send out the final version.

> -----Original Message-----
> From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of Yuan Peng
> Sent: Friday, October 14, 2016 8:51 AM
> To: dts at dpdk.org
> Cc: Peng, Yuan
> Subject: [dts] [PATCH 2/2] tests add TestSuite_VEB
> 
> From: pengyuan <yuan.peng at intel.com>
> 
> Signed-off-by: pengyuan <yuan.peng at intel.com>
> 
> diff --git a/tests/TestSuite_VEB.py b/tests/TestSuite_VEB.py
> index 6296ff1..9b97a97 100644
> --- a/tests/TestSuite_VEB.py
> +++ b/tests/TestSuite_VEB.py
> @@ -145,17 +145,8 @@ class TestVEBSwitching(TestCase):
>                      "NIC Unsupported: " + str(self.nic))
>          self.dut_ports = self.dut.get_ports(self.nic)
>          self.verify(len(self.dut_ports) >= 1, "Insufficient ports")
> -        # self.rx_port = self.dut_ports[0]
> -        # self.tx_port = self.dut_ports[0]
> -
> -        # cores = self.dut.get_core_list("1S/2C/1T")
> -        # self.coremask = dts.create_mask(cores)
> -
> -        # self.port_mask = dts.create_mask([self.rx_port, self.tx_port])
>          self.session_secondary = self.dut.new_session()
>          self.session_third = self.dut.new_session()
> -        # self.pmdout = PmdOutput(self.dut)
> -        # self.pmdout_session_secondary =
> PmdOutput(self.session_secondary)
> 
>      def set_up(self):
>          """
> @@ -206,8 +197,11 @@ class TestVEBSwitching(TestCase):
> 
>      def destroy_1pf_ddriver_4vf_env(self):
>          self.session_third.send_expect("quit", "# ")
> +        time.sleep(2)
>          self.session_secondary.send_expect("quit", "# ")
> +        time.sleep(2)
>          self.dut.send_expect("quit", "# ")
> +        time.sleep(2)
>          self.dut.destroy_sriov_vfs_by_port(self.used_dut_port)
>          port = self.dut.ports_info[self.used_dut_port]['port']
>          port.bind_driver()
> @@ -252,8 +246,11 @@ class TestVEBSwitching(TestCase):
> 
>      def destroy_1pf_ddriver_2vf_env(self):
>          self.session_third.send_expect("quit", "# ")
> +        time.sleep(2)
>          self.session_secondary.send_expect("quit", "# ")
> +        time.sleep(2)
>          self.dut.send_expect("quit", "# ")
> +        time.sleep(2)
>          self.dut.destroy_sriov_vfs_by_port(self.used_dut_port)
>          port = self.dut.ports_info[self.used_dut_port]['port']
>          port.bind_driver()
> @@ -273,7 +270,6 @@ class TestVEBSwitching(TestCase):
>          self.pf_mac_address = self.dut.get_mac_address(0)
>          self.pf_pci = self.dut.ports_info[self.used_dut_port]['pci']
>          self.dut.send_expect("./tools/dpdk-devbind.py -s", "# ", 3)
> -        # self.dut.send_expect("echo 1 >
> /sys/bus/pci/devices/%s/max_vfs" % self.pf_pci, "# ", 3)
>          self.dut.generate_sriov_vfs_by_port(self.used_dut_port, 1,
> driver='igb_uio')
>          self.sriov_vfs_port =
> self.dut.ports_info[self.used_dut_port]['vfs_port']
>          self.dut.send_expect("./tools/dpdk-devbind.py -s", "# ", 3)
> @@ -301,7 +297,9 @@ class TestVEBSwitching(TestCase):
>      def destroy_1pf_ddriver_1vf_env(self):
> 
>          self.session_secondary.send_expect("quit", "# ")
> +        time.sleep(2)
>          self.dut.send_expect("quit", "# ")
> +        time.sleep(2)
>          self.dut.destroy_sriov_vfs_by_port(self.used_dut_port)
>          port = self.dut.ports_info[self.used_dut_port]['port']
>          port.bind_driver()
> @@ -323,8 +321,6 @@ class TestVEBSwitching(TestCase):
>          self.pf_interface =
> self.dut.ports_info[self.used_dut_port]['intf']
>          self.dut.generate_sriov_vfs_by_port(self.used_dut_port, 2,
> driver=driver)
>          self.sriov_vfs_port =
> self.dut.ports_info[self.used_dut_port]['vfs_port']
> -        #self.vf0_mac = "00:11:22:33:44:11"
> -        #self.vf1_mac = "00:11:22:33:44:12"
>          self.dut.send_expect("ip link set %s vf 0 mac %s" %
> (self.pf_interface, self.vf0_mac), "# ", 3)
>          self.dut.send_expect("ip link set %s vf 1 mac %s" %
> (self.pf_interface, self.vf1_mac), "# ", 3)
> 
> @@ -337,13 +333,7 @@ class TestVEBSwitching(TestCase):
>              time.sleep(1)
>              vf0_prop = {'opt_host': self.sriov_vfs_port[0].pci}
>              vf1_prop = {'opt_host': self.sriov_vfs_port[1].pci}
> -
> -            # for port_id in self.dut_ports:
> -            #     if port_id == self.used_dut_port:
> -            #         continue
> -            #     port = self.dut.ports_info[port_id]['port']
> -            #     port.bind_driver()
> -
> +
>              self.setup_1pf_kdriver_2vf_env_flag = 1
>          except Exception as e:
>              self.destroy_1pf_kdriver_2vf_env()
> @@ -352,7 +342,9 @@ class TestVEBSwitching(TestCase):
>      def destroy_1pf_kdriver_2vf_env(self):
> 
>          self.session_secondary.send_expect("quit", "# ")
> +        time.sleep(2)
>          self.dut.send_expect("quit", "# ")
> +        time.sleep(2)
>          self.dut.destroy_sriov_vfs_by_port(self.used_dut_port)
>          port = self.dut.ports_info[self.used_dut_port]['port']
>          port.bind_driver()
> @@ -470,7 +462,7 @@ class TestVEBSwitching(TestCase):
>          self.verify(vf0_tx_stats[0] != 0, "no packet was sent by VF0")
>          self.verify((vf0_tx_stats[0] == 1) and (vf1_rx_stats[0] == 1),
> "VF1 didn't receive packets from VF0, the vlan filter doen't work")
> 
> -    def test_VEB_switching_inter_pf_vf_MAC_switch(self):
> +    def test_VEB_switching_inter_vfs_pf_MAC_switch(self):
>          """
>          DPDK PF, then create 1VF, PF in the host running dpdk testpmd,
> send traffic from PF to VF1, ensure PF->VF1(let VF1 in promisc mode); send
> traffic from VF1 to PF,            ensure VF1->PF can work.
>          """
> --
> 2.5.0



More information about the dts mailing list