Esempio n. 1
0
    def test_get_stats(self, ssh, *args):
        mock_ssh(ssh)

        vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
        vfw_approx_vnf = FWApproxVnf(name, vnfd)
        vfw_approx_vnf.q_in = mock.MagicMock()
        vfw_approx_vnf.q_out = mock.MagicMock()
        vfw_approx_vnf.q_out.qsize = mock.Mock(return_value=0)
        vfw_approx_vnf.vnf_execute = mock.Mock(return_value=self.STATS)
        self.assertEqual(self.STATS, vfw_approx_vnf.get_stats())
Esempio n. 2
0
 def test_get_stats(self, 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.q_in = mock.MagicMock()
         vfw_approx_vnf.q_out = mock.MagicMock()
         vfw_approx_vnf.q_out.qsize = mock.Mock(return_value=0)
         vfw_approx_vnf.vnf_execute = mock.Mock(return_value=self.STATS)
         self.assertEqual(self.STATS, vfw_approx_vnf.get_stats())