Пример #1
0
    def test_run_cleanup_vnf_packages(self, mock_get_by_filter, mock_exists,
                                      mock_rmtree, mock_remove):
        vnf_package_data = {
            'algorithm': None,
            'hash': None,
            'location_glance_store': None,
            'onboarding_state': 'CREATED',
            'operational_state': 'DISABLED',
            'tenant_id': uuidsentinel.tenant_id,
            'usage_state': 'NOT_IN_USE',
            'user_data': {
                'abc': 'xyz'
            }
        }

        vnfpkgm = objects.VnfPackage(context=self.context, **vnf_package_data)
        vnfpkgm.create()
        vnfpkgm.destroy(self.context)

        mock_get_by_filter.return_value = [vnfpkgm]
        mock_exists.return_value = True
        conductor_server.Conductor('host')._run_cleanup_vnf_packages(
            self.context)
        mock_get_by_filter.assert_called()
        mock_rmtree.assert_called()
        mock_remove.assert_called()
Пример #2
0
 def setUp(self):
     super(TestConductor, self).setUp()
     self.addCleanup(mock.patch.stopall)
     self.context = context.get_admin_context()
     self._mock_vnflcm_driver()
     self._mock_vnfm_plugin()
     self.conductor = conductor_server.Conductor('host')
     self.vnf_package = self._create_vnf_package()
 def setUp(self):
     super(TestConductor, self).setUp()
     self.context = context.get_admin_context()
     self.conductor = conductor_server.Conductor('host')
     self.vnf_package = self._create_vnf_package()