Add a unit test for kayobe seed service deploy
This commit is contained in:
parent
b5eb53f60e
commit
53714fc5a9
@ -461,7 +461,8 @@ class SeedServiceDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
|
||||
playbooks = _build_playbook_list("kolla-ansible")
|
||||
self.run_kayobe_playbooks(parsed_args, playbooks, tags="config")
|
||||
|
||||
self.run_kayobe_playbook(parsed_args, "ansible/kolla-bifrost.yml")
|
||||
playbooks = _build_playbook_list("kolla-bifrost")
|
||||
self.run_kayobe_playbooks(parsed_args, playbooks)
|
||||
self.run_kolla_ansible_seed(parsed_args, "deploy-bifrost")
|
||||
playbooks = _build_playbook_list(
|
||||
"seed-introspection-rules", "dell-switch-bmp")
|
||||
|
@ -387,6 +387,46 @@ class TestCase(unittest.TestCase):
|
||||
]
|
||||
self.assertEqual(expected_calls, mock_run.call_args_list)
|
||||
|
||||
@mock.patch.object(commands.KayobeAnsibleMixin,
|
||||
"run_kayobe_playbooks")
|
||||
@mock.patch.object(commands.KollaAnsibleMixin,
|
||||
"run_kolla_ansible_seed")
|
||||
def test_service_deploy(self, mock_kolla_run, mock_run):
|
||||
command = commands.SeedServiceDeploy(TestApp(), [])
|
||||
parser = command.get_parser("test")
|
||||
parsed_args = parser.parse_args([])
|
||||
|
||||
result = command.run(parsed_args)
|
||||
self.assertEqual(0, result)
|
||||
|
||||
expected_calls = [
|
||||
mock.call(
|
||||
mock.ANY,
|
||||
["ansible/kolla-ansible.yml"],
|
||||
tags="config",
|
||||
),
|
||||
mock.call(
|
||||
mock.ANY,
|
||||
["ansible/kolla-bifrost.yml"],
|
||||
),
|
||||
mock.call(
|
||||
mock.ANY,
|
||||
[
|
||||
"ansible/seed-introspection-rules.yml",
|
||||
"ansible/dell-switch-bmp.yml",
|
||||
],
|
||||
),
|
||||
]
|
||||
self.assertEqual(expected_calls, mock_run.call_args_list)
|
||||
|
||||
expected_calls = [
|
||||
mock.call(
|
||||
mock.ANY,
|
||||
"deploy-bifrost",
|
||||
),
|
||||
]
|
||||
self.assertEqual(expected_calls, mock_kolla_run.call_args_list)
|
||||
|
||||
@mock.patch.object(commands.KayobeAnsibleMixin,
|
||||
"run_kayobe_config_dump")
|
||||
@mock.patch.object(commands.KayobeAnsibleMixin,
|
||||
|
Loading…
Reference in New Issue
Block a user