예제 #1
0
    def setUp(self):

        self.tenant = 'cloudify_ims'
        self.creds = {'username': '******', 'password': '******'}
        self.orchestrator = {
            'name': 'cloudify',
            'version': '4.0',
            'object': 'foo',
            'requirements': {
                'flavor': {
                    'name': 'm1.medium',
                    'ram_min': 4096
                },
                'os_image': 'manager_4.0'
            }
        }

        self.vnf = {
            'name': 'clearwater',
            'descriptor': {
                'version': '108',
                'file_name': 'openstack-blueprint.yaml',
                'name': 'clearwater-opnfv',
                'url': 'https://foo',
                'requirements': {
                    'flavor': {
                        'name': 'm1.medium',
                        'ram_min': 2048
                    }
                }
            }
        }

        with mock.patch('functest.opnfv_tests.vnf.ims.cloudify_ims.'
                        'os.makedirs'), \
            mock.patch('functest.opnfv_tests.vnf.ims.cloudify_ims.'
                       'get_config', return_value={
                           'tenant_images': 'foo',
                           'orchestrator': self.orchestrator,
                           'vnf': self.vnf,
                           'vnf_test_suite': '',
                           'version': 'whatever'}):

            self.ims_vnf = cloudify_ims.CloudifyIms()

        self.images = {'image1': 'url1', 'image2': 'url2'}
        self.details = {
            'orchestrator': {
                'status': 'PASS',
                'duration': 120
            },
            'vnf': {},
            'test_vnf': {}
        }
예제 #2
0
    def setUp(self):
        with mock.patch('functest.opnfv_tests.vnf.ims.cloudify_ims.'
                        'os.makedirs'), \
            mock.patch('functest.opnfv_tests.vnf.ims.cloudify_ims.'
                       'get_config', return_value='config_value'):
            self.ims_vnf = cloudify_ims.CloudifyIms()
        self.neutron_client = mock.Mock()
        self.glance_client = mock.Mock()
        self.keystone_client = mock.Mock()
        self.nova_client = mock.Mock()
        self.orchestrator = {
            'requirements': {
                'ram_min': 2,
                'os_image': 'test_os_image'
            },
            'blueprint': {
                'url': 'test_url',
                'branch': 'test_branch'
            },
            'inputs': {
                'public_domain': 'test_domain'
            },
            'object': 'test_object',
            'deployment_name': 'test_deployment_name'
        }
        self.ims_vnf.orchestrator = self.orchestrator
        self.ims_vnf.images = {'test_image': 'test_url'}
        self.ims_vnf.vnf = self.orchestrator
        self.ims_vnf.tenant_name = 'test_tenant'
        self.ims_vnf.inputs = {'public_domain': 'test_domain'}
        self.ims_vnf.glance_client = self.glance_client
        self.ims_vnf.neutron_client = self.neutron_client
        self.ims_vnf.keystone_client = self.keystone_client
        self.ims_vnf.nova_client = self.nova_client
        self.ims_vnf.admin_creds = 'test_creds'

        self.mock_post = mock.Mock()
        attrs = {'status_code': 201, 'cookies': ""}
        self.mock_post.configure_mock(**attrs)

        self.mock_post_200 = mock.Mock()
        attrs = {'status_code': 200, 'cookies': ""}
        self.mock_post_200.configure_mock(**attrs)