summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorlaili <lai.li@zte.com.cn>2018-08-13 08:59:05 +0800
committerlaili <lai.li@zte.com.cn>2018-08-13 08:59:05 +0800
commita7945e3d6abceb629814bd6e8fda56bfac9c1893 (patch)
tree5dd9dc5234887e9b5e7954682abee6f8899ee251 /lcm
parent935631c6062a5a2ee168fb4968f17986864a9a03 (diff)
Modify vnf instantiation related stuffs.
Add test_instantiate_vnf_when_already_instantiated method. Change-Id: I8c2a33e0a3fab2756174a82df9a6b25eed8325e2 Issue-ID: VFC-1017 Signed-off-by: laili <lai.li@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/nf/tests/test_instantiate_vnf.py23
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',