diff options
author | Angela Czubak <aczubak@caviumnetworks.com> | 2017-04-19 14:22:01 +0200 |
---|---|---|
committer | Marvin Liu <yong.liu@intel.com> | 2017-04-20 13:23:24 +0800 |
commit | cb0cae9d3b5abaaa8f8a90f693c0140a233169b7 (patch) | |
tree | e440edde660c0c4307b59dfe8dad52e237de11b1 /tests | |
parent | 7ccaf28006b6374fe33f44863df268ef1d2f0905 (diff) |
tests: Modified tests to take cavium nics into account
Testpmd should be run with hardware vlan filter disabled for cavium
nics as the driver does not offer this kind of capability and the
application stops at the beginning, so if cavium nic is used the
--disable-hw-vlan-filter flag is added.
Shutdown api test is also modified so as to skip disabling jumbo frames
mixed with vlan if hardware-assisted VLAN filtering not
configured (rte_eth_dev_set_vlan_offload return -ENOTSUP + there is
"failed diag" in the tespmd output).
Tests to be skipped for cavium nics are added to
conf/dpdk_test_case_checklist.xls
Signed-off-by: Angela Czubak <aczubak at caviumnetworks.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/TestSuite_pmdpcap.py | 4 | ||||
-rw-r--r-- | tests/TestSuite_short_live.py | 6 | ||||
-rw-r--r-- | tests/TestSuite_shutdown_api.py | 31 |
3 files changed, 23 insertions, 18 deletions
diff --git a/tests/TestSuite_pmdpcap.py b/tests/TestSuite_pmdpcap.py index a080dd0..0a79e96 100644 --- a/tests/TestSuite_pmdpcap.py +++ b/tests/TestSuite_pmdpcap.py @@ -124,6 +124,8 @@ class TestPmdPcap(TestCase): command = ("./{}/app/testpmd -c {} -n {} " + "--vdev=eth_pcap0,rx_pcap={},tx_pcap={} " + "-- -i --port-topology=chained") + if "cavium" in self.dut.nic_type: + command += " --disable-hw-vlan-filter" self.dut.send_expect(command.format(self.target, core_mask, self.memory_channel, @@ -158,6 +160,8 @@ class TestPmdPcap(TestCase): "--vdev=eth_pcap0,rx_pcap={},tx_pcap={} " + "--vdev=eth_pcap1,rx_pcap={},tx_pcap={} " + "-- -i") + if "cavium" in self.dut.nic_type: + command += " --disable-hw-vlan-filter" self.dut.send_expect(command.format(self.target, core_mask, self.memory_channel, diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.py index 320951f..72745a9 100644 --- a/tests/TestSuite_short_live.py +++ b/tests/TestSuite_short_live.py @@ -125,7 +125,7 @@ class TestShortLiveApp(TestCase): Basic rx/tx forwarding test """ #dpdk start - self.dut.send_expect("./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3", "testpmd>", 120) + self.dut.send_expect("./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3" % self.target, "testpmd>", 120) self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("set promisc all off", "testpmd>") self.dut.send_expect("start", "testpmd>") @@ -137,7 +137,7 @@ class TestShortLiveApp(TestCase): """ time = [] regex = re.compile(".* (\d+:\d{2}\.\d{2}).*") - out = self.dut.send_expect("echo quit | time ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x3 -n 4 --no-pci -- -i", "#", 120) + out = self.dut.send_expect("echo quit | time ./%s/app/testpmd -c 0x3 -n 4 --no-pci -- -i" % self.target, "#", 120) time = regex.findall(out) if time != []: @@ -150,7 +150,7 @@ class TestShortLiveApp(TestCase): for i in range(repeat_time): #dpdk start print "clean_up_with_signal_testpmd round %d" % (i + 1) - self.dut.send_expect("./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3", "testpmd>", 120) + self.dut.send_expect("./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3" % self.target, "testpmd>", 120) self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("set promisc all off", "testpmd>") self.dut.send_expect("start", "testpmd>") diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py index 66219f5..c497652 100644 --- a/tests/TestSuite_shutdown_api.py +++ b/tests/TestSuite_shutdown_api.py @@ -332,25 +332,26 @@ class TestShutdownApi(TestCase): jumbo_size = 2048 self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket) self.dut.send_expect("port stop all", "testpmd> ", 100) - self.dut.send_expect("vlan set strip off all", "testpmd> ") self.dut.send_expect("port config all max-pkt-len %d" % jumbo_size, "testpmd> ") - for port in self.ports: - self.dut.send_expect("rx_vlan add 1 %d" % port, "testpmd> ") - self.dut.send_expect("set fwd mac", "testpmd>") - self.dut.send_expect("port start all", "testpmd> ", 100) - self.dut.send_expect("start", "testpmd> ") + out = self.dut.send_expect("vlan set strip off all", "testpmd> ") + if "fail" not in out: + for port in self.ports: + self.dut.send_expect("rx_vlan add 1 %d" % port, "testpmd> ") + self.dut.send_expect("set fwd mac", "testpmd>") + self.dut.send_expect("port start all", "testpmd> ", 100) + self.dut.send_expect("start", "testpmd> ") - if self.nic in ['magnolia_park', 'niantic', 'twinpond', 'kawela_4', 'ironpond', 'springfountain', 'springville', 'powerville']: - # nantic vlan length will not be calculated - vlan_jumbo_size = jumbo_size + 4 - else: - vlan_jumbo_size = jumbo_size + if self.nic in ['magnolia_park', 'niantic', 'twinpond', 'kawela_4', 'ironpond', 'springfountain', 'springville', 'powerville']: + # nantic vlan length will not be calculated + vlan_jumbo_size = jumbo_size + 4 + else: + vlan_jumbo_size = jumbo_size - self.check_forwarding(pktSize=vlan_jumbo_size - 1, vlan=True) - self.check_forwarding(pktSize=vlan_jumbo_size, vlan=True) - self.check_forwarding(pktSize=vlan_jumbo_size + 1, received=False, vlan=True) + self.check_forwarding(pktSize=vlan_jumbo_size - 1, vlan=True) + self.check_forwarding(pktSize=vlan_jumbo_size, vlan=True) + self.check_forwarding(pktSize=vlan_jumbo_size + 1, received=False, vlan=True) - self.dut.send_expect("stop", "testpmd> ") + self.dut.send_expect("stop", "testpmd> ") self.dut.send_expect("port stop all", "testpmd> ", 100) self.dut.send_expect("port config all hw-vlan off", "testpmd> ") |