Merge "Fixed module-apply on removed module"

This commit is contained in:
Jenkins 2016-05-18 00:09:06 +00:00 committed by Gerrit Code Review
commit 654a1a228e
3 changed files with 35 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
fixes:
- Fixed issue where module-apply after module-remove
caused module-query to skip reporting on that
module. Bug 1571799

View File

@ -31,7 +31,7 @@ LOG = logging.getLogger(__name__)
CONF = cfg.CONF
class ModuleManager():
class ModuleManager(object):
"""This is a Manager utility class (mixin) for managing module-related
tasks.
"""
@ -72,6 +72,7 @@ class ModuleManager():
status = 'OK' if applied else 'ERROR'
admin_only = (not visible or tenant == cls.MODULE_APPLY_TO_ALL or
auto_apply)
result['removed'] = None
result['status'] = status
result['message'] = message
result['updated'] = now

View File

@ -397,8 +397,35 @@ class ModuleInstanceGroup(TestGroup):
self.test_runner.run_module_query_empty()
@test(groups=[GROUP, GROUP_MODULE_INSTANCE],
depends_on=[create_inst_with_mods],
depends_on=[module_remove],
runs_after=[module_query_empty_after])
def module_apply_again(self):
"""Check that module-apply works a second time."""
self.test_runner.run_module_apply()
@test(groups=[GROUP, GROUP_MODULE_INSTANCE],
depends_on=[module_apply],
runs_after=[module_query_empty_after])
def module_query_after_apply_again(self):
"""Check that module-query works after second apply."""
self.test_runner.run_module_query_after_apply()
@test(groups=[GROUP, GROUP_MODULE_INSTANCE],
depends_on=[module_apply_again],
runs_after=[module_query_after_apply_again])
def module_remove_again(self):
"""Check that module-remove works again."""
self.test_runner.run_module_remove()
@test(groups=[GROUP, GROUP_MODULE_INSTANCE],
depends_on=[module_remove_again])
def module_query_empty_after_again(self):
"""Check that the instance has no modules applied after remove."""
self.test_runner.run_module_query_empty()
@test(groups=[GROUP, GROUP_MODULE_INSTANCE],
depends_on=[create_inst_with_mods],
runs_after=[module_query_empty_after_again])
def wait_for_inst_with_mods(self):
"""Wait for create instance with modules to finish."""
self.test_runner.run_wait_for_inst_with_mods()