def test_terminate(self, ssh, *args): mock_ssh(ssh) udp_replay_approx_vnf = UdpReplayApproxVnf(NAME, self.VNFD_0) udp_replay_approx_vnf._vnf_process = mock.MagicMock() udp_replay_approx_vnf._vnf_process.terminate = mock.Mock() udp_replay_approx_vnf.used_drivers = { "01:01.0": "i40e", "01:01.1": "i40e" } udp_replay_approx_vnf.dpdk_nic_bind = "dpdk_nic_bind.py" self.assertEqual(None, udp_replay_approx_vnf.terminate())
def test_terminate(self, mock_time, mock_process): with mock.patch("yardstick.ssh.SSH") as ssh: ssh_mock = mock.Mock(autospec=ssh.SSH) ssh_mock.execute = \ mock.Mock(return_value=(0, "", "")) ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] udp_approx_vnf = UdpReplayApproxVnf(NAME, vnfd) udp_approx_vnf._vnf_process = mock.MagicMock() udp_approx_vnf._vnf_process.terminate = mock.Mock() udp_approx_vnf.used_drivers = {"01:01.0": "i40e", "01:01.1": "i40e"} udp_approx_vnf.execute_command = mock.Mock() udp_approx_vnf.ssh_helper = ssh_mock udp_approx_vnf.dpdk_nic_bind = "dpdk_nic_bind.py" self.assertEqual(None, udp_approx_vnf.terminate())