aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/setup.yaml21
-rw-r--r--tests/unit/ansible_library/modules/apex_generate_inventory_test.py (renamed from tests/unit/ansible_library/modules/apex_test.py)4
2 files changed, 23 insertions, 2 deletions
diff --git a/tests/integration/setup.yaml b/tests/integration/setup.yaml
index 8d055c23..fed5e9d9 100644
--- a/tests/integration/setup.yaml
+++ b/tests/integration/setup.yaml
@@ -20,6 +20,27 @@
template: src={{ qtip_resources }}/template/ssh.cfg.j2 dest=./ssh.cfg
delegate_to: localhost
+- hosts: apex-undercloud
+ gather_facts: no
+
+ tasks:
+ - name: collect overcloud baremetal info
+ shell: . /root/stackrc && openstack baremetal list --fields instance_uuid properties provision_state --format json
+ register: baremetal_info
+ - name: collect overcloud server info
+ shell: . /root/stackrc && openstack server list --format json
+ register: server_info
+ - name: generate inventory
+ apex_generate_inventory:
+ baremetal_info: "{{ baremetal_info.stdout | from_json }}"
+ server_info: "{{ server_info.stdout | from_json }}"
+ - name: update inventory file
+ template: src={{ qtip_resources }}/template/hosts.j2 dest=./hosts
+ delegate_to: localhost
+ - name: update ssh.cfg file
+ template: src={{ qtip_resources }}/template/ssh.cfg.j2 dest=./ssh.cfg
+ delegate_to: localhost
+
# Initialize testapi database
- hosts: localhost
tasks:
diff --git a/tests/unit/ansible_library/modules/apex_test.py b/tests/unit/ansible_library/modules/apex_generate_inventory_test.py
index 8a1d0673..7df9d35c 100644
--- a/tests/unit/ansible_library/modules/apex_test.py
+++ b/tests/unit/ansible_library/modules/apex_generate_inventory_test.py
@@ -10,7 +10,7 @@
import json
import os
-from qtip.ansible_library.modules import apex
+from qtip.ansible_library.modules import apex_generate_inventory
def test_generate_inventory(data_root):
@@ -18,7 +18,7 @@ def test_generate_inventory(data_root):
'apex', 'baremetal_info.json')))
server_info = json.load(open(os.path.join(data_root, 'external',
'apex', 'server_info.json')))
- inventory = apex.generate_inventory(baremetal_info, server_info)
+ inventory = apex_generate_inventory.generate_inventory(baremetal_info, server_info)
assert dict(inventory['hosts']) == {
u'compute': [u'192.0.2.5', u'192.0.2.6'],
u'control': [u'192.0.2.7', u'192.0.2.8', u'192.0.2.9']}