From ebddbcb0f76d5320853b3d342e0db36bbf8c6626 Mon Sep 17 00:00:00 2001 From: Jing Zhang Date: Fri, 7 Apr 2017 21:35:00 -0400 Subject: Extend TC008 to run pktgen-dpdk inside VM Need a fast path inside VM to verify full throughput of SRIOV and OVS-dpdk. Update 1: Change newly added file names to avoid conflict Update 2: Add more unit test cases Update 3: Fix default parameter typo for testpmd Update 4: Adapted to the pktgen-dpdk prompt change from "Pktgen>" to "Pktgen:/>", now just expect "Pktgen" Update 5: Per comment, merge common functions between latency and throughput tests to utils.py Update 6: Per comment, seperate the test case from TC008 to a new test case TC077 Change-Id: I1f7471d4ba77636a3a66c79c2652578321312185 JIRA: YARDSTICK-614 Signed-off-by: Jing Zhang --- .../unit/benchmark/scenarios/networking/test_pktgen_dpdk.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk.py') diff --git a/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk.py b/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk.py index 496ee770c..e6998e443 100644 --- a/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk.py +++ b/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk.py @@ -16,6 +16,7 @@ import unittest import mock +import yardstick.common.utils as utils from yardstick.benchmark.scenarios.networking import pktgen_dpdk @@ -60,11 +61,10 @@ class PktgenDPDKLatencyTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (0, '', '') - p.get_port_ip(p.server, "eth1") + utils.get_port_ip(p.server, "eth1") mock_ssh.SSH.from_node().execute.assert_called_with( - "ifconfig eth1 |grep 'inet addr' |awk '{print $2}' \ - |cut -d ':' -f2 ") + "ifconfig eth1 |grep 'inet addr' |awk '{print $2}' |cut -d ':' -f2 ") def test_pktgen_dpdk_unsuccessful_get_port_ip(self, mock_ssh): @@ -76,7 +76,7 @@ class PktgenDPDKLatencyTestCase(unittest.TestCase): p.server = mock_ssh.SSH.from_node() mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') - self.assertRaises(RuntimeError, p.get_port_ip, p.server, "eth1") + self.assertRaises(RuntimeError, utils.get_port_ip, p.server, "eth1") def test_pktgen_dpdk_successful_get_port_mac(self, mock_ssh): @@ -88,7 +88,7 @@ class PktgenDPDKLatencyTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (0, '', '') - p.get_port_mac(p.server, "eth1") + utils.get_port_mac(p.server, "eth1") mock_ssh.SSH.from_node().execute.assert_called_with( "ifconfig |grep HWaddr |grep eth1 |awk '{print $5}' ") @@ -103,7 +103,7 @@ class PktgenDPDKLatencyTestCase(unittest.TestCase): p.server = mock_ssh.SSH.from_node() mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') - self.assertRaises(RuntimeError, p.get_port_mac, p.server, "eth1") + self.assertRaises(RuntimeError, utils.get_port_mac, p.server, "eth1") def test_pktgen_dpdk_successful_no_sla(self, mock_ssh): -- cgit 1.2.3-korg