From 611d6495480dae7080236fc1da56e28db042cd9f Mon Sep 17 00:00:00 2001 From: Koichiro Den Date: Wed, 11 Nov 2020 20:09:55 +0900 Subject: [PATCH] Refine fenix maintenance FT * When testing any Fenix state, 'MAINTENANCE' state should come at first as the maintenance session opening, even though this does not make any difference to the test result right now. * Reduce SCALE_SLEEP_TIME. As opposed to SCALE_WINDOW_SLEEP_TIME, we do not need such a long waiting duration bacause we're just waiting for DB updating, not VNF instance launch/destroy. * Remove pointless sleep. Notice that test_vnf_alarm_maintenance is the most time-consuming FT at the moment. * Add a reminder of migration testing. Change-Id: Idd93a538c5479839fe865ad85555c952d276dfb2 --- tacker/tests/constants.py | 2 +- .../tests/functional/vnfm/test_tosca_vnf_maintenance.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tacker/tests/constants.py b/tacker/tests/constants.py index 0ce78b044..12850cc91 100644 --- a/tacker/tests/constants.py +++ b/tacker/tests/constants.py @@ -21,7 +21,7 @@ VNF_CIRROS_DEAD_TIMEOUT = 500 ACTIVE_SLEEP_TIME = 3 DEAD_SLEEP_TIME = 1 SCALE_WINDOW_SLEEP_TIME = 120 -SCALE_SLEEP_TIME = 120 +SCALE_SLEEP_TIME = 30 NS_CREATE_TIMEOUT = 400 NS_DELETE_TIMEOUT = 300 NOVA_CLIENT_VERSION = 2 diff --git a/tacker/tests/functional/vnfm/test_tosca_vnf_maintenance.py b/tacker/tests/functional/vnfm/test_tosca_vnf_maintenance.py index 7a961bff7..0bc3c834d 100644 --- a/tacker/tests/functional/vnfm/test_tosca_vnf_maintenance.py +++ b/tacker/tests/functional/vnfm/test_tosca_vnf_maintenance.py @@ -102,7 +102,9 @@ class VnfTestMaintenanceMonitor(base.BaseTackerTest): time.sleep(constants.SCALE_SLEEP_TIME) target_scaled = -1 - if state == 'SCALE_IN': + if state == 'MAINTENANCE': + target_scaled = 0 + elif state == 'SCALE_IN': target_scaled = 1 _wait_vnf_active_and_assert_vdu_count(2, scale_type='in') elif state == 'MAINTENANCE_COMPLETE': @@ -115,7 +117,7 @@ class VnfTestMaintenanceMonitor(base.BaseTackerTest): self.assertEqual(int(scaled), target_scaled) time.sleep(constants.SCALE_WINDOW_SLEEP_TIME) - time.sleep(constants.SCALE_WINDOW_SLEEP_TIME) + _request_maintenance_action('MAINTENANCE') _request_maintenance_action('SCALE_IN') _request_maintenance_action('MAINTENANCE_COMPLETE') @@ -187,8 +189,8 @@ class VnfTestMaintenanceMonitor(base.BaseTackerTest): self.addCleanup(self.wait_until_vnf_delete, vnf_id, constants.VNF_CIRROS_DELETE_TIMEOUT) + # TODO(kden): add a test for migration def test_vnf_alarm_maintenance(self): - # instance_maintenance = self._get_instance_maintenance() self._test_vnf_tosca_maintenance( 'sample-tosca-vnfd-maintenance.yaml', 'maintenance_vnf')