Improvement of FT cases for Retry LCM Operation

Add Client Notification Endpoint Test assertion in the following
functional tests for Retry LCM Operation:

- test_retry_instantiate
- test_retry_scale_out
- test_retry_chgextconn
- test_inst_chgextconn_term

Closes-Bug: #1921994
Change-Id: Ibc67c97b389f707b67fa59c7e69e536faf88b40d
(cherry picked from commit f731f88532)
This commit is contained in:
Aldinson Esto 2021-03-31 14:07:51 +09:00 committed by Aldinson C. Esto
parent 74543ee080
commit e19f07ceb4
2 changed files with 35 additions and 11 deletions

View File

@ -844,6 +844,7 @@ class VnfLcmWithUserDataTest(vnflcm_base.BaseVnfLcmTest):
In this test case, we do following steps.
- Create subscription.
- Test notification.
- Create VNF package.
- Upload VNF package.
- Create VNF instance.
@ -856,17 +857,21 @@ class VnfLcmWithUserDataTest(vnflcm_base.BaseVnfLcmTest):
- Delete subscription.
"""
# Create subscription and register it.
callback_url = os.path.join(vnflcm_base.MOCK_NOTIFY_CALLBACK_URL,
self._testMethodName)
request_body = fake_vnflcm.Subscription.make_create_request_body(
'http://localhost:{}{}'.format(
vnflcm_base.FAKE_SERVER_MANAGER.SERVER_PORT,
os.path.join(vnflcm_base.MOCK_NOTIFY_CALLBACK_URL,
self._testMethodName)))
callback_url))
resp, response_body = self._register_subscription(request_body)
self.assertEqual(201, resp.status_code)
self.assert_http_header_location_for_subscription(resp.headers)
subscription_id = response_body.get('id')
self.addCleanup(self._delete_subscription, subscription_id)
# Test notification
self.assert_notification_get(callback_url)
# Pre Setting: Create vnf package.
sample_name = 'functional3'
csar_package_path = os.path.abspath(
@ -948,6 +953,7 @@ class VnfLcmWithUserDataTest(vnflcm_base.BaseVnfLcmTest):
In this test case, we do following steps.
- Create subscription.
- Test notification.
- Create VNF package.
- Upload VNF package.
- Create VNF instance.
@ -962,17 +968,21 @@ class VnfLcmWithUserDataTest(vnflcm_base.BaseVnfLcmTest):
- Delete subscription.
"""
# Create subscription and register it.
callback_url = os.path.join(vnflcm_base.MOCK_NOTIFY_CALLBACK_URL,
self._testMethodName)
request_body = fake_vnflcm.Subscription.make_create_request_body(
'http://localhost:{}{}'.format(
vnflcm_base.FAKE_SERVER_MANAGER.SERVER_PORT,
os.path.join(vnflcm_base.MOCK_NOTIFY_CALLBACK_URL,
self._testMethodName)))
callback_url))
resp, response_body = self._register_subscription(request_body)
self.assertEqual(201, resp.status_code)
self.assert_http_header_location_for_subscription(resp.headers)
subscription_id = response_body.get('id')
self.addCleanup(self._delete_subscription, subscription_id)
# Test notification
self.assert_notification_get(callback_url)
# Pre Setting: Create vnf package.
sample_name = 'functional4'
csar_package_path = os.path.abspath(
@ -1538,6 +1548,7 @@ class VnfLcmWithUserDataTest(vnflcm_base.BaseVnfLcmTest):
In this test case, we do following steps.
- Create subscription.
- Test notification.
- Create VNF package.
- Upload VNF package.
- Create VNF instance.
@ -1549,17 +1560,21 @@ class VnfLcmWithUserDataTest(vnflcm_base.BaseVnfLcmTest):
- Delete subscription.
"""
# Create subscription and register it.
callback_url = os.path.join(vnflcm_base.MOCK_NOTIFY_CALLBACK_URL,
self._testMethodName)
request_body = fake_vnflcm.Subscription.make_create_request_body(
'http://localhost:{}{}'.format(
vnflcm_base.FAKE_SERVER_MANAGER.SERVER_PORT,
os.path.join(vnflcm_base.MOCK_NOTIFY_CALLBACK_URL,
self._testMethodName)))
callback_url))
resp, response_body = self._register_subscription(request_body)
self.assertEqual(201, resp.status_code)
self.assert_http_header_location_for_subscription(resp.headers)
subscription_id = response_body.get('id')
self.addCleanup(self._delete_subscription, subscription_id)
# Test notification
self.assert_notification_get(callback_url)
# Pre Setting: Create vnf package.
sample_name = 'functional4'
csar_package_path = os.path.abspath(
@ -1906,6 +1921,7 @@ class VnfLcmWithUserDataTest(vnflcm_base.BaseVnfLcmTest):
In this test case, we do following steps.
- Create subscription.
- Test notification.
- Show subscriptions.
- Get list of subscriptions.
- Create VNF package.
@ -1921,11 +1937,12 @@ class VnfLcmWithUserDataTest(vnflcm_base.BaseVnfLcmTest):
- Delete subscription
"""
# Create subscription and register it.
callback_url = os.path.join(vnflcm_base.MOCK_NOTIFY_CALLBACK_URL,
self._testMethodName)
request_body = fake_vnflcm.Subscription.make_create_request_body(
'http://localhost:{}{}'.format(
vnflcm_base.FAKE_SERVER_MANAGER.SERVER_PORT,
os.path.join(vnflcm_base.MOCK_NOTIFY_CALLBACK_URL,
self._testMethodName)))
callback_url))
resp, response_body = self._register_subscription(request_body)
self.assertEqual(201, resp.status_code)
self.assert_http_header_location_for_subscription(resp.headers)
@ -1934,6 +1951,9 @@ class VnfLcmWithUserDataTest(vnflcm_base.BaseVnfLcmTest):
self._delete_subscription,
subscription_id)
# Test notification
self.assert_notification_get(callback_url)
# Subscription show
resp, body = self._wait_show_subscription(subscription_id)
self.assert_subscription_show(resp, body)

View File

@ -97,6 +97,7 @@ class VnfLcmWithNfvoSeparator(vnflcm_base.BaseVnfLcmTest):
In this test case, we do following steps.
- Create subscription.
- Test notification.
- Create VNF instance.
- Instantiate VNF.
- List VNF instances.
@ -112,18 +113,21 @@ class VnfLcmWithNfvoSeparator(vnflcm_base.BaseVnfLcmTest):
glance_image = self._list_glance_image()[0]
# Create subscription and register it.
callback_url = os.path.join(vnflcm_base.MOCK_NOTIFY_CALLBACK_URL,
self._testMethodName)
request_body = fake_vnflcm.Subscription.make_create_request_body(
'http://localhost:{}{}'.format(
vnflcm_base.FAKE_SERVER_MANAGER.SERVER_PORT,
os.path.join(
vnflcm_base.MOCK_NOTIFY_CALLBACK_URL,
self._testMethodName)))
callback_url))
resp, response_body = self._register_subscription(request_body)
self.assertEqual(201, resp.status_code)
self.assert_http_header_location_for_subscription(resp.headers)
subscription_id = response_body.get('id')
self.addCleanup(self._delete_subscription, subscription_id)
# Test notification
self.assert_notification_get(callback_url)
# Create vnf instance
resp, vnf_instance = self._create_vnf_instance_from_body(
fake_vnflcm.VnfInstances.make_create_request_body(