Beispiel #1
0
 def setUp(self):
     self.client = APIClient()
     self.ns_inst_id = 'test_ns_terminate_001'
     self.url = '/api/nslcm/v1/ns/%s/terminate' % self.ns_inst_id
     self.job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.TERMINATE,
                                      self.ns_inst_id)
     NSInstModel(id=self.ns_inst_id).save()
     NSInstModel(id='test_ns_terminate_002').save()
     FPInstModel(nsinstid=self.ns_inst_id,
                 sfcid='test_sfc_inst_001',
                 fpname='xxx',
                 status='zzz').save()
     NfInstModel(ns_inst_id=self.ns_inst_id).save()
     VLInstModel(ownertype=OWNER_TYPE.NS, ownerid=self.ns_inst_id).save()
     PNFInstModel(nsInstances=self.ns_inst_id).save()
Beispiel #2
0
 def setUp(self):
     self.ns_inst_id = '1'
     self.nf_inst_id = '1'
     self.nf_uuid = '1-1-1'
     self.job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.HEAL,
                                      self.ns_inst_id)
     self.client = APIClient()
     NSInstModel.objects.filter().delete()
     NfInstModel.objects.filter().delete()
     NSInstModel(id=self.ns_inst_id, name='ns_name', status='null').save()
     NfInstModel.objects.create(nfinstid=self.nf_inst_id,
                                nf_name='name_1',
                                vnf_id='1',
                                vnfm_inst_id='1',
                                ns_inst_id=self.ns_inst_id,
                                max_cpu='14',
                                max_ram='12296',
                                max_hd='101',
                                max_shd='20',
                                max_net=10,
                                status='null',
                                mnfinstid=self.nf_uuid,
                                package_id='pkg1',
                                vnfd_model=VNFD_MODEL_DICT)
     VNFCInstModel(nfinstid=self.nf_inst_id,
                   vmid='vmid_01',
                   vduid='vduid_01').save()
     VmInstModel(vmid='vmid_01', vmname='vmname_01').save()
Beispiel #3
0
 def test_get_scale_vnf_data_info_list(self, mock_abspath):
     NSInstModel(id='ns_instanceId_02', nsd_id='02').save()
     NfInstModel(package_id='nf_hw_cscf',
                 status=VNF_STATUS.ACTIVE,
                 nfinstid='nfinst_01').save()
     mock_abspath.return_value = 'lcm/1/2/3.py'
     scale_ns_data = {
         'scaleNsByStepsData': {
             'aspectId': 'TIC_EDGE_HW',
             'numberOfSteps': 4,
             'scalingDirection': 'r'
         }
     }
     ns_instance_id = 'ns_instanceId_02'
     scale_vnf_data_info_list = get_scale_vnf_data_info_list(
         scale_ns_data, ns_instance_id)
     success_list = [{
         'vnfInstanceId': 'nfinst_01',
         'scaleByStepData': {
             'type': 'r',
             'aspectId': 'gsu',
             'numberOfSteps': '1'
         }
     }]
     self.assertEqual(scale_vnf_data_info_list, success_list)
 def setUp(self):
     self.url = "/api/nslcm/v1/ns_instances/%s/heal"
     self.ns_inst_id = str(uuid.uuid4())
     self.nf_inst_id = '1'
     self.nf_uuid = '1-1-1'
     self.job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.HEAL, self.ns_inst_id)
     self.client = Client()
     model = json.dumps(VNFD_MODEL_DICT)
     NSInstModel.objects.filter().delete()
     NfInstModel.objects.filter().delete()
     NSInstModel(id=self.ns_inst_id, name="ns_name", status='null').save()
     NfInstModel.objects.create(
         nfinstid=self.nf_inst_id,
         nf_name='name_1',
         vnf_id='1',
         vnfm_inst_id='1',
         ns_inst_id=self.ns_inst_id,
         max_cpu='14',
         max_ram='12296',
         max_hd='101',
         max_shd="20",
         max_net=10,
         status='null',
         mnfinstid=self.nf_uuid,
         package_id='pkg1',
         vnfd_model=model)
Beispiel #5
0
 def setUp(self):
     self.client = Client()
     self.url = "/api/nslcm/v1/ns_instances/%s/terminate"
     self.ns_inst_id = str(uuid.uuid4())
     self.nf_inst_id = '1'
     self.vnffg_id = str(uuid.uuid4())
     self.vim_id = str(uuid.uuid4())
     self.job_id = str(uuid.uuid4())
     self.nf_uuid = '1-1-1'
     self.tenant = "tenantname"
     NSInstModel(id=self.ns_inst_id, name="ns_name", status='null').save()
     NfInstModel.objects.create(nfinstid=self.nf_inst_id,
                                nf_name='name_1',
                                vnf_id='1',
                                vnfm_inst_id='1',
                                ns_inst_id='1-1-1,2-2-2',
                                max_cpu='14',
                                max_ram='12296',
                                max_hd='101',
                                max_shd="20",
                                max_net=10,
                                status='null',
                                mnfinstid=self.nf_uuid,
                                package_id='pkg1',
                                vnfd_model=json.dumps(VNFD_MODEL_DICT))
    def test_ns_instantiate_with_pnf_when_wso2(self, mock_updata_job,
                                               mock_call_req, mock_post_deal):
        config.WORKFLOW_OPTION = "wso2"
        NSInstModel(id="1",
                    name="test_ns",
                    nspackage_id="1",
                    status="created",
                    nsd_id="nsd_id").save()
        stpls = [{
            "id": "nsd_id",
            "csarId": "csar_id",
            "templateName": "template_name",
            "serviceTemplateId": "service_template_id"
        }]
        items = [{"name": ["init"], "processId": "process_id"}]
        ret = {"status": 1}
        mock_vals = {
            "/api/catalog/v1/servicetemplates":
            [0, json.JSONEncoder().encode(stpls), "200"],
            "/api/catalog/v1/servicetemplates/service_template_id/operations":
            [0, json.JSONEncoder().encode(items), "200"],
            "/api/wso2bpel/v1/process/instance":
            [0, json.JSONEncoder().encode(ret), "200"],
            "/api/catalog/v1/ns_descriptors/1": [0, None, "202"],
        }

        def side_effect(*args):
            return mock_vals[args[4]]

        mock_call_req.side_effect = side_effect
        ack = InstantNSService(1, INSTANTIATE_NS_WITH_PNF_DICT).do_biz()
        self.assertEqual(ack['status'], status.HTTP_200_OK)
 def setUp(self):
     self.client = APIClient()
     NSInstModel.objects.filter().delete()
     self.url = "/api/nslcm/v1/ns/%s/instantiate" % "2"
     NSInstModel(id="2", nspackage_id="7", nsd_id="2",
                 status="active").save()
     self._mock_get_auto_id()
Beispiel #8
0
    def test_ns_terminate_asynchronous_tasks_when_no_new_progress(
            self, mock_request, mock_sleep):
        ns_instance_id = 'test_ns_terminate_when_no_new_progress'
        NSInstModel(id=ns_instance_id).save()
        NfInstModel(ns_inst_id=ns_instance_id).save()
        mock_request.side_effect = [
            ({
                'status': '200'
            }, '{"jobId": "zzz"}'.encode('utf-8')),
            ({
                'status': '200'
            }, '{}'.encode('utf-8')),
            ({
                'status': '200'
            }, '{"responseDescriptor": {"progress": 100, "responseId": 1, '
             '"statusDescription": ""}}'.encode('utf-8'))
        ]
        mock_sleep.return_value = None

        job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.TERMINATE,
                                    ns_instance_id)
        TerminateNsService(ns_instance_id, job_id, TERMINATE_NS_DICT).run()
        self.assertEqual(
            JobModel.objects.filter(jobid=job_id).first().progress,
            JOB_PROGRESS.FINISHED)
 def test_ns_instantiate_with_pnf(self, mock_updata_job, mock_call_req,
                                  mock_post_deal):
     config.WORKFLOW_OPTION = "grapflow"
     nsInstanceId = str(uuid.uuid4())
     NSInstModel(id=nsInstanceId,
                 name="test_ns",
                 nspackage_id="1",
                 status="created").save()
     ret = [
         0,
         json.JSONEncoder().encode({
             'jobId': "1",
             "responseDescriptor": {
                 "progress": 100
             }
         }), '200'
     ]
     mock_call_req.side_effect = [ret for i in range(1, 20)]
     response = self.client.post(self.url % nsInstanceId,
                                 data=SOL_INSTANTIATE_NS_WITH_PNF_DICT,
                                 format='json')
     self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
     self.assertIsNotNone(response['Location'])
     response = self.client.get(response['Location'], format='json')
     self.assertEqual(response.status_code, status.HTTP_200_OK)
 def setUp(self):
     self.client = Client()
     self.ns_inst_id = '1'
     self.nf_inst_id = '1'
     self.vnffg_id = str(uuid.uuid4())
     self.vim_id = str(uuid.uuid4())
     self.job_id = str(uuid.uuid4())
     self.nf_uuid = '1-1-1'
     self.tenant = "tenantname"
     model = '{"metadata": {"vnfdId": "1","vnfdName": "PGW001","vnfProvider": "zte","vnfdVersion": "V00001",' \
             '"vnfVersion": "V5.10.20","productType": "CN","vnfType": "PGW",' \
             '"description": "PGW VNFD description","isShared":true,"vnfExtendType":"driver"}}'
     NSInstModel(id=self.ns_inst_id, name="ns_name", status='null').save()
     NfInstModel.objects.create(nfinstid=self.nf_inst_id,
                                nf_name='name_1',
                                vnf_id='1',
                                vnfm_inst_id='1',
                                ns_inst_id='1-1-1,2-2-2',
                                max_cpu='14',
                                max_ram='12296',
                                max_hd='101',
                                max_shd="20",
                                max_net=10,
                                status='null',
                                mnfinstid=self.nf_uuid,
                                package_id='pkg1',
                                vnfd_model=model)
Beispiel #11
0
    def test_ns_instantiate_with_pnf_when_activiti(self, mock_updata_job,
                                                   mock_call_req,
                                                   mock_post_deal):
        config.WORKFLOW_OPTION = "activiti"
        NSInstModel(id="1",
                    name="test_ns",
                    nspackage_id="1",
                    status="created",
                    nsd_id="nsd_id").save()
        WFPlanModel(deployed_id="1",
                    process_id="process_id",
                    message="message",
                    status=1,
                    plan_name="plan_name").save()
        ret = {"status": 1}
        mock_vals = {
            "api/workflow/v1/process/instance":
            [0, json.JSONEncoder().encode(ret), "200"],
            "/api/catalog/v1/ns_descriptors/1": [0, None, "202"],
        }

        def side_effect(*args):
            return mock_vals[args[4]]

        mock_call_req.side_effect = side_effect
        ack = InstantNSService(1, INSTANTIATE_NS_WITH_PNF_DICT).do_biz()
        self.assertEqual(ack['status'], status.HTTP_200_OK)
Beispiel #12
0
 def test_ns_instantiate_with_different_vimid_2(self, mock_call_req):
     config.WORKFLOW_OPTION = "grapflow"
     NSInstModel(id="1", name="test_ns", nspackage_id="1",
                 status="created").save()
     ret = [0, json.JSONEncoder().encode(JOB_DICT), '200']
     mock_call_req.side_effect = [ret for i in range(1, 20)]
     ack = InstantNSService(1, INSTANTIATE_NS_WITH_PNF_DICT).do_biz()
     self.assertEqual(ack['status'], status.HTTP_200_OK)
 def insert_new_ns(self):
     ns_inst_id = str(uuid.uuid4())
     job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.MANUAL_SCALE,
                                 self.ns_inst_id)
     package_id = "23"
     NSInstModel(id=ns_inst_id,
                 name="abc",
                 nspackage_id=package_id,
                 nsd_id=package_id).save()
     return ns_inst_id, job_id
 def setUp(self):
     self.apiClient = APIClient()
     self.format = "json"
     self.url = "/api/nslcm/v1/ns_instances/test_update_ns/update"
     self.data = {"updateType": "ADD_VNF"}
     NSInstModel(id="test_update_ns",
                 name="test_ns_instance_name",
                 nsd_id="test_nsd_id",
                 nsd_invariant_id="test_nsd_invariant_id",
                 nsd_model=json.dumps(NSD_MODEL_DICT)).save()
Beispiel #15
0
 def test_delete_ns(self, mock_call_req):
     NSInstModel(id="1", nspackage_id="7", nsd_id="2").save()
     r1_query_ns_to_aai = [
         0, json.JSONEncoder().encode(NS_INFO_AAI_DICT), '200'
     ]
     r2_delete_ns_to_aai = [0, json.JSONEncoder().encode({}), '200']
     mock_call_req.side_effect = [r1_query_ns_to_aai, r2_delete_ns_to_aai]
     url = self.ns_instances_url + '/1'
     response = self.apiClient.delete(url)
     self.assertEqual(status.HTTP_204_NO_CONTENT, response.status_code)
 def setUp(self):
     self.url = "/api/nslcm/v1/ns_instances/%s/scale"
     self.ns_inst_id = str(uuid.uuid4())
     self.job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.MANUAL_SCALE,
                                      self.ns_inst_id)
     self.package_id = "7"
     self.client = APIClient()
     NSInstModel(id=self.ns_inst_id,
                 name="abc",
                 nspackage_id=self.package_id,
                 nsd_id="111").save()
Beispiel #17
0
 def test_create_ns_when_ns_name_exist(self, mock_call_req):
     NSInstModel.objects.all().delete()
     NSInstModel(id="1", name="ns").save()
     nspackage_info = json.JSONEncoder().encode(NS_PACKAGE_INFO_DICT)
     mock_call_req.return_value = [0, nspackage_info, '200']
     response = self.apiClient.post(self.ns_instances_url,
                                    data=SOL_CREATE_NS_DICT,
                                    format=self.format,
                                    **SOL_REST_HEADER_DICT)
     self.assertEqual(response.status_code,
                      status.HTTP_500_INTERNAL_SERVER_ERROR)
Beispiel #18
0
 def setUp(self):
     self.client = Client()
     self.ns_inst_id = str(uuid.uuid1())
     NSInstModel.objects.filter().delete()
     NSInstModel(id=self.ns_inst_id,
                 nspackage_id="7",
                 nsd_id="2",
                 name='name',
                 nsd_invariant_id='123',
                 description='description',
                 sdncontroller_id='456',
                 flavour_id='789').save()
Beispiel #19
0
 def create_ns_inst(self):
     self.ns_inst_id = str(uuid.uuid4())
     logger.debug("CreateNSService::create_ns_inst::ns_inst_id=%s" % self.ns_inst_id)
     NSInstModel(id=self.ns_inst_id,
                 name=self.ns_name,
                 nspackage_id=self.ns_package_id,
                 nsd_id=self.nsd_id,
                 nsd_invariant_id=self.nsd_invariant_id,
                 description=self.description,
                 status='NOT_INSTANTIATED',  # 'empty',
                 lastuptime=now_time(),
                 global_customer_id=self.global_customer_id,
                 service_type=self.service_type).save()
 def setUp(self):
     self.client = APIClient()
     NSInstModel.objects.filter().delete()
     self.url = "/api/nslcm/v1/ns_instances/%s/instantiate"
     self.req_data = SOL_INSTANTIATE_NS_DICT
     self.nsd_model = nsd_model
     self.vnfms = json.dumps(VNFM_LIST_IN_AAI_DICT)
     self.vnfm = json.dumps(VNFM_IN_AAI_DICT)
     self.nsInstanceId = str(uuid.uuid4())
     NSInstModel(id=self.nsInstanceId,
                 nspackage_id="7",
                 nsd_id="2",
                 status="active").save()
Beispiel #21
0
 def test_create_ns_when_ns_name_exist(self, mock_call_req):
     nspackage_info = json.JSONEncoder().encode({
         "csarId": str(uuid.uuid4()),
         "packageInfo": {}
     })
     mock_call_req.return_value = [0, nspackage_info, '200']
     NSInstModel(id="1", name="ns").save()
     self.create_ns_dict["csarId"] = "1"
     response = self.client.post("/api/nslcm/v1/ns",
                                 data=self.create_ns_dict,
                                 format='json')
     self.assertEqual(response.status_code,
                      status.HTTP_500_INTERNAL_SERVER_ERROR)
     self.assertIn("error", response.data)
Beispiel #22
0
    def setUp(self):
        self.nsd_id = str(uuid.uuid4())
        self.ns_package_id = str(uuid.uuid4())
        self.ns_inst_id = str(uuid.uuid4())
        self.job_id = JobUtil.create_job("NS", JOB_TYPE.MANUAL_SCALE_VNF,
                                         self.ns_inst_id)
        NSDModel(id=self.ns_package_id, nsd_id=self.nsd_id, name='name').save()

        self.client = Client()
        self.context = '{"vnfs": ["a", "b"], "sfcs": ["c"], "vls": ["d", "e", "f"]}'
        NSInstModel(id=self.ns_inst_id,
                    name="abc",
                    nspackage_id="7",
                    nsd_id="111").save()
Beispiel #23
0
    def test_ns_terminate_asynchronous_tasks_when_terminate_vnf_failed(
            self, mock_request, mock_sleep):
        ns_instance_id = 'test_ns_terminate_when_terminate_vnf_failed'
        NSInstModel(id=ns_instance_id).save()
        NfInstModel(ns_inst_id=ns_instance_id).save()
        mock_request.side_effect = [({
            'status': '404'
        }, '{"jobId": "zzz"}'.encode('utf-8'))]
        mock_sleep.return_value = None

        job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.TERMINATE,
                                    ns_instance_id)
        TerminateNsService(ns_instance_id, job_id, TERMINATE_NS_DICT).run()
        self.assertEqual(
            JobModel.objects.filter(jobid=job_id).first().progress,
            JOB_PROGRESS.FINISHED)
 def setUp(self):
     self.client = APIClient()
     self.url = "/api/nslcm/v1/ns/test_ns_instance_id/postdeal"
     self.data = {"status": "true"}
     NSInstModel(id="test_ns_instance_id",
                 name="test_ns_instance_name",
                 nsd_id="test_nsd_id",
                 nsd_invariant_id="test_nsd_invariant_id",
                 nsd_model=json.dumps(
                     NSD_MODEL_DICT_INST_NS_POST_DEAL_VIEW)).save()
     ServiceBaseInfoModel(service_id="test_ns_instance_id",
                          service_name="service_name",
                          service_type="service_type",
                          active_status="active_status",
                          status="status",
                          creator="creator",
                          create_time="0").save()
 def setUp(self):
     self.scaling_map_json = SCALING_MAP_DICT
     self.ns_inst_id = str(uuid.uuid4())
     self.job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.MANUAL_SCALE,
                                      self.ns_inst_id)
     self.client = APIClient()
     self.package_id = '7'
     NSInstModel(id=self.ns_inst_id,
                 name='abc',
                 nspackage_id=self.package_id,
                 nsd_id='test_ns_manual_scale').save()
     NfInstModel(package_id='nf_001',
                 status=VNF_STATUS.ACTIVE,
                 nfinstid='nf_001').save()
     NfInstModel(package_id='nf_002',
                 status=VNF_STATUS.ACTIVE,
                 nfinstid='nf_002').save()
Beispiel #26
0
 def test_heal_ns_thread_when_nsinsts_does_not_exist(self):
     NSInstModel(id='text_nsinsts_does_not_exist',
                 name='ns_name',
                 status='null').save()
     heal_ns_json = HEAL_NS_DICT.copy()
     heal_ns_json['healNsData'][
         'vnfInstanceId'] = 'text_nsinsts_does_not_exist'
     job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.HEAL,
                                 'text_nsinsts_does_not_exist')
     ns_heal_service = NSHealService('text_nsinsts_does_not_exist',
                                     heal_ns_json, job_id)
     ns_heal_service.run()
     self.assertEqual(
         JobModel.objects.filter(jobid=job_id).first().progress,
         JOB_PROGRESS.ERROR)
     self.assertEqual(
         NSLcmOpOccModel.objects.filter(
             id=ns_heal_service.occ_id).first().operation_state, 'FAILED')
Beispiel #27
0
 def setUp(self):
     self.ns_inst_id = str(uuid.uuid4())
     self.job_id = str(uuid.uuid4())
     self.data = {
         'nsInstanceId':
         self.ns_inst_id,
         'additionalParamForNs': {
             "inputs": json.dumps({})
         },
         'additionalParamForVnf': [{
             'vnfprofileid': 'VBras',
             'additionalparam': {
                 'inputs': json.dumps({
                     'vnf_param1': '11',
                     'vnf_param2': '22'
                 }),
                 'vnfminstanceid': "1"
             }
         }],
         'vnfIndex':
         '1'
     }
     self.client = Client()
     NfPackageModel(uuid=str(uuid.uuid4()),
                    nfpackageid='package_id1',
                    vnfdid='zte_vbras',
                    vendor='zte',
                    vnfdversion='1.0.0',
                    vnfversion='1.0.0',
                    vnfdmodel=json.dumps(vnfd_model_dict)).save()
     NSInstModel(id=self.ns_inst_id,
                 name='ns',
                 nspackage_id='1',
                 nsd_id='nsd_id',
                 description='description',
                 status='instantiating',
                 nsd_model=json.dumps(nsd_model_dict),
                 create_time=now_time(),
                 lastuptime=now_time()).save()
Beispiel #28
0
 def setUp(self):
     self.client = Client()
     self.ns_inst_id = str(uuid.uuid4())
     self.vnffg_id = str(uuid.uuid4())
     self.vl_id_1 = 1
     self.vl_id_2 = 2
     self.vim_id = '{"cloud_owner": "cloud_owner", "cloud_regionid": "cloud_regionid"}'
     self.tenant = "tenantname"
     properties = {"vl_profile": {"networkName": "vl_inst_name", "network_type": "vlan",
                                  "segmentationId": "segmentation_id", "physicalNetwork": "physical_network",
                                  "mtu": 1500, "vlanTransparent": True, "dhcp_enabled": False,
                                  "cidr": "190.168.100.0/24", "ip_version": const.IPV4, "dhcpEnabled": True,
                                  "gatewayIp": "190.168.100.1", "dns_nameservers": "dns_nameservers",
                                  "host_routes": "host_routes", "start_ip": "190.168.100.2",
                                  "end_ip": "190.168.100.100"},
                   "location_info": {"host": True, "vimid": self.vim_id, "region": True, "tenant": self.tenant}}
     properties2 = {"vl_profile": {"networkName": "vl_inst_name", "network_type": "vlan",
                                   "segmentationId": "segmentation_id", "physicalNetwork": "physical_network",
                                   "mtu": 1500, "vlanTransparent": True, "dhcp_enabled": False,
                                   "cidr": "190.168.100.0/24", "ip_version": const.IPV4, "dhcpEnabled": True,
                                   "gatewayIp": "190.168.100.1", "dns_nameservers": "dns_nameservers",
                                   "host_routes": "host_routes", "start_ip": "190.168.100.2",
                                   "end_ip": "190.168.100.100"},
                    "location_info": {"host": True, "vimid": "", "region": True, "tenant": self.tenant}}
     self.context = {
         "vls": [{"vl_id": self.vl_id_1, "description": "", "properties": properties, "route_external": False},
                 {"vl_id": self.vl_id_2, "description": "", "properties": properties2, "route_external": False}],
         "vnffgs": [{"vnffg_id": self.vnffg_id, "description": "",
                     "properties": {"vendor": "zte", "version": "1.1.2", "number_of_endpoints": 7,
                                    "dependent_virtual_link": [self.vl_id_2, self.vl_id_1],
                                    "connection_point": ["CP01", "CP02"],
                                    "constituent_vnfs": ["VNF1", "VNF2", "VNF3"],
                                    "constituent_pnfs": ["pnf1", "pnf2"]},
                     "members": ["forwarding_path1", "forwarding_path2"]}]}
     NSInstModel(id=self.ns_inst_id, name="ns_name").save()
     VNFFGInstModel(vnffgdid=self.vnffg_id, vnffginstid="", nsinstid=self.ns_inst_id, endpointnumber=0, vllist="",
                    cplist="", vnflist="", fplist="", status="").save()
Beispiel #29
0
 def setUp(self):
     self.client = APIClient()
     self.ns_inst_id = 'test_ns_update_001'
     self.url = '/api/nslcm/v1/ns/%s/update' % self.ns_inst_id
     self.job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.HEAL, self.ns_inst_id)
     NSInstModel(id=self.ns_inst_id).save()
Beispiel #30
0
 def setUp(self):
     self.client = Client()
     NSInstModel.objects.filter().delete()
     self.context = '{"vnfs": ["a", "b"], "sfcs": ["c"], "vls": ["d", "e", "f"]}'
     NSInstModel(id="123", nspackage_id="7", nsd_id="2").save()