Ejemplo n.º 1
0
    def test_terminate(self, ssh, *args):
        mock_ssh(ssh)

        vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
        vfw_approx_vnf = FWApproxVnf(name, vnfd)
        vfw_approx_vnf._vnf_process = mock.MagicMock()
        vfw_approx_vnf.used_drivers = {"01:01.0": "i40e", "01:01.1": "i40e"}
        vfw_approx_vnf.vnf_execute = mock.Mock()
        vfw_approx_vnf.dpdk_nic_bind = "dpdk_nic_bind.py"
        vfw_approx_vnf._resource_collect_stop = mock.Mock()
        self.assertIsNone(vfw_approx_vnf.terminate())
Ejemplo n.º 2
0
 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]
         vfw_approx_vnf = FWApproxVnf(name, vnfd)
         vfw_approx_vnf._vnf_process = mock.MagicMock()
         vfw_approx_vnf._vnf_process.terminate = mock.Mock()
         vfw_approx_vnf.used_drivers = {"01:01.0": "i40e",
                                        "01:01.1": "i40e"}
         vfw_approx_vnf.vnf_execute = mock.Mock()
         vfw_approx_vnf.ssh_helper = ssh_mock
         vfw_approx_vnf.dpdk_nic_bind = "dpdk_nic_bind.py"
         vfw_approx_vnf._resource_collect_stop = mock.Mock()
         self.assertEqual(None, vfw_approx_vnf.terminate())