diff options
author | Brenton Leanhardt <bleanhar@redhat.com> | 2015-11-20 14:36:13 -0500 |
---|---|---|
committer | Brenton Leanhardt <bleanhar@redhat.com> | 2015-11-20 14:36:13 -0500 |
commit | f0d13819c35727300101a7e31b8ff9b0022e683f (patch) | |
tree | da964721c03327adaa327a69306de95010e349bb /utils/test/oo_config_tests.py | |
parent | 191bfbaa614b1eeafe4785edd295e1e0b3498175 (diff) | |
parent | a72243eda9ad0fb066c405a8171d41bfd8a16ecf (diff) | |
download | openshift-f0d13819c35727300101a7e31b8ff9b0022e683f.tar.gz openshift-f0d13819c35727300101a7e31b8ff9b0022e683f.tar.bz2 openshift-f0d13819c35727300101a7e31b8ff9b0022e683f.tar.xz openshift-f0d13819c35727300101a7e31b8ff9b0022e683f.zip |
Merge pull request #890 from smunilla/friendly_unattended_errors
atomic-openshift-installer: connect_to error handling
Diffstat (limited to 'utils/test/oo_config_tests.py')
-rw-r--r-- | utils/test/oo_config_tests.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/utils/test/oo_config_tests.py b/utils/test/oo_config_tests.py index 0dd4a30e9..9f5f8e244 100644 --- a/utils/test/oo_config_tests.py +++ b/utils/test/oo_config_tests.py @@ -73,6 +73,29 @@ hosts: node: true """ +CONFIG_BAD = """ +variant: openshift-enterprise +ansible_ssh_user: root +hosts: + - connect_to: master-private.example.com + ip: 10.0.0.1 + hostname: master-private.example.com + public_ip: 24.222.0.1 + public_hostname: master.example.com + master: true + node: true + - ip: 10.0.0.2 + hostname: node1-private.example.com + public_ip: 24.222.0.2 + public_hostname: node1.example.com + node: true + - connect_to: node2-private.example.com + ip: 10.0.0.3 + hostname: node2-private.example.com + public_ip: 24.222.0.3 + public_hostname: node2.example.com + node: true +""" class OOInstallFixture(unittest.TestCase): @@ -161,6 +184,17 @@ class OOConfigTests(OOInstallFixture): self.assertEquals('openshift-enterprise', ooconfig.settings['variant']) self.assertEquals('v1', ooconfig.settings['version']) + def test_load_bad_config(self): + + cfg_path = self.write_config(os.path.join(self.work_dir, + 'ooinstall.conf'), CONFIG_BAD) + try: + OOConfig(cfg_path) + assert False + except OOConfigInvalidHostError: + assert True + + def test_load_complete_facts(self): cfg_path = self.write_config(os.path.join(self.work_dir, 'ooinstall.conf'), SAMPLE_CONFIG) |