summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Munilla <smunilla@redhat.com>2016-08-15 16:09:45 -0400
committerSamuel Munilla <smunilla@redhat.com>2016-08-15 16:09:47 -0400
commit5d01fcd699fa985b20cf19f3e9edd362b1dfedfc (patch)
tree5e81caced246cc039d94d94a50e732cacace11f3
parent58819b9243e72482729fce3ff24b414c461431ab (diff)
downloadopenshift-5d01fcd699fa985b20cf19f3e9edd362b1dfedfc.tar.gz
openshift-5d01fcd699fa985b20cf19f3e9edd362b1dfedfc.tar.bz2
openshift-5d01fcd699fa985b20cf19f3e9edd362b1dfedfc.tar.xz
openshift-5d01fcd699fa985b20cf19f3e9edd362b1dfedfc.zip
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.
-rw-r--r--utils/test/fixture.py22
1 files 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