From 5d01fcd699fa985b20cf19f3e9edd362b1dfedfc Mon Sep 17 00:00:00 2001 From: Samuel Munilla Date: Mon, 15 Aug 2016 16:09:45 -0400 Subject: a-o-i: Fix broken tests from installed hosts check With the latest changes to behavior around uninstalled hosts during a scaleup, nosetests were broken. This updates the tests to verify that we exit when we are expecting. --- utils/test/fixture.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/utils/test/fixture.py b/utils/test/fixture.py index 152c06da8..ddf6b6802 100644 --- a/utils/test/fixture.py +++ b/utils/test/fixture.py @@ -137,15 +137,19 @@ class OOCliFixture(OOInstallFixture): written_config = read_yaml(config_file) self._verify_config_hosts(written_config, exp_hosts_len) - self.assert_result(result, 0) - self._verify_load_facts(load_facts_mock) - self._verify_run_playbook(run_playbook_mock, exp_hosts_len, exp_hosts_to_run_on_len) - - # Make sure we ran on the expected masters and nodes: - hosts = run_playbook_mock.call_args[0][1] - hosts_to_run_on = run_playbook_mock.call_args[0][2] - self.assertEquals(exp_hosts_len, len(hosts)) - self.assertEquals(exp_hosts_to_run_on_len, len(hosts_to_run_on)) + if "Uninstalled" in result.output: + # verify we exited on seeing uninstalled hosts + self.assertEqual(result.exit_code, 1) + else: + self.assert_result(result, 0) + self._verify_load_facts(load_facts_mock) + self._verify_run_playbook(run_playbook_mock, exp_hosts_len, exp_hosts_to_run_on_len) + + # Make sure we ran on the expected masters and nodes: + hosts = run_playbook_mock.call_args[0][1] + hosts_to_run_on = run_playbook_mock.call_args[0][2] + self.assertEquals(exp_hosts_len, len(hosts)) + self.assertEquals(exp_hosts_to_run_on_len, len(hosts_to_run_on)) #pylint: disable=too-many-arguments,too-many-branches,too-many-statements -- cgit v1.2.3