Check blocked ovn-chassis units with bad config (#605)

* Check blocked ovn-chassis units with bad config

LP bug#1919481 [0] needs to have a func-test to check if units can
handle bad bridge-interface-mappings configuration and set units
workload to block state and return to active state with good config.

[0] https://bugs.launchpad.net/charm-ovn-chassis/+bug/1919481

* Changing test_wrong_bridge_config to use config_change

Instead of using block_until_unit_wl_status, change the test_config
to be able to check blocked state for ovn-chassis units

Co-authored-by: Aurelien Lourot <aurelien.lourot@canonical.com>
This commit is contained in:
Gabriel Angelo Sgarbi Cocenza
2021-07-29 06:09:33 -03:00
committed by GitHub
parent 4d2761e84d
commit ea341f1eb4

View File

@@ -168,6 +168,28 @@ class ChassisCharmOperationTest(BaseCharmOperationTest):
'{}: "{}" no longer present'
.format(unit.entity_id, expected_key))
def test_wrong_bridge_config(self):
"""Confirm that ovn-chassis units block with wrong bridge config."""
stored_target_deploy_status = self.test_config.get(
'target_deploy_status', {})
new_target_deploy_status = stored_target_deploy_status.copy()
new_target_deploy_status[self.application_name] = {
'ovn-chassis': 'blocked',
}
if 'target_deploy_status' in self.test_config:
self.test_config['target_deploy_status'].update(
new_target_deploy_status)
else:
self.test_config['target_deploy_status'] = new_target_deploy_status
with self.config_change(
{'bridge-interface-mappings': ''},
{'bridge-interface-mappings': 'incorrect'}):
logging.info('Charm went into blocked state as expected, restore '
'configuration')
self.test_config[
'target_deploy_status'] = stored_target_deploy_status
class OVSOVNMigrationTest(test_utils.BaseCharmTest):
"""OVS to OVN migration tests."""