diff options
Diffstat (limited to 'tests/unit')
3 files changed, 15 insertions, 14 deletions
diff --git a/tests/unit/benchmark/scenarios/networking/test_pktgen.py b/tests/unit/benchmark/scenarios/networking/test_pktgen.py index 0ca31d484..3928aacde 100644 --- a/tests/unit/benchmark/scenarios/networking/test_pktgen.py +++ b/tests/unit/benchmark/scenarios/networking/test_pktgen.py @@ -264,7 +264,7 @@ class PktgenTestCase(unittest.TestCase): p._get_available_queue_number() mock_ssh.SSH.from_node().execute.assert_called_with( - "sudo ethtool -l eth0 | grep Combined | head -1 |" \ + "sudo ethtool -l eth0 | grep Combined | head -1 |" "awk '{printf $2}'") def test_pktgen_unsuccessful_get_available_queue_number(self, mock_ssh): @@ -290,7 +290,7 @@ class PktgenTestCase(unittest.TestCase): p._get_usable_queue_number() mock_ssh.SSH.from_node().execute.assert_called_with( - "sudo ethtool -l eth0 | grep Combined | tail -1 |" \ + "sudo ethtool -l eth0 | grep Combined | tail -1 |" "awk '{printf $2}'") def test_pktgen_unsuccessful_get_usable_queue_number(self, mock_ssh): @@ -541,7 +541,7 @@ class PktgenTestCase(unittest.TestCase): p._is_irqbalance_disabled = mock_result1 mock_result2 = mock.Mock() - mock_result2.return_value = "virtio_net" + mock_result2.return_value = "virtio_net" p._get_vnic_driver_name = mock_result2 mock_result3 = mock.Mock() @@ -571,7 +571,7 @@ class PktgenTestCase(unittest.TestCase): p._is_irqbalance_disabled = mock_result1 mock_result2 = mock.Mock() - mock_result2.return_value = "virtio_net" + mock_result2.return_value = "virtio_net" p._get_vnic_driver_name = mock_result2 mock_result3 = mock.Mock() @@ -601,7 +601,7 @@ class PktgenTestCase(unittest.TestCase): p._is_irqbalance_disabled = mock_result1 mock_result2 = mock.Mock() - mock_result2.return_value = "ixgbevf" + mock_result2.return_value = "ixgbevf" p._get_vnic_driver_name = mock_result2 p.multiqueue_setup() @@ -623,7 +623,7 @@ class PktgenTestCase(unittest.TestCase): p._is_irqbalance_disabled = mock_result1 mock_result2 = mock.Mock() - mock_result2.return_value = "ixgbevf" + mock_result2.return_value = "ixgbevf" p._get_vnic_driver_name = mock_result2 p.multiqueue_setup() @@ -670,7 +670,7 @@ class PktgenTestCase(unittest.TestCase): p.client = mock_ssh.SSH.from_node() mock_result = mock.Mock() - mock_result.return_value = "virtio_net" + mock_result.return_value = "virtio_net" p._get_vnic_driver_name = mock_result mock_result1 = mock.Mock() diff --git a/tests/unit/network_services/traffic_profile/test_ixia_rfc2544.py b/tests/unit/network_services/traffic_profile/test_ixia_rfc2544.py index 6fffb9ede..616921e33 100644 --- a/tests/unit/network_services/traffic_profile/test_ixia_rfc2544.py +++ b/tests/unit/network_services/traffic_profile/test_ixia_rfc2544.py @@ -179,12 +179,12 @@ class TestIXIARFC2544Profile(unittest.TestCase): "dst_mac_0": "00:00:00:00:00:03", "dst_mac_1": "00:00:00:00:00:04", "dst_mac_2": "00:00:00:00:00:04"} - self.assertRaises(IOError, r_f_c2544_profile._get_ixia_traffic_profile, - self.PROFILE, mac, xfile="tmp", - static_traffic=STATIC_TRAFFIC) + result = r_f_c2544_profile._get_ixia_traffic_profile( + self.PROFILE, mac, xfile="tmp", + static_traffic=STATIC_TRAFFIC) + self.assertIsNotNone(result) - @mock.patch("yardstick.network_services.traffic_profile.ixia_rfc2544.open") - def test_get_ixia_traffic_profile(self, mock_open): + def test_get_ixia_traffic_profile(self): traffic_generator = mock.Mock(autospec=TrexProfile) traffic_generator.my_ports = [0, 1] traffic_generator.uplink_ports = [-1] diff --git a/tests/unit/network_services/traffic_profile/test_prox_profile.py b/tests/unit/network_services/traffic_profile/test_prox_profile.py index c32cc2878..078e72b8e 100644 --- a/tests/unit/network_services/traffic_profile/test_prox_profile.py +++ b/tests/unit/network_services/traffic_profile/test_prox_profile.py @@ -63,8 +63,9 @@ class TestProxProfile(unittest.TestCase): } profile = ProxProfile(tp_config) - profile.init(234) - self.assertEqual(profile.queue, 234) + queue = mock.Mock() + profile.init(queue) + self.assertIs(profile.queue, queue) def test_execute_traffic(self): packet_sizes = [ |