diff options
author | 2018-08-13 01:08:27 +0000 | |
---|---|---|
committer | 2018-08-13 01:08:27 +0000 | |
commit | 69fc4c21a138646d0e976b2e03bd693e493a6e28 (patch) | |
tree | f600af821c501896847d89d11cf0c1ff7ad77b47 /lcm | |
parent | b5518485a86ec89544fe0defa6bee4b92d748dbd (diff) | |
parent | a7945e3d6abceb629814bd6e8fda56bfac9c1893 (diff) |
Merge "Modify vnf instantiation related stuffs."
Diffstat (limited to 'lcm')
-rw-r--r-- | lcm/lcm/nf/tests/test_instantiate_vnf.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lcm/lcm/nf/tests/test_instantiate_vnf.py b/lcm/lcm/nf/tests/test_instantiate_vnf.py index e7604990..7ec2240e 100644 --- a/lcm/lcm/nf/tests/test_instantiate_vnf.py +++ b/lcm/lcm/nf/tests/test_instantiate_vnf.py @@ -67,6 +67,29 @@ class TestNFInstantiate(TestCase): InstantiateVnf(data, nf_inst_id=self.nf_inst_id, job_id=self.job_id).run()
self.assert_job_result(self.job_id, 255, "VNF nf_inst_id is not exist.")
+ def test_instantiate_vnf_when_already_instantiated(self):
+ NfInstModel.objects.create(nfinstid='1111',
+ nf_name='vFW_01',
+ package_id='222',
+ version='',
+ vendor='',
+ netype='',
+ vnfd_model='',
+ status='INSTANTIATED',
+ nf_desc='vFW in Nanjing TIC Edge',
+ vnfdid='111',
+ create_time=now_time())
+ self.nf_inst_id = '1111'
+ self.job_id = JobUtil.create_job('NF', 'CREATE', self.nf_inst_id)
+ JobUtil.add_job_status(self.job_id, 0, "INST_VNF_READY")
+ jobs = JobStatusModel.objects.filter(jobid=self.job_id,
+ progress=0,
+ descp="INST_VNF_READY")
+ self.assertEqual(1, len(jobs))
+ data = inst_req_data
+ InstantiateVnf(data, nf_inst_id=self.nf_inst_id, job_id=self.job_id).run()
+ self.assert_job_result(self.job_id, 255, "VNF instantiationState is not NOT_INSTANTIATED.")
+
@mock.patch.object(restcall, 'call_req')
def test_instantiate_vnf_when_get_packageinfo_by_csarid_failed(self, mock_call_req):
NfInstModel.objects.create(nfinstid='1111',
|