diff options
Diffstat (limited to 'tests/unit/network_services')
5 files changed, 46 insertions, 46 deletions
diff --git a/tests/unit/network_services/nfvi/test_resource.py b/tests/unit/network_services/nfvi/test_resource.py index 26d18838b..e2640ac74 100644 --- a/tests/unit/network_services/nfvi/test_resource.py +++ b/tests/unit/network_services/nfvi/test_resource.py @@ -90,7 +90,7 @@ class TestResourceProfile(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, {}, "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock self.resource_profile = \ ResourceProfile(self.VNFD['vnfd:vnfd-catalog']['vnfd'][0], @@ -120,7 +120,7 @@ class TestResourceProfile(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock resource_profile = \ ResourceProfile(self.VNFD['vnfd:vnfd-catalog']['vnfd'][0], [1, 2, 3]) @@ -132,7 +132,7 @@ class TestResourceProfile(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock resource_profile = \ ResourceProfile(self.VNFD['vnfd:vnfd-catalog']['vnfd'][0], [1, 2, 3]) diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py index 4f0855543..88df7788b 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_ping.py @@ -141,7 +141,7 @@ class TestPingTrafficGen(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] ping_traffic_gen = PingTrafficGen(vnfd) self.assertEqual(ping_traffic_gen._queue, None) @@ -152,7 +152,7 @@ class TestPingTrafficGen(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock ping_traffic_gen = PingTrafficGen(vnfd) ping_traffic_gen._queue = Queue() ping_traffic_gen._queue.put({}) @@ -165,7 +165,7 @@ class TestPingTrafficGen(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] ping_traffic_gen = PingTrafficGen(vnfd) self.assertEqual(None, ping_traffic_gen.instantiate({}, {})) @@ -176,7 +176,7 @@ class TestPingTrafficGen(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] ping_traffic_gen = PingTrafficGen(vnfd) self.assertEqual(None, ping_traffic_gen.listen_traffic({})) @@ -191,7 +191,7 @@ class TestPingTrafficGen(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] self.sut = PingTrafficGen(vnfd) self.sut.connection = mock.Mock() @@ -210,7 +210,7 @@ class TestPingTrafficGen(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] self.sut = PingTrafficGen(vnfd) self.sut.connection = mock.Mock() @@ -228,7 +228,7 @@ class TestPingTrafficGen(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] flavor = "" ping_traffic_gen = PingTrafficGen(vnfd) @@ -241,7 +241,7 @@ class TestPingTrafficGen(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] ping_traffic_gen = PingTrafficGen(vnfd) self.assertEqual(None, ping_traffic_gen.terminate()) diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py index eda5cea84..4ea180851 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py @@ -195,7 +195,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGenRFC(vnfd) self.assertIsNotNone(trex_traffic_gen._terminated) @@ -206,7 +206,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGenRFC(vnfd) restult = trex_traffic_gen.collect_kpi() @@ -218,7 +218,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGenRFC(vnfd) self.assertEqual(None, trex_traffic_gen.listen_traffic({})) @@ -233,7 +233,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGenRFC(vnfd) trex_traffic_gen._start_server = mock.Mock(return_value=0) @@ -251,7 +251,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): mock.Mock(return_value=(1, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGenRFC(vnfd) scenario_cfg = {"tc": "tc_baremetal_rfc2544_ipv4_1flow_64B"} @@ -265,7 +265,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGenRFC(vnfd) self.assertEqual([0.8, 1.0], @@ -282,7 +282,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGenRFC(vnfd) self.assertEqual(None, trex_traffic_gen._start_server()) @@ -304,7 +304,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] self.sut = TrexTrafficGenRFC(vnfd) self.sut.connection = mock.Mock() @@ -327,7 +327,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGenRFC(vnfd) result = ['0x00', '0x00', '0x00', '0x00', '0x00', '0x01'] @@ -342,7 +342,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGenRFC(vnfd) tg_rfc2544_trex.WAIT_TIME = 1 @@ -358,7 +358,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] self.sut = TrexTrafficGenRFC(vnfd) self.sut.connection = mock.Mock() @@ -376,7 +376,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] flavor = "" trex_traffic_gen = TrexTrafficGenRFC(vnfd) @@ -389,7 +389,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock trex_traffic_gen = TrexTrafficGenRFC(vnfd) self.assertEqual(None, trex_traffic_gen.terminate()) @@ -399,7 +399,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock trex_traffic_gen = TrexTrafficGenRFC(vnfd) client = mock.Mock(autospec=STLClient) client.connect = mock.Mock(return_value=0) diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py index a76fbbd2a..ca8421919 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_trex.py @@ -176,7 +176,7 @@ class TestTrexTrafficGen(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGen(vnfd) self.assertIsNotNone(trex_traffic_gen._terminated) @@ -187,7 +187,7 @@ class TestTrexTrafficGen(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGen(vnfd) trex_traffic_gen._queue.put({}) @@ -200,7 +200,7 @@ class TestTrexTrafficGen(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGen(vnfd) self.assertEqual(None, trex_traffic_gen.listen_traffic({})) @@ -215,7 +215,7 @@ class TestTrexTrafficGen(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGen(vnfd) self.assertEqual(0, trex_traffic_gen.instantiate({}, {})) @@ -230,7 +230,7 @@ class TestTrexTrafficGen(unittest.TestCase): mock.Mock(return_value=(1, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGen(vnfd) self.assertRaises(RuntimeError, @@ -243,7 +243,7 @@ class TestTrexTrafficGen(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGen(vnfd) self.assertEqual(None, trex_traffic_gen._start_server()) @@ -259,7 +259,7 @@ class TestTrexTrafficGen(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] self.sut = TrexTrafficGen(vnfd) self.sut.connection = mock.Mock() @@ -279,7 +279,7 @@ class TestTrexTrafficGen(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGen(vnfd) self.assertEqual(None, trex_traffic_gen._generate_trex_cfg(vnfd)) @@ -291,7 +291,7 @@ class TestTrexTrafficGen(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGen(vnfd) result = ['0x00', '0x00', '0x00', '0x00', '0x00', '0x01'] @@ -309,7 +309,7 @@ class TestTrexTrafficGen(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] self.sut = TrexTrafficGen(vnfd) self.sut.connection = mock.Mock() @@ -326,7 +326,7 @@ class TestTrexTrafficGen(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(1, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] flavor = "" trex_traffic_gen = TrexTrafficGen(vnfd) @@ -339,7 +339,7 @@ class TestTrexTrafficGen(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(1, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock trex_traffic_gen = TrexTrafficGen(vnfd) self.assertEqual( None, trex_traffic_gen.setup_vnf_environment(ssh_mock)) @@ -350,7 +350,7 @@ class TestTrexTrafficGen(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock trex_traffic_gen = TrexTrafficGen(vnfd) self.assertEqual(None, trex_traffic_gen.terminate()) @@ -360,7 +360,7 @@ class TestTrexTrafficGen(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] trex_traffic_gen = TrexTrafficGen(vnfd) client = mock.Mock(autospec=STLClient) diff --git a/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py index 36b8c2a22..b69e537aa 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_vpe_vnf.py @@ -229,7 +229,7 @@ class TestVpeApproxVnf(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] vpe_approx_vnf = VpeApproxVnf(vnfd) vpe_approx_vnf.resource = mock.Mock(autospec=ResourceProfile) @@ -249,7 +249,7 @@ class TestVpeApproxVnf(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] vpe_approx_vnf = VpeApproxVnf(vnfd) cmd = "quit" @@ -261,7 +261,7 @@ class TestVpeApproxVnf(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] vpe_approx_vnf = VpeApproxVnf(vnfd) vpe_approx_vnf.execute_command = \ @@ -277,7 +277,7 @@ class TestVpeApproxVnf(unittest.TestCase): mock.Mock(return_value=(0, "", "")) ssh_mock.run = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] vpe_approx_vnf = VpeApproxVnf(vnfd) curr_path = os.path.dirname(os.path.abspath(__file__)) @@ -294,7 +294,7 @@ class TestVpeApproxVnf(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] vpe_approx_vnf = VpeApproxVnf(vnfd) self.scenario_cfg['vnf_options'] = {'vpe': {'cfg': ""}} @@ -311,7 +311,7 @@ class TestVpeApproxVnf(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(1, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] vpe_approx_vnf = VpeApproxVnf(vnfd) self.scenario_cfg['vnf_options'] = {'vpe': {'cfg': ""}} @@ -332,7 +332,7 @@ class TestVpeApproxVnf(unittest.TestCase): ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) - ssh.return_value = ssh_mock + ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] vpe_approx_vnf = VpeApproxVnf(vnfd) self.assertEqual(None, |