Example #1
0
    def test_run_vcgnapt(self, ssh, *args):
        mock_ssh(ssh)

        vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
        cgnapt_approx_vnf = CgnaptApproxVnf(name, vnfd)
        cgnapt_approx_vnf._build_config = mock.MagicMock()
        cgnapt_approx_vnf.queue_wrapper = mock.MagicMock()
        cgnapt_approx_vnf.ssh_helper = mock.MagicMock()
        cgnapt_approx_vnf.ssh_helper.run = mock.MagicMock()
        cgnapt_approx_vnf.scenario_helper.scenario_cfg = self.scenario_cfg
        cgnapt_approx_vnf._run()
        cgnapt_approx_vnf.ssh_helper.run.assert_called_once()
Example #2
0
    def test_instantiate(self, ssh, *args):
        mock_ssh(ssh)

        vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
        cgnapt_approx_vnf = CgnaptApproxVnf(name, vnfd)
        cgnapt_approx_vnf.deploy_helper = mock.MagicMock()
        cgnapt_approx_vnf.resource_helper = mock.MagicMock()
        cgnapt_approx_vnf._build_config = mock.MagicMock()
        self.scenario_cfg['vnf_options'] = {'acl': {'cfg': "", 'rules': ""}}
        cgnapt_approx_vnf.q_out.put("pipeline>")
        cgnapt_vnf.WAIT_TIME = 3
        self.scenario_cfg.update({"nodes": {"vnf__0": ""}})
        self.assertIsNone(
            cgnapt_approx_vnf.instantiate(self.scenario_cfg, self.context_cfg))
Example #3
0
 def test_run_vcgnapt(self, hex, eval, mock_open, 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_mock.run = \
             mock.Mock(return_value=(0, "", ""))
         ssh.from_node.return_value = ssh_mock
         vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
         cgnapt_approx_vnf = CgnaptApproxVnf(name, vnfd)
         cgnapt_approx_vnf._build_config = mock.MagicMock()
         cgnapt_approx_vnf.queue_wrapper = mock.MagicMock()
         cgnapt_approx_vnf.ssh_helper = mock.MagicMock()
         cgnapt_approx_vnf.ssh_helper.run = mock.MagicMock()
         cgnapt_approx_vnf.scenario_helper.scenario_cfg = self.scenario_cfg
         cgnapt_approx_vnf._run()
         cgnapt_approx_vnf.ssh_helper.run.assert_called_once()
Example #4
0
 def test_instantiate(self, mock_context, 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]
         cgnapt_approx_vnf = CgnaptApproxVnf(name, vnfd)
         cgnapt_approx_vnf.ssh_helper = ssh
         cgnapt_approx_vnf.deploy_helper = mock.MagicMock()
         cgnapt_approx_vnf.resource_helper = mock.MagicMock()
         cgnapt_approx_vnf._build_config = mock.MagicMock()
         self.scenario_cfg['vnf_options'] = {'acl': {'cfg': "",
                                                     'rules': ""}}
         cgnapt_approx_vnf.q_out.put("pipeline>")
         cgnapt_vnf.WAIT_TIME = 3
         self.scenario_cfg.update({"nodes": {"vnf__1": ""}})
         self.assertIsNone(cgnapt_approx_vnf.instantiate(self.scenario_cfg,
                                                         self.context_cfg))