def test_create_vnf_with_vnfd_id(self):
     cmd = vnf.CreateVNF(test_cli10.MyApp(sys.stdout), None)
     name = 'my_name'
     my_id = 'my-id'
     vnfd_id = 'vnfd'
     args = [
         name,
         '--vnfd-id', vnfd_id,
     ]
     position_names = ['name', 'vnfd_id', 'attributes']
     position_values = [name, vnfd_id, {}]
     self._test_create_resource(self._RESOURCE, cmd, name, my_id,
                                args, position_names, position_values)
Example #2
0
    def test_create_vnf_all_params(self):
        cmd = vnf.CreateVNF(test_cli10.MyApp(sys.stdout), None)
        name = 'my_name'
        my_id = 'my-id'
        vnfd_id = 'vnfd'
        vim_id = 'vim_id'
        description = 'my-description'
        region_name = 'region'
        key = 'key'
        value = 'value'

        args = [
            name, '--vnfd-id', vnfd_id, '--vim-id', vim_id, '--description',
            description, '--vim-region-name', region_name,
            '--%s' % key, value
        ]
        position_names = [
            'name',
            'vnfd_id',
            'vim_id',
            'description',
            'attributes',
        ]
        position_values = [
            name,
            vnfd_id,
            vim_id,
            description,
            {},
        ]
        extra_body = {
            key: value,
            'placement_attr': {
                'region_name': region_name
            }
        }
        self._test_create_resource(self._RESOURCE,
                                   cmd,
                                   name,
                                   my_id,
                                   args,
                                   position_names,
                                   position_values,
                                   extra_body=extra_body)