summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lcm/lcm/nf/tests/test_heal_vnf.py3
-rw-r--r--lcm/lcm/nf/tests/test_operate_vnf.py18
2 files changed, 20 insertions, 1 deletions
diff --git a/lcm/lcm/nf/tests/test_heal_vnf.py b/lcm/lcm/nf/tests/test_heal_vnf.py
index ee872edf..cae9cd32 100644
--- a/lcm/lcm/nf/tests/test_heal_vnf.py
+++ b/lcm/lcm/nf/tests/test_heal_vnf.py
@@ -64,7 +64,7 @@ class TestNFInstantiate(TestCase):
self.failUnlessEqual(status.HTTP_409_CONFLICT, response.status_code)
NfInstModel.objects.filter(nfinstid='1267').delete()
- def test_change_ext_conn_inner_error(self):
+ def test_heal_vnf_inner_error(self):
NfInstModel(nfinstid='345',
nf_name='VNF1',
nf_desc="VNF DESC",
@@ -79,6 +79,7 @@ class TestNFInstantiate(TestCase):
response = self.client.post(url,
data={"additionalParams": "1"},
format='json')
+ NfInstModel.objects.filter(nfinstid='345').delete()
self.failUnlessEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code)
@mock.patch.object(HealVnf, 'run')
diff --git a/lcm/lcm/nf/tests/test_operate_vnf.py b/lcm/lcm/nf/tests/test_operate_vnf.py
index 997f9ba0..bae92274 100644
--- a/lcm/lcm/nf/tests/test_operate_vnf.py
+++ b/lcm/lcm/nf/tests/test_operate_vnf.py
@@ -57,6 +57,24 @@ class TestNFOperate(TestCase):
self.failUnlessEqual(status.HTTP_409_CONFLICT, response.status_code)
NfInstModel(nfinstid='12', nf_name='VNF1', status='NOT_INSTANTIATED').delete()
+ def test_operate_vnf_inner_error(self):
+ NfInstModel(nfinstid='345',
+ nf_name='VNF1',
+ nf_desc="VNF DESC",
+ vnfdid="1",
+ netype="XGW",
+ vendor="ZTE",
+ vnfSoftwareVersion="V1",
+ version="V1",
+ package_id="2",
+ status='INSTANTIATED').save()
+ url = "/api/vnflcm/v1/vnf_instances/345/operate"
+ response = self.client.post(url,
+ data={},
+ format='json')
+ NfInstModel.objects.filter(nfinstid='345').delete()
+ self.failUnlessEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code)
+
@mock.patch.object(OperateVnf, 'run')
def test_operate_vnf_success(self, mock_run):
req_data = {