Skip to content

Commit 35b99cc

Browse files
committed
add inventory tests
1 parent b72fe96 commit 35b99cc

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

tests/integration/targets/cs_common/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
cs_template:
1010
name: "{{ cs_common_template }}"
1111
state: absent
12-
cross_zones: yes
12+
cross_zones: true
1313
template_filter: all
1414
register: template
1515
check_mode: true
@@ -22,7 +22,7 @@
2222
name: smoke-test-vm
2323
template: "{{ cs_common_template }}"
2424
service_offering: "{{ cs_common_service_offering }}"
25-
zone: "{{ cs_common_zone_adv }}"
25+
zone: "{{ cs_common_zone_basic }}"
2626
register: instance
2727
until: instance is successful
2828
retries: 20
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
cloud/cs
2-
shippable/cs/group2
2+
cs/group1
3+
cs/group3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
plugin: ngine_io.cloudstack.cloudstack
1+
plugin: ngine_io.cloudstack.instance
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
---
2-
- hosts: 127.0.0.1
2+
- hosts: localhost
33
connection: local
4-
gather_facts: no
4+
gather_facts: false
55
vars:
6-
simulator: http://cloudstack-sim:8888
6+
simulator: http://172.17.0.2:8888
77
tasks:
88
- name: Retrieve Simulator Keys
99
uri:
10-
url: "{{simulator}}/admin.json"
11-
return_content: yes
10+
url: "{{ simulator }}/admin.json"
11+
return_content: true
1212
register: admin
13+
until: admin is success
14+
retries: 5
15+
delay: 1
1316

1417
- name: Create cloudstack.env
1518
template:
@@ -19,4 +22,4 @@
1922
- name: Create cloudstack-instances.yml
2023
template:
2124
src: templates/cloudstack-instances.yml.j2
22-
dest: ../cloudstack-instances.yml
25+
dest: ../cloudstack-instances.yml

tests/integration/targets/inventory_instance/playbooks/common-cloudstack-objects.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
2-
- hosts: 127.0.0.1
2+
- hosts: localhost
33
connection: local
4-
gather_facts: no
4+
gather_facts: false
55
tasks:
6-
76
- include_vars:
87
file: vars/common.yml
98

109
- name: wait for system template available
1110
cs_template:
1211
name: "{{ cs_common_template }}"
1312
state: absent
14-
cross_zones: yes
13+
cross_zones: true
1514
template_filter: all
1615
register: template
1716
check_mode: true
@@ -24,7 +23,7 @@
2423
name: smoke-test-vm
2524
template: "{{ cs_common_template }}"
2625
service_offering: "{{ cs_common_service_offering }}"
27-
zone: "{{ cs_common_zone_adv }}"
26+
zone: "{{ cs_common_zone_basic }}"
2827
register: instance
2928
until: instance is successful
3029
retries: 2
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
---
2-
3-
- import_playbook: common-cloudstack-objects.yml
2+
- import_playbook: common-cloudstack-objects.yml
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
CLOUDSTACK_ENDPOINT="{{simulator}}/client/api"
1+
CLOUDSTACK_ENDPOINT="{{ simulator }}/client/api"
22
export CLOUDSTACK_ENDPOINT
33

4-
CLOUDSTACK_KEY="{{admin.json.apikey}}"
4+
CLOUDSTACK_KEY="{{ admin.json.apikey }}"
55
export CLOUDSTACK_KEY
66

77
CLOUDSTACK_SECRET="{{admin.json.secretkey}}"
88
export CLOUDSTACK_SECRET
99

1010
CLOUDSTACK_TIMEOUT=60
11-
export CLOUDSTACK_TIMEOUT
11+
export CLOUDSTACK_TIMEOUT
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
---
2-
32
# TODO: This is borrowed from common role, should be better reused
43

54
cs_resource_prefix: "cs-{{ (ansible_date_time.iso8601_micro | to_uuid).split('-')[0] }}"
65
cs_common_template: CentOS 5.6 (64-bit) no GUI (Simulator)
76
cs_common_service_offering: Small Instance
8-
cs_common_zone_adv: Sandbox-simulator-advanced
9-
cs_common_zone_basic: Sandbox-simulator-basic
7+
cs_common_zone_basic: Sandbox-simulator-basic

0 commit comments

Comments
 (0)