Browse Source

a-o-i: Update nosetests for ansible_ssh_user

Update the nosetests to reflect the new location of ansible_ssh_user
in the config file.
Samuel Munilla 8 years ago
parent
commit
be5414d9b4
3 changed files with 11 additions and 10 deletions
  1. 6 6
      utils/test/cli_installer_tests.py
  2. 1 1
      utils/test/fixture.py
  3. 4 3
      utils/test/oo_config_tests.py

+ 6 - 6
utils/test/cli_installer_tests.py

@@ -101,8 +101,8 @@ MOCK_FACTS_QUICKHA = {
 # Missing connect_to on some hosts:
 BAD_CONFIG = """
 variant: %s
-ansible_ssh_user: root
 deployment:
+    ansible_ssh_user: root
     hosts:
       - connect_to: 10.0.0.1
         ip: 10.0.0.1
@@ -132,8 +132,8 @@ deployment:
 
 QUICKHA_CONFIG = """
 variant: %s
-ansible_ssh_user: root
 deployment:
+    ansible_ssh_user: root
     hosts:
       - connect_to: 10.0.0.1
         ip: 10.0.0.1
@@ -189,8 +189,8 @@ deployment:
 
 QUICKHA_2_MASTER_CONFIG = """
 variant: %s
-ansible_ssh_user: root
 deployment:
+    ansible_ssh_user: root
     hosts:
       - connect_to: 10.0.0.1
         ip: 10.0.0.1
@@ -238,8 +238,8 @@ deployment:
 
 QUICKHA_CONFIG_REUSED_LB = """
 variant: %s
-ansible_ssh_user: root
 deployment:
+    ansible_ssh_user: root
     hosts:
       - connect_to: 10.0.0.1
         ip: 10.0.0.1
@@ -281,8 +281,8 @@ deployment:
 
 QUICKHA_CONFIG_NO_LB = """
 variant: %s
-ansible_ssh_user: root
 deployment:
+    ansible_ssh_user: root
     hosts:
       - connect_to: 10.0.0.1
         ip: 10.0.0.1
@@ -323,8 +323,8 @@ deployment:
 
 QUICKHA_CONFIG_PRECONFIGURED_LB = """
 variant: %s
-ansible_ssh_user: root
 deployment:
+    ansible_ssh_user: root
     hosts:
       - connect_to: 10.0.0.1
         ip: 10.0.0.1

+ 1 - 1
utils/test/fixture.py

@@ -11,9 +11,9 @@ from click.testing import CliRunner
 SAMPLE_CONFIG = """
 variant: %s
 variant_version: 3.2
-ansible_ssh_user: root
 master_routingconfig_subdomain: example.com
 deployment:
+    ansible_ssh_user: root
     hosts:
       - connect_to: 10.0.0.1
         ip: 10.0.0.1

+ 4 - 3
utils/test/oo_config_tests.py

@@ -13,8 +13,8 @@ from ooinstall.oo_config import OOConfig, Host, OOConfigInvalidHostError
 SAMPLE_CONFIG = """
 variant: openshift-enterprise
 variant_version: 3.2
-ansible_ssh_user: root
 deployment:
+    ansible_ssh_user: root
     hosts:
       - connect_to: master-private.example.com
         ip: 10.0.0.1
@@ -65,6 +65,7 @@ validated_facts:
 
 CONFIG_INCOMPLETE_FACTS = """
 deployment:
+    ansible_ssh_user: root
     hosts:
       - connect_to: 10.0.0.1
         ip: 10.0.0.1
@@ -90,8 +91,8 @@ deployment:
 
 CONFIG_BAD = """
 variant: openshift-enterprise
-ansible_ssh_user: root
 deployment:
+    ansible_ssh_user: root
     hosts:
       - connect_to: master-private.example.com
         ip: 10.0.0.1
@@ -212,7 +213,7 @@ class OOConfigTests(OOInstallFixture):
             self.assertTrue('hostname' in h)
             self.assertTrue('public_hostname' in h)
 
-        self.assertTrue('ansible_ssh_user' in written_config)
+        self.assertTrue('ansible_ssh_user' in written_config['deployment'])
         self.assertTrue('variant' in written_config)
         self.assertEquals('v2', written_config['version'])