summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Moser <mail@renemoser.net>2017-05-09 05:32:11 +0200
committerMatt Clay <matt@mystile.com>2017-05-09 11:32:11 +0800
commitaaf4f04574bbf1faec7b52cb5fd425ceb6fa0972 (patch)
treee1e1fd691004423ca55c990c13cb51dd7eba828b
parentb58cf0d23abd5ac6fffdfc78eb67b1b1bb11f631 (diff)
downloadansible-aaf4f04574bbf1faec7b52cb5fd425ceb6fa0972.tar.gz
automated integration tests for cloudstack (#20552)
-rw-r--r--test/integration/Makefile5
-rw-r--r--test/integration/cloudstack.yml30
-rw-r--r--test/integration/roles/test_cs_common/defaults/main.yml2
-rw-r--r--test/integration/roles/test_cs_configuration/defaults/main.yml5
-rw-r--r--test/integration/roles/test_cs_configuration/meta/main.yml3
-rw-r--r--test/integration/roles/test_cs_firewall/meta/main.yml3
-rw-r--r--test/integration/roles/test_cs_instance/meta/main.yml3
-rw-r--r--test/integration/roles/test_cs_instance_facts/defaults/main.yml3
-rw-r--r--test/integration/roles/test_cs_instance_facts/meta/main.yml3
-rw-r--r--test/integration/roles/test_cs_iso/meta/main.yml3
-rw-r--r--test/integration/roles/test_cs_loadbalancer_rule/defaults/main.yml5
-rw-r--r--test/integration/roles/test_cs_loadbalancer_rule/meta/main.yml3
-rw-r--r--test/integration/roles/test_cs_pod/meta/main.yml3
-rw-r--r--test/integration/roles/test_cs_portforward/defaults/main.yml3
-rw-r--r--test/integration/roles/test_cs_portforward/meta/main.yml3
-rw-r--r--test/integration/roles/test_cs_vmsnapshot/defaults/main.yml3
-rw-r--r--test/integration/roles/test_cs_vmsnapshot/meta/main.yml3
-rw-r--r--test/integration/roles/test_cs_volume/meta/main.yml3
-rw-r--r--test/integration/targets/cs_account/meta/main.yml2
-rw-r--r--test/integration/targets/cs_account/tasks/main.yml44
-rw-r--r--test/integration/targets/cs_affinitygroup/meta/main.yml2
-rw-r--r--test/integration/targets/cs_cluster/meta/main.yml2
-rw-r--r--test/integration/targets/cs_common/aliases (renamed from test/integration/targets/test_cs_common/aliases)0
-rw-r--r--test/integration/targets/cs_common/defaults/main.yml5
-rw-r--r--test/integration/targets/cs_configuration/aliases3
-rw-r--r--test/integration/targets/cs_configuration/defaults/main.yml5
-rw-r--r--test/integration/targets/cs_configuration/meta/main.yml3
-rw-r--r--test/integration/targets/cs_configuration/tasks/account.yml (renamed from test/integration/roles/test_cs_configuration/tasks/account.yml)0
-rw-r--r--test/integration/targets/cs_configuration/tasks/cluster.yml (renamed from test/integration/roles/test_cs_configuration/tasks/cluster.yml)0
-rw-r--r--test/integration/targets/cs_configuration/tasks/main.yml (renamed from test/integration/roles/test_cs_configuration/tasks/main.yml)0
-rw-r--r--test/integration/targets/cs_configuration/tasks/storage.yml (renamed from test/integration/roles/test_cs_configuration/tasks/storage.yml)0
-rw-r--r--test/integration/targets/cs_configuration/tasks/zone.yml (renamed from test/integration/roles/test_cs_configuration/tasks/zone.yml)0
-rw-r--r--test/integration/targets/cs_domain/meta/main.yml2
-rw-r--r--test/integration/targets/cs_firewall/aliases3
-rw-r--r--test/integration/targets/cs_firewall/defaults/main.yml (renamed from test/integration/roles/test_cs_firewall/defaults/main.yml)2
-rw-r--r--test/integration/targets/cs_firewall/meta/main.yml3
-rw-r--r--test/integration/targets/cs_firewall/tasks/main.yml (renamed from test/integration/roles/test_cs_firewall/tasks/main.yml)66
-rw-r--r--test/integration/targets/cs_instance/aliases3
-rw-r--r--test/integration/targets/cs_instance/defaults/main.yml (renamed from test/integration/roles/test_cs_instance/defaults/main.yml)2
-rw-r--r--test/integration/targets/cs_instance/meta/main.yml3
-rw-r--r--test/integration/targets/cs_instance/tasks/absent.yml (renamed from test/integration/roles/test_cs_instance/tasks/absent.yml)0
-rw-r--r--test/integration/targets/cs_instance/tasks/absent_display_name.yml (renamed from test/integration/roles/test_cs_instance/tasks/absent_display_name.yml)0
-rw-r--r--test/integration/targets/cs_instance/tasks/cleanup.yml (renamed from test/integration/roles/test_cs_instance/tasks/cleanup.yml)0
-rw-r--r--test/integration/targets/cs_instance/tasks/main.yml (renamed from test/integration/roles/test_cs_instance/tasks/main.yml)0
-rw-r--r--test/integration/targets/cs_instance/tasks/present.yml (renamed from test/integration/roles/test_cs_instance/tasks/present.yml)0
-rw-r--r--test/integration/targets/cs_instance/tasks/present_display_name.yml (renamed from test/integration/roles/test_cs_instance/tasks/present_display_name.yml)0
-rw-r--r--test/integration/targets/cs_instance/tasks/setup.yml (renamed from test/integration/roles/test_cs_instance/tasks/setup.yml)0
-rw-r--r--test/integration/targets/cs_instance/tasks/tags.yml (renamed from test/integration/roles/test_cs_instance/tasks/tags.yml)0
-rw-r--r--test/integration/targets/cs_instance_facts/aliases3
-rw-r--r--test/integration/targets/cs_instance_facts/defaults/main.yml3
-rw-r--r--test/integration/targets/cs_instance_facts/meta/main.yml3
-rw-r--r--test/integration/targets/cs_instance_facts/tasks/main.yml (renamed from test/integration/roles/test_cs_instance_facts/tasks/main.yml)0
-rw-r--r--test/integration/targets/cs_instancegroup/meta/main.yml2
-rw-r--r--test/integration/targets/cs_iso/aliases3
-rw-r--r--test/integration/targets/cs_iso/meta/main.yml3
-rw-r--r--test/integration/targets/cs_iso/tasks/main.yml (renamed from test/integration/roles/test_cs_iso/tasks/main.yml)0
-rw-r--r--test/integration/targets/cs_loadbalancer_rule/aliases3
-rw-r--r--test/integration/targets/cs_loadbalancer_rule/meta/main.yml3
-rw-r--r--test/integration/targets/cs_loadbalancer_rule/tasks/main.yml (renamed from test/integration/roles/test_cs_loadbalancer_rule/tasks/main.yml)98
-rw-r--r--test/integration/targets/cs_pod/aliases3
-rw-r--r--test/integration/targets/cs_pod/meta/main.yml3
-rw-r--r--test/integration/targets/cs_pod/tasks/main.yml (renamed from test/integration/roles/test_cs_pod/tasks/main.yml)21
-rw-r--r--test/integration/targets/cs_portforward/aliases3
-rw-r--r--test/integration/targets/cs_portforward/defaults/main.yml3
-rw-r--r--test/integration/targets/cs_portforward/meta/main.yml3
-rw-r--r--test/integration/targets/cs_portforward/tasks/main.yml (renamed from test/integration/roles/test_cs_portforward/tasks/main.yml)71
-rw-r--r--test/integration/targets/cs_project/meta/main.yml2
-rw-r--r--test/integration/targets/cs_resourcelimit/meta/main.yml2
-rw-r--r--test/integration/targets/cs_securitygroup/meta/main.yml2
-rw-r--r--test/integration/targets/cs_securitygroup_rule/meta/main.yml2
-rw-r--r--test/integration/targets/cs_sshkeypair/meta/main.yml2
-rw-r--r--test/integration/targets/cs_sshkeypair/tasks/main.yml56
-rw-r--r--test/integration/targets/cs_user/meta/main.yml2
-rw-r--r--test/integration/targets/cs_vmsnapshot/aliases3
-rw-r--r--test/integration/targets/cs_vmsnapshot/defaults/main.yml3
-rw-r--r--test/integration/targets/cs_vmsnapshot/meta/main.yml3
-rw-r--r--test/integration/targets/cs_vmsnapshot/tasks/main.yml (renamed from test/integration/roles/test_cs_vmsnapshot/tasks/main.yml)0
-rw-r--r--test/integration/targets/cs_volume/aliases3
-rw-r--r--test/integration/targets/cs_volume/defaults/main.yml (renamed from test/integration/roles/test_cs_volume/defaults/main.yml)2
-rw-r--r--test/integration/targets/cs_volume/meta/main.yml3
-rw-r--r--test/integration/targets/cs_volume/tasks/main.yml (renamed from test/integration/roles/test_cs_volume/tasks/main.yml)0
-rw-r--r--test/integration/targets/cs_vpc/aliases3
-rw-r--r--test/integration/targets/cs_vpc/meta/main.yml3
-rw-r--r--test/integration/targets/cs_vpc/tasks/main.yml399
-rw-r--r--test/integration/targets/test_cs_common/defaults/main.yml2
-rw-r--r--test/utils/docker/cloudstack-simulator/Dockerfile64
-rw-r--r--test/utils/docker/cloudstack-simulator/Makefile14
-rw-r--r--test/utils/docker/cloudstack-simulator/README.rst31
-rw-r--r--test/utils/docker/cloudstack-simulator/nginx_default.conf23
-rwxr-xr-xtest/utils/docker/cloudstack-simulator/run.sh15
-rw-r--r--test/utils/docker/cloudstack-simulator/supervisord.conf28
-rw-r--r--test/utils/docker/cloudstack-simulator/zones.cfg310
92 files changed, 1248 insertions, 193 deletions
diff --git a/test/integration/Makefile b/test/integration/Makefile
index 2fe5aec1f1..aa9d72b516 100644
--- a/test/integration/Makefile
+++ b/test/integration/Makefile
@@ -242,11 +242,6 @@ rackspace: $(CREDENTIALS_FILE)
CLOUD_RESOURCE_PREFIX="$(CLOUD_RESOURCE_PREFIX)" make rackspace_cleanup ; \
exit $$RC;
-cloudstack:
- ansible-playbook cloudstack.yml -i $(INVENTORY) -e @$(VARS_FILE) -e "resource_prefix=$(CLOUD_RESOURCE_PREFIX)" -v $(TEST_FLAGS) ; \
- RC=$$? ; \
- exit $$RC;
-
exoscale:
ansible-playbook exoscale.yml -i $(INVENTORY) -e @$(VARS_FILE) -v $(TEST_FLAGS) ; \
RC=$$? ; \
diff --git a/test/integration/cloudstack.yml b/test/integration/cloudstack.yml
deleted file mode 100644
index 9104237bfd..0000000000
--- a/test/integration/cloudstack.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-- hosts: localhost
- connection: local
- gather_facts: no
- tags:
- - cloudstack
- vars:
- cs_resource_prefix: "{{ resource_prefix | default('cs-') }}"
- roles:
- - { role: test_cs_user, tags: test_cs_user }
- - { role: test_cs_project, tags: test_cs_project }
- - { role: test_cs_iso, tags: test_cs_iso }
- - { role: test_cs_domain, tags: test_cs_domain }
- - { role: test_cs_vmsnapshot, tags: test_cs_vmsnapshot }
- - { role: test_cs_sshkeypair, tags: test_cs_sshkeypair }
- - { role: test_cs_affinitygroup, tags: test_cs_affinitygroup }
- - { role: test_cs_securitygroup, tags: test_cs_securitygroup }
- - { role: test_cs_securitygroup_rule, tags: test_cs_securitygroup_rule }
- - { role: test_cs_instance, tags: test_cs_instance }
- - { role: test_cs_instancegroup, tags: test_cs_instancegroup }
- - { role: test_cs_portforward, tags: test_cs_portforward }
- - { role: test_cs_account, tags: test_cs_account }
- - { role: test_cs_firewall, tags: test_cs_firewall }
- - { role: test_cs_loadbalancer_rule, tags: test_cs_loadbalancer_rule }
- - { role: test_cs_volume, tags: test_cs_volume }
- - { role: test_cs_instance_facts, tags: test_cs_instance_facts }
- - { role: test_cs_configuration, tags: test_cs_configuration }
- - { role: test_cs_pod, tags: test_cs_pod }
- - { role: test_cs_cluster, tags: test_cs_cluster }
- - { role: test_cs_resourcelimit, tags: test_cs_resourcelimit }
diff --git a/test/integration/roles/test_cs_common/defaults/main.yml b/test/integration/roles/test_cs_common/defaults/main.yml
deleted file mode 100644
index ba9674ac92..0000000000
--- a/test/integration/roles/test_cs_common/defaults/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-cs_resource_prefix: cloudstack
diff --git a/test/integration/roles/test_cs_configuration/defaults/main.yml b/test/integration/roles/test_cs_configuration/defaults/main.yml
deleted file mode 100644
index 2c68b5099a..0000000000
--- a/test/integration/roles/test_cs_configuration/defaults/main.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-test_cs_configuration_storage: PS0
-test_cs_configuration_cluster: C0
-test_cs_configuration_account: admin
-test_cs_configuration_zone: Sandbox-simulator
diff --git a/test/integration/roles/test_cs_configuration/meta/main.yml b/test/integration/roles/test_cs_configuration/meta/main.yml
deleted file mode 100644
index 03e38bd4f7..0000000000
--- a/test/integration/roles/test_cs_configuration/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - test_cs_common
diff --git a/test/integration/roles/test_cs_firewall/meta/main.yml b/test/integration/roles/test_cs_firewall/meta/main.yml
deleted file mode 100644
index 03e38bd4f7..0000000000
--- a/test/integration/roles/test_cs_firewall/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - test_cs_common
diff --git a/test/integration/roles/test_cs_instance/meta/main.yml b/test/integration/roles/test_cs_instance/meta/main.yml
deleted file mode 100644
index 03e38bd4f7..0000000000
--- a/test/integration/roles/test_cs_instance/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - test_cs_common
diff --git a/test/integration/roles/test_cs_instance_facts/defaults/main.yml b/test/integration/roles/test_cs_instance_facts/defaults/main.yml
deleted file mode 100644
index e393e60f4f..0000000000
--- a/test/integration/roles/test_cs_instance_facts/defaults/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
-test_cs_instance_offering_1: Small Instance
diff --git a/test/integration/roles/test_cs_instance_facts/meta/main.yml b/test/integration/roles/test_cs_instance_facts/meta/main.yml
deleted file mode 100644
index 03e38bd4f7..0000000000
--- a/test/integration/roles/test_cs_instance_facts/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - test_cs_common
diff --git a/test/integration/roles/test_cs_iso/meta/main.yml b/test/integration/roles/test_cs_iso/meta/main.yml
deleted file mode 100644
index 03e38bd4f7..0000000000
--- a/test/integration/roles/test_cs_iso/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - test_cs_common
diff --git a/test/integration/roles/test_cs_loadbalancer_rule/defaults/main.yml b/test/integration/roles/test_cs_loadbalancer_rule/defaults/main.yml
deleted file mode 100644
index 5663384641..0000000000
--- a/test/integration/roles/test_cs_loadbalancer_rule/defaults/main.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-test_cs_lb_public_ip: "1.2.3.4"
-test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
-test_cs_instance_offering_1: Small Instance
-test_cs_lb_member: "{{ cs_resource_prefix }}_member1"
diff --git a/test/integration/roles/test_cs_loadbalancer_rule/meta/main.yml b/test/integration/roles/test_cs_loadbalancer_rule/meta/main.yml
deleted file mode 100644
index 03e38bd4f7..0000000000
--- a/test/integration/roles/test_cs_loadbalancer_rule/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - test_cs_common
diff --git a/test/integration/roles/test_cs_pod/meta/main.yml b/test/integration/roles/test_cs_pod/meta/main.yml
deleted file mode 100644
index 03e38bd4f7..0000000000
--- a/test/integration/roles/test_cs_pod/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - test_cs_common
diff --git a/test/integration/roles/test_cs_portforward/defaults/main.yml b/test/integration/roles/test_cs_portforward/defaults/main.yml
deleted file mode 100644
index f4083ed220..0000000000
--- a/test/integration/roles/test_cs_portforward/defaults/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-cs_portforward_public_ip: "10.100.212.5"
-cs_portforward_vm: "{{ cs_resource_prefix }}-vm"
diff --git a/test/integration/roles/test_cs_portforward/meta/main.yml b/test/integration/roles/test_cs_portforward/meta/main.yml
deleted file mode 100644
index 03e38bd4f7..0000000000
--- a/test/integration/roles/test_cs_portforward/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - test_cs_common
diff --git a/test/integration/roles/test_cs_vmsnapshot/defaults/main.yml b/test/integration/roles/test_cs_vmsnapshot/defaults/main.yml
deleted file mode 100644
index e393e60f4f..0000000000
--- a/test/integration/roles/test_cs_vmsnapshot/defaults/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
-test_cs_instance_offering_1: Small Instance
diff --git a/test/integration/roles/test_cs_vmsnapshot/meta/main.yml b/test/integration/roles/test_cs_vmsnapshot/meta/main.yml
deleted file mode 100644
index 03e38bd4f7..0000000000
--- a/test/integration/roles/test_cs_vmsnapshot/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - test_cs_common
diff --git a/test/integration/roles/test_cs_volume/meta/main.yml b/test/integration/roles/test_cs_volume/meta/main.yml
deleted file mode 100644
index 03e38bd4f7..0000000000
--- a/test/integration/roles/test_cs_volume/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - test_cs_common
diff --git a/test/integration/targets/cs_account/meta/main.yml b/test/integration/targets/cs_account/meta/main.yml
index 03e38bd4f7..e9a5b9eeae 100644
--- a/test/integration/targets/cs_account/meta/main.yml
+++ b/test/integration/targets/cs_account/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies:
- - test_cs_common
+ - cs_common
diff --git a/test/integration/targets/cs_account/tasks/main.yml b/test/integration/targets/cs_account/tasks/main.yml
index 0061c66639..c23f213b8f 100644
--- a/test/integration/targets/cs_account/tasks/main.yml
+++ b/test/integration/targets/cs_account/tasks/main.yml
@@ -36,7 +36,7 @@
last_name: "{{ cs_resource_prefix }}_last_name"
first_name: "{{ cs_resource_prefix }}_first_name"
email: "{{ cs_resource_prefix }}@example.com"
- network_domain: "{{ cs_resource_prefix }}.local"
+ network_domain: "example.com"
register: acc
- name: verify results of create account
assert:
@@ -44,7 +44,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "enabled"
- acc.domain == "ROOT"
@@ -57,7 +57,7 @@
last_name: "{{ cs_resource_prefix }}_last_name"
first_name: "{{ cs_resource_prefix }}_first_name"
email: "{{ cs_resource_prefix }}@example.com"
- network_domain: "{{ cs_resource_prefix }}.local"
+ network_domain: "example.com"
register: acc
- name: verify results of create account idempotence
assert:
@@ -65,7 +65,7 @@
- acc|success
- not acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "enabled"
- acc.domain == "ROOT"
@@ -81,7 +81,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "locked"
- acc.domain == "ROOT"
@@ -97,7 +97,7 @@
- acc|success
- not acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "locked"
- acc.domain == "ROOT"
@@ -113,7 +113,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "disabled"
- acc.domain == "ROOT"
@@ -129,7 +129,7 @@
- acc|success
- not acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "disabled"
- acc.domain == "ROOT"
@@ -145,7 +145,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "locked"
- acc.domain == "ROOT"
@@ -161,7 +161,7 @@
- acc|success
- not acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "locked"
- acc.domain == "ROOT"
@@ -177,7 +177,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "enabled"
- acc.domain == "ROOT"
@@ -193,7 +193,7 @@
- acc|success
- not acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "enabled"
- acc.domain == "ROOT"
@@ -209,7 +209,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "enabled"
- acc.domain == "ROOT"
@@ -233,7 +233,7 @@
last_name: "{{ cs_resource_prefix }}_last_name"
first_name: "{{ cs_resource_prefix }}_first_name"
email: "{{ cs_resource_prefix }}@example.com"
- network_domain: "{{ cs_resource_prefix }}.local"
+ network_domain: "example.com"
state: disabled
register: acc
- name: verify results of create disabled account
@@ -242,7 +242,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "disabled"
- acc.domain == "ROOT"
@@ -258,7 +258,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "disabled"
- acc.domain == "ROOT"
@@ -271,7 +271,7 @@
last_name: "{{ cs_resource_prefix }}_last_name"
first_name: "{{ cs_resource_prefix }}_first_name"
email: "{{ cs_resource_prefix }}@example.com"
- network_domain: "{{ cs_resource_prefix }}.local"
+ network_domain: "example.com"
state: locked
register: acc
- name: verify results of create locked account
@@ -280,7 +280,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "locked"
- acc.domain == "ROOT"
@@ -296,7 +296,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "locked"
- acc.domain == "ROOT"
@@ -309,7 +309,7 @@
last_name: "{{ cs_resource_prefix }}_last_name"
first_name: "{{ cs_resource_prefix }}_first_name"
email: "{{ cs_resource_prefix }}@example.com"
- network_domain: "{{ cs_resource_prefix }}.local"
+ network_domain: "example.com"
state: unlocked
register: acc
- name: verify results of create unlocked/enabled account
@@ -318,7 +318,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "enabled"
- acc.domain == "ROOT"
@@ -334,7 +334,7 @@
- acc|success
- acc|changed
- acc.name == "{{ cs_resource_prefix }}_user"
- - acc.network_domain == "{{ cs_resource_prefix }}.local"
+ - acc.network_domain == "example.com"
- acc.account_type == "user"
- acc.state == "enabled"
- acc.domain == "ROOT"
diff --git a/test/integration/targets/cs_affinitygroup/meta/main.yml b/test/integration/targets/cs_affinitygroup/meta/main.yml
index 03e38bd4f7..e9a5b9eeae 100644
--- a/test/integration/targets/cs_affinitygroup/meta/main.yml
+++ b/test/integration/targets/cs_affinitygroup/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies:
- - test_cs_common
+ - cs_common
diff --git a/test/integration/targets/cs_cluster/meta/main.yml b/test/integration/targets/cs_cluster/meta/main.yml
index 03e38bd4f7..e9a5b9eeae 100644
--- a/test/integration/targets/cs_cluster/meta/main.yml
+++ b/test/integration/targets/cs_cluster/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies:
- - test_cs_common
+ - cs_common
diff --git a/test/integration/targets/test_cs_common/aliases b/test/integration/targets/cs_common/aliases
index 136c05e0d0..136c05e0d0 100644
--- a/test/integration/targets/test_cs_common/aliases
+++ b/test/integration/targets/cs_common/aliases
diff --git a/test/integration/targets/cs_common/defaults/main.yml b/test/integration/targets/cs_common/defaults/main.yml
new file mode 100644
index 0000000000..9d59c81c16
--- /dev/null
+++ b/test/integration/targets/cs_common/defaults/main.yml
@@ -0,0 +1,5 @@
+---
+cs_resource_prefix: "cs-{{ (ansible_date_time.iso8601_micro | to_uuid).split('-')[0] }}"
+cs_common_template: CentOS 5.6 (64-bit) no GUI (Simulator)
+cs_common_service_offering: Small Instance
+cs_common_zone_adv: Sandbox-simulator-advanced
diff --git a/test/integration/targets/cs_configuration/aliases b/test/integration/targets/cs_configuration/aliases
new file mode 100644
index 0000000000..ff33c0bb61
--- /dev/null
+++ b/test/integration/targets/cs_configuration/aliases
@@ -0,0 +1,3 @@
+cloud/cs
+posix/ci/cloud/cs
+skip/python3
diff --git a/test/integration/targets/cs_configuration/defaults/main.yml b/test/integration/targets/cs_configuration/defaults/main.yml
new file mode 100644
index 0000000000..3cf304cad0
--- /dev/null
+++ b/test/integration/targets/cs_configuration/defaults/main.yml
@@ -0,0 +1,5 @@
+---
+test_cs_configuration_storage: PS0-adv
+test_cs_configuration_cluster: C0-basic
+test_cs_configuration_account: admin
+test_cs_configuration_zone: Sandbox-simulator-basic
diff --git a/test/integration/targets/cs_configuration/meta/main.yml b/test/integration/targets/cs_configuration/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_configuration/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/roles/test_cs_configuration/tasks/account.yml b/test/integration/targets/cs_configuration/tasks/account.yml
index 853fbf81a3..853fbf81a3 100644
--- a/test/integration/roles/test_cs_configuration/tasks/account.yml
+++ b/test/integration/targets/cs_configuration/tasks/account.yml
diff --git a/test/integration/roles/test_cs_configuration/tasks/cluster.yml b/test/integration/targets/cs_configuration/tasks/cluster.yml
index c3328e41d8..c3328e41d8 100644
--- a/test/integration/roles/test_cs_configuration/tasks/cluster.yml
+++ b/test/integration/targets/cs_configuration/tasks/cluster.yml
diff --git a/test/integration/roles/test_cs_configuration/tasks/main.yml b/test/integration/targets/cs_configuration/tasks/main.yml
index 5fdba11680..5fdba11680 100644
--- a/test/integration/roles/test_cs_configuration/tasks/main.yml
+++ b/test/integration/targets/cs_configuration/tasks/main.yml
diff --git a/test/integration/roles/test_cs_configuration/tasks/storage.yml b/test/integration/targets/cs_configuration/tasks/storage.yml
index 8201bae057..8201bae057 100644
--- a/test/integration/roles/test_cs_configuration/tasks/storage.yml
+++ b/test/integration/targets/cs_configuration/tasks/storage.yml
diff --git a/test/integration/roles/test_cs_configuration/tasks/zone.yml b/test/integration/targets/cs_configuration/tasks/zone.yml
index 423f885c7c..423f885c7c 100644
--- a/test/integration/roles/test_cs_configuration/tasks/zone.yml
+++ b/test/integration/targets/cs_configuration/tasks/zone.yml
diff --git a/test/integration/targets/cs_domain/meta/main.yml b/test/integration/targets/cs_domain/meta/main.yml
index 03e38bd4f7..e9a5b9eeae 100644
--- a/test/integration/targets/cs_domain/meta/main.yml
+++ b/test/integration/targets/cs_domain/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies:
- - test_cs_common
+ - cs_common
diff --git a/test/integration/targets/cs_firewall/aliases b/test/integration/targets/cs_firewall/aliases
new file mode 100644
index 0000000000..ff33c0bb61
--- /dev/null
+++ b/test/integration/targets/cs_firewall/aliases
@@ -0,0 +1,3 @@
+cloud/cs
+posix/ci/cloud/cs
+skip/python3
diff --git a/test/integration/roles/test_cs_firewall/defaults/main.yml b/test/integration/targets/cs_firewall/defaults/main.yml
index 4aa4fe846f..f5999305c9 100644
--- a/test/integration/roles/test_cs_firewall/defaults/main.yml
+++ b/test/integration/targets/cs_firewall/defaults/main.yml
@@ -1,3 +1,3 @@
---
cs_firewall_ip_address: 10.100.212.5
-cs_firewall_network: test
+cs_firewall_network: ansible test
diff --git a/test/integration/targets/cs_firewall/meta/main.yml b/test/integration/targets/cs_firewall/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_firewall/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/roles/test_cs_firewall/tasks/main.yml b/test/integration/targets/cs_firewall/tasks/main.yml
index 5482ce4497..7e47ba5e82 100644
--- a/test/integration/roles/test_cs_firewall/tasks/main.yml
+++ b/test/integration/targets/cs_firewall/tasks/main.yml
@@ -1,8 +1,35 @@
---
+- name: network setup
+ cs_network:
+ name: "{{ cs_firewall_network }}"
+ network_offering: DefaultIsolatedNetworkOfferingWithSourceNatService
+ network_domain: example.com
+ zone: "{{ cs_common_zone_adv }}"
+ register: net
+- name: verify network setup
+ assert:
+ that:
+ - net|success
+
+- name: public ip address setup
+ cs_ip_address:
+ network: ansible test
+ zone: "{{ cs_common_zone_adv }}"
+ register: ip_address
+- name: verify public ip address setup
+ assert:
+ that:
+ - ip_address|success
+
+- name: set ip address as fact
+ set_fact:
+ cs_firewall_ip_address: "{{ ip_address.ip_address }}"
+
- name: setup 80
cs_firewall:
port: 80
ip_address: "{{ cs_firewall_ip_address }}"
+ zone: "{{ cs_common_zone_adv }}"
state: absent
register: fw
- name: verify setup
@@ -17,6 +44,7 @@
start_port: 5300
end_port: 5333
cidr: 1.2.3.4/24
+ zone: "{{ cs_common_zone_adv }}"
state: absent
register: fw
- name: verify setup
@@ -29,6 +57,7 @@
network: "{{ cs_firewall_network }}"
protocol: all
type: egress
+ zone: "{{ cs_common_zone_adv }}"
state: absent
register: fw
- name: verify setup
@@ -44,34 +73,37 @@
assert:
that:
- fw|failed
- - fw.msg == "missing required argument for protocol 'tcp': start_port or end_port"
+ - "fw.msg == 'one of the following is required: ip_address,network'"
-- name: test fail if missing params ip_address ingress
+- name: test fail if missing params
cs_firewall:
- port: 80
+ ip_address: "{{ cs_firewall_ip_address }}"
+ zone: "{{ cs_common_zone_adv }}"
register: fw
ignore_errors: true
-- name: verify results of fail if missing params ip_address
+- name: verify results of fail if missing params
assert:
that:
- fw|failed
- - fw.msg == "missing required argument for type ingress: ip_address"
+ - "fw.msg == \"missing required argument for protocol 'tcp': start_port or end_port\""
- name: test fail if missing params network egress
cs_firewall:
type: egress
+ zone: "{{ cs_common_zone_adv }}"
register: fw
ignore_errors: true
- name: verify results of fail if missing params ip_address
assert:
that:
- fw|failed
- - fw.msg == "missing required argument for type egress: network"
+ - "fw.msg == 'one of the following is required: ip_address,network'"
- name: test present firewall rule ingress 80
cs_firewall:
port: 80
ip_address: "{{ cs_firewall_ip_address }}"
+ zone: "{{ cs_common_zone_adv }}"
register: fw
- name: verify results of present firewall rule ingress 80
assert:
@@ -89,6 +121,7 @@
cs_firewall:
port: 80
ip_address: "{{ cs_firewall_ip_address }}"
+ zone: "{{ cs_common_zone_adv }}"
register: fw
- name: verify results of present firewall rule ingress 80 idempotence
assert:
@@ -109,6 +142,7 @@
start_port: 5300
end_port: 5333
cidr: 1.2.3.4/24
+ zone: "{{ cs_common_zone_adv }}"
register: fw
- name: verify results of present firewall rule ingress 5300
assert:
@@ -129,6 +163,7 @@
start_port: 5300
end_port: 5333
cidr: 1.2.3.4/24
+ zone: "{{ cs_common_zone_adv }}"
register: fw
- name: verify results of present firewall rule ingress 5300 idempotence
assert:
@@ -147,6 +182,7 @@
network: "{{ cs_firewall_network }}"
protocol: all
type: egress
+ zone: "{{ cs_common_zone_adv }}"
register: fw
- name: verify results of present firewall rule egress all
assert:
@@ -163,6 +199,7 @@
network: "{{ cs_firewall_network }}"
protocol: all
type: egress
+ zone: "{{ cs_common_zone_adv }}"
register: fw
- name: verify results of present firewall rule egress all idempotence
assert:
@@ -178,6 +215,7 @@
cs_firewall:
port: 80
ip_address: "{{ cs_firewall_ip_address }}"
+ zone: "{{ cs_common_zone_adv }}"
state: absent
register: fw
- name: verify results of absent firewall rule ingress 80
@@ -196,6 +234,7 @@
cs_firewall:
port: 80
ip_address: "{{ cs_firewall_ip_address }}"
+ zone: "{{ cs_common_zone_adv }}"
state: absent
register: fw
- name: verify results of absent firewall rule ingress 80 idempotence
@@ -211,6 +250,7 @@
start_port: 5300
end_port: 5333
cidr: 1.2.3.4/24
+ zone: "{{ cs_common_zone_adv }}"
state: absent
register: fw
- name: verify results of absent firewall rule ingress 5300
@@ -232,6 +272,7 @@
start_port: 5300
end_port: 5333
cidr: 1.2.3.4/24
+ zone: "{{ cs_common_zone_adv }}"
state: absent
register: fw
- name: verify results of absent firewall rule ingress 5300 idempotence
@@ -246,6 +287,7 @@
protocol: all
type: egress
state: absent
+ zone: "{{ cs_common_zone_adv }}"
register: fw
- name: verify results of absent firewall rule egress all
assert:
@@ -262,6 +304,7 @@
network: "{{ cs_firewall_network }}"
protocol: all
type: egress
+ zone: "{{ cs_common_zone_adv }}"
state: absent
register: fw
- name: verify results of absent firewall rule egress all idempotence
@@ -269,3 +312,14 @@
that:
- fw|success
- not fw|changed
+
+- name: network cleanup
+ cs_network:
+ name: "{{ cs_firewall_network }}"
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: net
+- name: verify network cleanup
+ assert:
+ that:
+ - net|success
diff --git a/test/integration/targets/cs_instance/aliases b/test/integration/targets/cs_instance/aliases
new file mode 100644
index 0000000000..ff33c0bb61
--- /dev/null
+++ b/test/integration/targets/cs_instance/aliases
@@ -0,0 +1,3 @@
+cloud/cs
+posix/ci/cloud/cs
+skip/python3
diff --git a/test/integration/roles/test_cs_instance/defaults/main.yml b/test/integration/targets/cs_instance/defaults/main.yml
index bb2f5c9d82..4db5c7c9e3 100644
--- a/test/integration/roles/test_cs_instance/defaults/main.yml
+++ b/test/integration/targets/cs_instance/defaults/main.yml
@@ -1,5 +1,5 @@
---
instance_number: 1
-test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
+test_cs_instance_template: "{{ cs_common_template }}"
test_cs_instance_offering_1: Small Instance
test_cs_instance_offering_2: Medium Instance
diff --git a/test/integration/targets/cs_instance/meta/main.yml b/test/integration/targets/cs_instance/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_instance/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/roles/test_cs_instance/tasks/absent.yml b/test/integration/targets/cs_instance/tasks/absent.yml
index eeab47a61d..eeab47a61d 100644
--- a/test/integration/roles/test_cs_instance/tasks/absent.yml
+++ b/test/integration/targets/cs_instance/tasks/absent.yml
diff --git a/test/integration/roles/test_cs_instance/tasks/absent_display_name.yml b/test/integration/targets/cs_instance/tasks/absent_display_name.yml
index 35fa6dff34..35fa6dff34 100644
--- a/test/integration/roles/test_cs_instance/tasks/absent_display_name.yml
+++ b/test/integration/targets/cs_instance/tasks/absent_display_name.yml
diff --git a/test/integration/roles/test_cs_instance/tasks/cleanup.yml b/test/integration/targets/cs_instance/tasks/cleanup.yml
index e6b6550dfa..e6b6550dfa 100644
--- a/test/integration/roles/test_cs_instance/tasks/cleanup.yml
+++ b/test/integration/targets/cs_instance/tasks/cleanup.yml
diff --git a/test/integration/roles/test_cs_instance/tasks/main.yml b/test/integration/targets/cs_instance/tasks/main.yml
index d6475a4766..d6475a4766 100644
--- a/test/integration/roles/test_cs_instance/tasks/main.yml
+++ b/test/integration/targets/cs_instance/tasks/main.yml
diff --git a/test/integration/roles/test_cs_instance/tasks/present.yml b/test/integration/targets/cs_instance/tasks/present.yml
index ad3d391ef9..ad3d391ef9 100644
--- a/test/integration/roles/test_cs_instance/tasks/present.yml
+++ b/test/integration/targets/cs_instance/tasks/present.yml
diff --git a/test/integration/roles/test_cs_instance/tasks/present_display_name.yml b/test/integration/targets/cs_instance/tasks/present_display_name.yml
index c1882149d9..c1882149d9 100644
--- a/test/integration/roles/test_cs_instance/tasks/present_display_name.yml
+++ b/test/integration/targets/cs_instance/tasks/present_display_name.yml
diff --git a/test/integration/roles/test_cs_instance/tasks/setup.yml b/test/integration/targets/cs_instance/tasks/setup.yml
index 0039ce8f1b..0039ce8f1b 100644
--- a/test/integration/roles/test_cs_instance/tasks/setup.yml
+++ b/test/integration/targets/cs_instance/tasks/setup.yml
diff --git a/test/integration/roles/test_cs_instance/tasks/tags.yml b/test/integration/targets/cs_instance/tasks/tags.yml
index 50836384b2..50836384b2 100644
--- a/test/integration/roles/test_cs_instance/tasks/tags.yml
+++ b/test/integration/targets/cs_instance/tasks/tags.yml
diff --git a/test/integration/targets/cs_instance_facts/aliases b/test/integration/targets/cs_instance_facts/aliases
new file mode 100644
index 0000000000..ff33c0bb61
--- /dev/null
+++ b/test/integration/targets/cs_instance_facts/aliases
@@ -0,0 +1,3 @@
+cloud/cs
+posix/ci/cloud/cs
+skip/python3
diff --git a/test/integration/targets/cs_instance_facts/defaults/main.yml b/test/integration/targets/cs_instance_facts/defaults/main.yml
new file mode 100644
index 0000000000..490c6c14e2
--- /dev/null
+++ b/test/integration/targets/cs_instance_facts/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+test_cs_instance_template: "{{ cs_common_template }}"
+test_cs_instance_offering_1: Small Instance
diff --git a/test/integration/targets/cs_instance_facts/meta/main.yml b/test/integration/targets/cs_instance_facts/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_instance_facts/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/roles/test_cs_instance_facts/tasks/main.yml b/test/integration/targets/cs_instance_facts/tasks/main.yml
index af35712aa5..af35712aa5 100644
--- a/test/integration/roles/test_cs_instance_facts/tasks/main.yml
+++ b/test/integration/targets/cs_instance_facts/tasks/main.yml
diff --git a/test/integration/targets/cs_instancegroup/meta/main.yml b/test/integration/targets/cs_instancegroup/meta/main.yml
index 03e38bd4f7..e9a5b9eeae 100644
--- a/test/integration/targets/cs_instancegroup/meta/main.yml
+++ b/test/integration/targets/cs_instancegroup/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies:
- - test_cs_common
+ - cs_common
diff --git a/test/integration/targets/cs_iso/aliases b/test/integration/targets/cs_iso/aliases
new file mode 100644
index 0000000000..ff33c0bb61
--- /dev/null
+++ b/test/integration/targets/cs_iso/aliases
@@ -0,0 +1,3 @@
+cloud/cs
+posix/ci/cloud/cs
+skip/python3
diff --git a/test/integration/targets/cs_iso/meta/main.yml b/test/integration/targets/cs_iso/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_iso/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/roles/test_cs_iso/tasks/main.yml b/test/integration/targets/cs_iso/tasks/main.yml
index d554316f52..d554316f52 100644
--- a/test/integration/roles/test_cs_iso/tasks/main.yml
+++ b/test/integration/targets/cs_iso/tasks/main.yml
diff --git a/test/integration/targets/cs_loadbalancer_rule/aliases b/test/integration/targets/cs_loadbalancer_rule/aliases
new file mode 100644
index 0000000000..ff33c0bb61
--- /dev/null
+++ b/test/integration/targets/cs_loadbalancer_rule/aliases
@@ -0,0 +1,3 @@
+cloud/cs
+posix/ci/cloud/cs
+skip/python3
diff --git a/test/integration/targets/cs_loadbalancer_rule/meta/main.yml b/test/integration/targets/cs_loadbalancer_rule/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_loadbalancer_rule/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/roles/test_cs_loadbalancer_rule/tasks/main.yml b/test/integration/targets/cs_loadbalancer_rule/tasks/main.yml
index 030643615a..9ae186c109 100644
--- a/test/integration/roles/test_cs_loadbalancer_rule/tasks/main.yml
+++ b/test/integration/targets/cs_loadbalancer_rule/tasks/main.yml
@@ -1,25 +1,53 @@
---
-- name: setup
- cs_loadbalancer_rule:
- name: "{{ cs_resource_prefix }}_lb"
- public_ip: "{{ test_cs_lb_public_ip }}"
- state: absent
- register: lb
-- name: verify setup
+- name: test create network for lb
+ cs_network:
+ name: "{{ cs_resource_prefix }}_net_lb"
+ zone: "{{ cs_common_zone_adv }}"
+ network_offering: Offering for Isolated networks with Source Nat service enabled
+ register: lb_net
+- name: verify test create network for lb
assert:
that:
- - lb|success
+ - lb_net|success
+ - lb_net|changed
+ - lb_net.name == "{{ cs_resource_prefix }}_net_lb"
-- name: setup instance
+- name: setup instance in lb
cs_instance:
- name: "{{ test_cs_lb_member }}"
- template: "{{ test_cs_instance_template }}"
- service_offering: "{{ test_cs_instance_offering_1 }}"
+ name: "{{ cs_resource_prefix }}-vm-lb"
+ template: "{{ cs_common_template }}"
+ service_offering: "{{ cs_common_service_offering }}"
+ zone: "{{ cs_common_zone_adv }}"
+ network: "{{ cs_resource_prefix }}_net_lb"
register: instance
-- name: verify create instance
+- name: verify setup instance in lb
assert:
that:
- instance|success
+ - instance|changed
+ - instance.name == "{{ cs_resource_prefix }}-vm-lb"
+ - instance.state == "Running"
+
+- name: setup get ip address for lb
+ cs_ip_address:
+ network: "{{ cs_resource_prefix }}_net_lb"
+ zone: "{{ cs_common_zone_adv }}"
+ register: ip_address
+- name: verify setup instance in lb
+ assert:
+ that:
+ - ip_address|success
+
+- name: setup lb rule absent
+ cs_loadbalancer_rule:
+ name: "{{ cs_resource_prefix }}_lb"
+ public_ip: "{{ ip_address.ip_address }}"
+ state: absent
+ register: lb
+- name: verify setup lb rule absent
+ assert:
+ that:
+ - lb|success
- name: test rule requires params
cs_loadbalancer_rule:
@@ -34,7 +62,7 @@
- name: test create rule
cs_loadbalancer_rule:
name: "{{ cs_resource_prefix }}_lb"
- public_ip: "{{ test_cs_lb_public_ip }}"
+ public_ip: "{{ ip_address.ip_address }}"
algorithm: roundrobin
public_port: 80
private_port: 8080
@@ -46,33 +74,33 @@
- lb|changed
- lb.name == "{{ cs_resource_prefix }}_lb"
- lb.algorithm == "roundrobin"
- - lb.public_ip == "{{ test_cs_lb_public_ip }}"
+ - lb.public_ip == "{{ ip_address.ip_address }}"
- lb.public_port == 80
- lb.private_port == 8080
- name: test create rule idempotence
cs_loadbalancer_rule:
name: "{{ cs_resource_prefix }}_lb"
- public_ip: "{{ test_cs_lb_public_ip }}"
+ public_ip: "{{ ip_address.ip_address }}"
algorithm: roundrobin
public_port: 80
private_port: 8080
register: lb
-- name: verify test create rule idempotence
+- name: verify test create rule idempotence
assert:
that:
- lb|success
- not lb|changed
- lb.name == "{{ cs_resource_prefix }}_lb"
- lb.algorithm == "roundrobin"
- - lb.public_ip == "{{ test_cs_lb_public_ip }}"
+ - lb.public_ip == "{{ ip_address.ip_address }}"
- lb.public_port == 80
- lb.private_port == 8080
- name: test update rule
cs_loadbalancer_rule:
name: "{{ cs_resource_prefix }}_lb"
- public_ip: "{{ test_cs_lb_public_ip }}"
+ public_ip: "{{ ip_address.ip_address }}"
algorithm: source
public_port: 80
private_port: 8080
@@ -84,14 +112,14 @@
- lb|changed
- lb.name == "{{ cs_resource_prefix }}_lb"
- lb.algorithm == "source"
- - lb.public_ip == "{{ test_cs_lb_public_ip }}"
+ - lb.public_ip == "{{ ip_address.ip_address }}"
- lb.public_port == 80
- lb.private_port == 8080
- name: test update rule idempotence
cs_loadbalancer_rule:
name: "{{ cs_resource_prefix }}_lb"
- public_ip: "{{ test_cs_lb_public_ip }}"
+ public_ip: "{{ ip_address.ip_address }}"
algorithm: source
public_port: 80
private_port: 8080
@@ -103,7 +131,7 @@
- not lb|changed
- lb.name == "{{ cs_resource_prefix }}_lb"
- lb.algorithm == "source"
- - lb.public_ip == "{{ test_cs_lb_public_ip }}"
+ - lb.public_ip == "{{ ip_address.ip_address }}"
- lb.public_port == 80
- lb.private_port == 8080
@@ -120,7 +148,7 @@
- name: test add members to rule
cs_loadbalancer_rule_member:
name: "{{ cs_resource_prefix }}_lb"
- vm: "{{ test_cs_lb_member }}"
+ vm: "{{ cs_resource_prefix }}-vm-lb"
register: lb
- name: verify add members to rule
assert:
@@ -129,15 +157,15 @@
- lb|changed
- lb.name == "{{ cs_resource_prefix }}_lb"
- lb.algorithm == "source"
- - lb.public_ip == "{{ test_cs_lb_public_ip }}"
+ - lb.public_ip == "{{ ip_address.ip_address }}"
- lb.public_port == 80
- lb.private_port == 8080
- - "'{{ test_cs_lb_member }}' in lb.vms"
+ - "'{{ cs_resource_prefix }}-vm-lb' in lb.vms"
- name: test add members to rule idempotence
cs_loadbalancer_rule_member:
name: "{{ cs_resource_prefix }}_lb"
- vm: "{{ test_cs_lb_member }}"
+ vm: "{{ cs_resource_prefix }}-vm-lb"
register: lb
- name: verify add members to rule idempotence
assert:
@@ -146,15 +174,15 @@
- not lb|changed
- lb.name == "{{ cs_resource_prefix }}_lb"
- lb.algorithm == "source"
- - lb.public_ip == "{{ test_cs_lb_public_ip }}"
+ - lb.public_ip == "{{ ip_address.ip_address }}"
- lb.public_port == 80
- lb.private_port == 8080
- - "'{{ test_cs_lb_member }}' in lb.vms"
+ - "'{{ cs_resource_prefix }}-vm-lb' in lb.vms"
- name: test remove members to rule
cs_loadbalancer_rule_member:
name: "{{ cs_resource_prefix }}_lb"
- vm: "{{ test_cs_lb_member }}"
+ vm: "{{ cs_resource_prefix }}-vm-lb"
state: absent
register: lb
- name: verify remove members to rule
@@ -164,15 +192,15 @@
- lb|changed
- lb.name == "{{ cs_resource_prefix }}_lb"
- lb.algorithm == "source"
- - lb.public_ip == "{{ test_cs_lb_public_ip }}"
+ - lb.public_ip == "{{ ip_address.ip_address }}"
- lb.public_port == 80
- lb.private_port == 8080
- - "'{{ test_cs_lb_member }}' not in lb.vms"
+ - "'{{ cs_resource_prefix }}-vm-lb' not in lb.vms"
- name: test remove members to rule idempotence
cs_loadbalancer_rule_member:
name: "{{ cs_resource_prefix }}_lb"
- vm: "{{ test_cs_lb_member }}"
+ vm: "{{ cs_resource_prefix }}-vm-lb"
state: absent
register: lb
- name: verify remove members to rule
@@ -184,7 +212,7 @@
- name: test remove rule
cs_loadbalancer_rule:
name: "{{ cs_resource_prefix }}_lb"
- public_ip: "{{ test_cs_lb_public_ip }}"
+ public_ip: "{{ ip_address.ip_address }}"
state: absent
register: lb
- name: verify remove rule
@@ -194,14 +222,14 @@
- lb|changed
- lb.name == "{{ cs_resource_prefix }}_lb"
- lb.algorithm == "source"
- - lb.public_ip == "{{ test_cs_lb_public_ip }}"
+ - lb.public_ip == "{{ ip_address.ip_address }}"
- lb.public_port == 80
- lb.private_port == 8080
- name: test remove rule idempotence
cs_loadbalancer_rule:
name: "{{ cs_resource_prefix }}_lb"
- public_ip: "{{ test_cs_lb_public_ip }}"
+ public_ip: "{{ ip_address.ip_address }}"
state: absent
register: lb
- name: verify remove rule idempotence
diff --git a/test/integration/targets/cs_pod/aliases b/test/integration/targets/cs_pod/aliases
new file mode 100644
index 0000000000..ff33c0bb61
--- /dev/null
+++ b/test/integration/targets/cs_pod/aliases
@@ -0,0 +1,3 @@
+cloud/cs
+posix/ci/cloud/cs
+skip/python3
diff --git a/test/integration/targets/cs_pod/meta/main.yml b/test/integration/targets/cs_pod/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_pod/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/roles/test_cs_pod/tasks/main.yml b/test/integration/targets/cs_pod/tasks/main.yml
index 6f84eb783b..4440b1cbfd 100644
--- a/test/integration/roles/test_cs_pod/tasks/main.yml
+++ b/test/integration/targets/cs_pod/tasks/main.yml
@@ -1,14 +1,4 @@
---
-- name: setup pod is absent
- cs_pod:
- name: "{{ cs_resource_prefix }}-pod"
- state: absent
- register: pod
-- name: verify setup pod is absent
- assert:
- that:
- - pod|success
-
- name: setup zone is present
cs_zone:
name: "{{ cs_resource_prefix }}-zone"
@@ -21,6 +11,17 @@
that:
- zone|success
+- name: setup pod is absent
+ cs_pod:
+ name: "{{ cs_resource_prefix }}-pod"
+ zone: "{{ cs_resource_prefix }}-zone"
+ state: absent
+ register: pod
+- name: verify setup pod is absent
+ assert:
+ that:
+ - pod|success
+
- name: test fail if missing name
cs_pod:
register: pod
diff --git a/test/integration/targets/cs_portforward/aliases b/test/integration/targets/cs_portforward/aliases
new file mode 100644
index 0000000000..ff33c0bb61
--- /dev/null
+++ b/test/integration/targets/cs_portforward/aliases
@@ -0,0 +1,3 @@
+cloud/cs
+posix/ci/cloud/cs
+skip/python3
diff --git a/test/integration/targets/cs_portforward/defaults/main.yml b/test/integration/targets/cs_portforward/defaults/main.yml
new file mode 100644
index 0000000000..89842c5573
--- /dev/null
+++ b/test/integration/targets/cs_portforward/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+cs_portforward_public_ip: "10.100.212.5"
+cs_portforward_vm: "cs-{{ cs_resource_prefix }}-pf-vm"
diff --git a/test/integration/targets/cs_portforward/meta/main.yml b/test/integration/targets/cs_portforward/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_portforward/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/roles/test_cs_portforward/tasks/main.yml b/test/integration/targets/cs_portforward/tasks/main.yml
index 02326ec13b..19b3ed776d 100644
--- a/test/integration/roles/test_cs_portforward/tasks/main.yml
+++ b/test/integration/targets/cs_portforward/tasks/main.yml
@@ -1,12 +1,52 @@
---
-- name: setup
+- name: network setup
+ cs_network:
+ name: ansible test
+ network_offering: DefaultIsolatedNetworkOfferingWithSourceNatService
+ network_domain: example.com
+ zone: "{{ cs_common_zone_adv }}"
+ register: net
+- name: verify network setup
+ assert:
+ that:
+ - net|success
+
+- name: instance setup
+ cs_instance:
+ name: "{{ cs_portforward_vm }}"
+ template: "{{ cs_common_template }}"
+ service_offering: "{{ cs_common_service_offering }}"
+ zone: "{{ cs_common_zone_adv }}"
+ network: "ansible test"
+ register: instance
+- name: verify instance setup
+ assert:
+ that:
+ - instance|success
+
+- name: public ip address setup
+ cs_ip_address:
+ network: ansible test
+ zone: "{{ cs_common_zone_adv }}"
+ register: ip_address
+- name: verify public ip address setup
+ assert:
+ that:
+ - ip_address|success
+
+- name: set ip address as fact
+ set_fact:
+ cs_portforward_public_ip: "{{ ip_address.ip_address }}"
+
+- name: clear existing port forwarding
cs_portforward:
ip_address: "{{ cs_portforward_public_ip }}"
public_port: 80
private_port: 8080
state: absent
+ zone: "{{ cs_common_zone_adv }}"
register: pf
-- name: verify setup
+- name: verify clear existing port forwarding
assert:
that:
- pf|success
@@ -27,6 +67,7 @@
public_port: 80
vm: "{{ cs_portforward_vm }}"
private_port: 8080
+ zone: "{{ cs_common_zone_adv }}"
register: pf
- name: verify results of present port forwarding
assert:
@@ -46,6 +87,7 @@
public_port: 80
vm: "{{ cs_portforward_vm }}"
private_port: 8080
+ zone: "{{ cs_common_zone_adv }}"
register: pf
- name: verify results of present port forwarding idempotence
assert:
@@ -65,6 +107,7 @@
public_port: 80
vm: "{{ cs_portforward_vm }}"
private_port: 8888
+ zone: "{{ cs_common_zone_adv }}"
register: pf
- name: verify results of change port forwarding
assert:
@@ -84,6 +127,7 @@
public_port: 80
private_port: 8888
state: absent
+ zone: "{{ cs_common_zone_adv }}"
register: pf
- name: verify results of absent port forwarding
assert:
@@ -103,9 +147,32 @@
public_port: 80
private_port: 8888
state: absent
+ zone: "{{ cs_common_zone_adv }}"
register: pf
- name: verify results of absent port forwarding idempotence
assert:
that:
- pf|success
- not pf|changed
+
+- name: instance cleanup
+ cs_instance:
+ name: "{{ cs_portforward_vm }}"
+ zone: "{{ cs_common_zone_adv }}"
+ state: expunged
+ register: instance
+- name: verify instance cleanup
+ assert:
+ that:
+ - instance|success
+
+- name: network cleanup
+ cs_network:
+ name: ansible test
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: net
+- name: verify network cleanup
+ assert:
+ that:
+ - net|success
diff --git a/test/integration/targets/cs_project/meta/main.yml b/test/integration/targets/cs_project/meta/main.yml
index 03e38bd4f7..e9a5b9eeae 100644
--- a/test/integration/targets/cs_project/meta/main.yml
+++ b/test/integration/targets/cs_project/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies:
- - test_cs_common
+ - cs_common
diff --git a/test/integration/targets/cs_resourcelimit/meta/main.yml b/test/integration/targets/cs_resourcelimit/meta/main.yml
index 03e38bd4f7..e9a5b9eeae 100644
--- a/test/integration/targets/cs_resourcelimit/meta/main.yml
+++ b/test/integration/targets/cs_resourcelimit/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies:
- - test_cs_common
+ - cs_common
diff --git a/test/integration/targets/cs_securitygroup/meta/main.yml b/test/integration/targets/cs_securitygroup/meta/main.yml
index 03e38bd4f7..e9a5b9eeae 100644
--- a/test/integration/targets/cs_securitygroup/meta/main.yml
+++ b/test/integration/targets/cs_securitygroup/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies:
- - test_cs_common
+ - cs_common
diff --git a/test/integration/targets/cs_securitygroup_rule/meta/main.yml b/test/integration/targets/cs_securitygroup_rule/meta/main.yml
index 03e38bd4f7..e9a5b9eeae 100644
--- a/test/integration/targets/cs_securitygroup_rule/meta/main.yml
+++ b/test/integration/targets/cs_securitygroup_rule/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies:
- - test_cs_common
+ - cs_common
diff --git a/test/integration/targets/cs_sshkeypair/meta/main.yml b/test/integration/targets/cs_sshkeypair/meta/main.yml
index 03e38bd4f7..e9a5b9eeae 100644
--- a/test/integration/targets/cs_sshkeypair/meta/main.yml
+++ b/test/integration/targets/cs_sshkeypair/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies:
- - test_cs_common
+ - cs_common
diff --git a/test/integration/targets/cs_sshkeypair/tasks/main.yml b/test/integration/targets/cs_sshkeypair/tasks/main.yml
index 0d3f3f7546..f3d7d5296e 100644
--- a/test/integration/targets/cs_sshkeypair/tasks/main.yml
+++ b/test/integration/targets/cs_sshkeypair/tasks/main.yml
@@ -1,6 +1,10 @@
---
- name: setup cleanup
- cs_sshkeypair: name={{ cs_resource_prefix }}-sshkey state=absent
+ cs_sshkeypair: name=first-sshkey state=absent
+
+- name: setup cleanup
+ cs_sshkeypair: name=second-sshkey state=absent
+
- name: test fail on missing name
action: cs_sshkeypair
@@ -13,7 +17,8 @@
- "sshkey.msg == 'missing required arguments: name'"
- name: test ssh key creation
- cs_sshkeypair: name={{ cs_resource_prefix }}-sshkey
+ cs_sshkeypair:
+ name: "first-sshkey"
register: sshkey
- name: verify results of ssh key creation
assert:
@@ -22,10 +27,11 @@
- sshkey|changed
- sshkey.fingerprint is defined and sshkey.fingerprint != ""
- sshkey.private_key is defined and sshkey.private_key != ""
- - sshkey.name == "{{ cs_resource_prefix }}-sshkey"
+ - sshkey.name == "first-sshkey"
- name: test ssh key creation idempotence
- cs_sshkeypair: name={{ cs_resource_prefix }}-sshkey
+ cs_sshkeypair:
+ name: "first-sshkey"
register: sshkey2
- name: verify results of ssh key creation idempotence
assert:
@@ -34,12 +40,12 @@
- not sshkey2|changed
- sshkey2.fingerprint is defined and sshkey2.fingerprint == sshkey.fingerprint
- sshkey2.private_key is not defined
- - sshkey2.name == "{{ cs_resource_prefix }}-sshkey"
+ - sshkey2.name == "first-sshkey"
- name: test replace ssh public key
- cs_sshkeypair: |
- name={{ cs_resource_prefix }}-sshkey
- public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsTI7KJZ8tz/CwQIrSol41c6s3vzkGYCMI8o7P9Et48UG9eRoGaMaGYaTvBTj/VQrD7cfurI6Bn0HTT3FLK3OHOweyelm9rIiQ2hjkSl+2lIKWHu992GO58E5Gcy9yYW4sHGgGLNZkPBKrrj0w7lhmiHjPtVnf+2+7Ix1WOO2/HXPcAHhsX/AlyItDewIL4mr/BT83vq0202sPCiM2cFQJl+5WGwS1wYYK8d167cspsmdyX7OyAFCUB0vueuqjE8MFqJvyIJR9y8Lj9Ny71pSV5/QWrXUgELxMYOKSby3gHkxcIXgYBMFLl4DipRTO74OWQlRRaOlqXlOOQbikcY4T rene.moser@swisstxt.ch"
+ cs_sshkeypair:
+ name: "first-sshkey"
+ public_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsTI7KJZ8tz/CwQIrSol41c6s3vzkGYCMI8o7P9Et48UG9eRoGaMaGYaTvBTj/VQrD7cfurI6Bn0HTT3FLK3OHOweyelm9rIiQ2hjkSl+2lIKWHu992GO58E5Gcy9yYW4sHGgGLNZkPBKrrj0w7lhmiHjPtVnf+2+7Ix1WOO2/HXPcAHhsX/AlyItDewIL4mr/BT83vq0202sPCiM2cFQJl+5WGwS1wYYK8d167cspsmdyX7OyAFCUB0vueuqjE8MFqJvyIJR9y8Lj9Ny71pSV5/QWrXUgELxMYOKSby3gHkxcIXgYBMFLl4DipRTO74OWQlRRaOlqXlOOQbikcY4T rene.moser@swisstxt.ch"
register: sshkey3
- name: verify results of replace ssh public key
assert:
@@ -48,12 +54,12 @@
- sshkey3|changed
- sshkey3.fingerprint is defined and sshkey3.fingerprint != sshkey2.fingerprint
- sshkey3.private_key is not defined
- - sshkey3.name == "{{ cs_resource_prefix }}-sshkey"
+ - sshkey3.name == "first-sshkey"
- name: test replace ssh public key idempotence
- cs_sshkeypair: |
- name={{ cs_resource_prefix }}-sshkey
- public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsTI7KJZ8tz/CwQIrSol41c6s3vzkGYCMI8o7P9Et48UG9eRoGaMaGYaTvBTj/VQrD7cfurI6Bn0HTT3FLK3OHOweyelm9rIiQ2hjkSl+2lIKWHu992GO58E5Gcy9yYW4sHGgGLNZkPBKrrj0w7lhmiHjPtVnf+2+7Ix1WOO2/HXPcAHhsX/AlyItDewIL4mr/BT83vq0202sPCiM2cFQJl+5WGwS1wYYK8d167cspsmdyX7OyAFCUB0vueuqjE8MFqJvyIJR9y8Lj9Ny71pSV5/QWrXUgELxMYOKSby3gHkxcIXgYBMFLl4DipRTO74OWQlRRaOlqXlOOQbikcY4T rene.moser@swisstxt.ch"
+ cs_sshkeypair:
+ name: "first-sshkey"
+ public_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsTI7KJZ8tz/CwQIrSol41c6s3vzkGYCMI8o7P9Et48UG9eRoGaMaGYaTvBTj/VQrD7cfurI6Bn0HTT3FLK3OHOweyelm9rIiQ2hjkSl+2lIKWHu992GO58E5Gcy9yYW4sHGgGLNZkPBKrrj0w7lhmiHjPtVnf+2+7Ix1WOO2/HXPcAHhsX/AlyItDewIL4mr/BT83vq0202sPCiM2cFQJl+5WGwS1wYYK8d167cspsmdyX7OyAFCUB0vueuqjE8MFqJvyIJR9y8Lj9Ny71pSV5/QWrXUgELxMYOKSby3gHkxcIXgYBMFLl4DipRTO74OWQlRRaOlqXlOOQbikcY4T rene.moser@swisstxt.ch"
register: sshkey4
- name: verify results of ssh public key idempotence
assert:
@@ -62,10 +68,28 @@
- not sshkey4|changed
- sshkey4.fingerprint is defined and sshkey4.fingerprint == sshkey3.fingerprint
- sshkey4.private_key is not defined
- - sshkey4.name == "{{ cs_resource_prefix }}-sshkey"
+ - sshkey4.name == "first-sshkey"
+
+- name: setup ssh key with name "second-sshke"
+ cs_sshkeypair:
+ name: "second-sshkey"
+
+- name: test different but exisitng name but same ssh public key as first-sshkey
+ cs_sshkeypair:
+ name: "second-sshkey"
+ public_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsTI7KJZ8tz/CwQIrSol41c6s3vzkGYCMI8o7P9Et48UG9eRoGaMaGYaTvBTj/VQrD7cfurI6Bn0HTT3FLK3OHOweyelm9rIiQ2hjkSl+2lIKWHu992GO58E5Gcy9yYW4sHGgGLNZkPBKrrj0w7lhmiHjPtVnf+2+7Ix1WOO2/HXPcAHhsX/AlyItDewIL4mr/BT83vq0202sPCiM2cFQJl+5WGwS1wYYK8d167cspsmdyX7OyAFCUB0vueuqjE8MFqJvyIJR9y8Lj9Ny71pSV5/QWrXUgELxMYOKSby3gHkxcIXgYBMFLl4DipRTO74OWQlRRaOlqXlOOQbikcY4T rene.moser@swisstxt.ch"
+ register: sshkey
+- name: verify test different but exisitng name but same ssh public key as first-sshkey
+ assert:
+ that:
+ - sshkey|success
+ - sshkey|changed
+ - sshkey.fingerprint is defined and sshkey.fingerprint == sshkey4.fingerprint
+ - sshkey.private_key is not defined
+ - sshkey.name == "second-sshkey"
- name: test ssh key absent
- cs_sshkeypair: name={{ cs_resource_prefix }}-sshkey state=absent
+ cs_sshkeypair: name=second-sshkey state=absent
register: sshkey5
- name: verify result of key absent
assert:
@@ -74,10 +98,10 @@
- sshkey5|changed
- sshkey5.fingerprint is defined and sshkey5.fingerprint == sshkey3.fingerprint
- sshkey5.private_key is not defined
- - sshkey5.name == "{{ cs_resource_prefix }}-sshkey"
+ - sshkey5.name == "second-sshkey"
- name: test ssh key absent idempotence
- cs_sshkeypair: name={{ cs_resource_prefix }}-sshkey state=absent
+ cs_sshkeypair: name=second-sshkey state=absent
register: sshkey6
- name: verify result of ssh key absent idempotence
assert:
diff --git a/test/integration/targets/cs_user/meta/main.yml b/test/integration/targets/cs_user/meta/main.yml
index 03e38bd4f7..e9a5b9eeae 100644
--- a/test/integration/targets/cs_user/meta/main.yml
+++ b/test/integration/targets/cs_user/meta/main.yml
@@ -1,3 +1,3 @@
---
dependencies:
- - test_cs_common
+ - cs_common
diff --git a/test/integration/targets/cs_vmsnapshot/aliases b/test/integration/targets/cs_vmsnapshot/aliases
new file mode 100644
index 0000000000..ff33c0bb61
--- /dev/null
+++ b/test/integration/targets/cs_vmsnapshot/aliases
@@ -0,0 +1,3 @@
+cloud/cs
+posix/ci/cloud/cs
+skip/python3
diff --git a/test/integration/targets/cs_vmsnapshot/defaults/main.yml b/test/integration/targets/cs_vmsnapshot/defaults/main.yml
new file mode 100644
index 0000000000..490c6c14e2
--- /dev/null
+++ b/test/integration/targets/cs_vmsnapshot/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+test_cs_instance_template: "{{ cs_common_template }}"
+test_cs_instance_offering_1: Small Instance
diff --git a/test/integration/targets/cs_vmsnapshot/meta/main.yml b/test/integration/targets/cs_vmsnapshot/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_vmsnapshot/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/roles/test_cs_vmsnapshot/tasks/main.yml b/test/integration/targets/cs_vmsnapshot/tasks/main.yml
index 5d80bf0214..5d80bf0214 100644
--- a/test/integration/roles/test_cs_vmsnapshot/tasks/main.yml
+++ b/test/integration/targets/cs_vmsnapshot/tasks/main.yml
diff --git a/test/integration/targets/cs_volume/aliases b/test/integration/targets/cs_volume/aliases
new file mode 100644
index 0000000000..ff33c0bb61
--- /dev/null
+++ b/test/integration/targets/cs_volume/aliases
@@ -0,0 +1,3 @@
+cloud/cs
+posix/ci/cloud/cs
+skip/python3
diff --git a/test/integration/roles/test_cs_volume/defaults/main.yml b/test/integration/targets/cs_volume/defaults/main.yml
index 311a99bbe8..1b97cfeb41 100644
--- a/test/integration/roles/test_cs_volume/defaults/main.yml
+++ b/test/integration/targets/cs_volume/defaults/main.yml
@@ -1,6 +1,6 @@
---
test_cs_instance_1: "{{ cs_resource_prefix }}-vm1"
test_cs_instance_2: "{{ cs_resource_prefix }}-vm2"
-test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator)
+test_cs_instance_template: "{{ cs_common_template }}"
test_cs_instance_offering_1: Small Instance
test_cs_disk_offering_1: Custom
diff --git a/test/integration/targets/cs_volume/meta/main.yml b/test/integration/targets/cs_volume/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_volume/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/roles/test_cs_volume/tasks/main.yml b/test/integration/targets/cs_volume/tasks/main.yml
index ae57039cee..ae57039cee 100644
--- a/test/integration/roles/test_cs_volume/tasks/main.yml
+++ b/test/integration/targets/cs_volume/tasks/main.yml
diff --git a/test/integration/targets/cs_vpc/aliases b/test/integration/targets/cs_vpc/aliases
new file mode 100644
index 0000000000..ff33c0bb61
--- /dev/null
+++ b/test/integration/targets/cs_vpc/aliases
@@ -0,0 +1,3 @@
+cloud/cs
+posix/ci/cloud/cs
+skip/python3
diff --git a/test/integration/targets/cs_vpc/meta/main.yml b/test/integration/targets/cs_vpc/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_vpc/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/targets/cs_vpc/tasks/main.yml b/test/integration/targets/cs_vpc/tasks/main.yml
new file mode 100644
index 0000000000..72702698d5
--- /dev/null
+++ b/test/integration/targets/cs_vpc/tasks/main.yml
@@ -0,0 +1,399 @@
+---
+- name: setup
+ cs_vpc:
+ name: "{{ cs_resource_prefix }}_vpc"
+ state: absent
+ register: vpc
+- name: verify setup
+ assert:
+ that:
+ - vpc|success
+
+- name: test fail missing name
+ cs_vpc:
+ ignore_errors: true
+ register: vpc
+- name: verify test fail missing name
+ assert:
+ that:
+ - vpc|failed
+ - 'vpc.msg == "missing required arguments: name"'
+
+- name: test fail missing cidr
+ cs_vpc:
+ name: "{{ cs_resource_prefix }}_vpc"
+ ignore_errors: true
+ register: vpc
+- name: verify test fail missing name
+ assert:
+ that:
+ - vpc|failed
+ - 'vpc.msg == "state is present but the following are missing: cidr"'
+
+- name: test create vpc
+ cs_vpc:
+ name: "{{ cs_resource_prefix }}_vpc"
+ display_text: "{{ cs_resource_prefix }}_display_text"
+ cidr: 10.10.0.0/16
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpc
+- name: verify test create vpc
+ assert:
+ that:
+ - vpc|success
+ - vpc|changed
+ - vpc.name == "{{ cs_resource_prefix }}_vpc"
+ - vpc.display_text == "{{ cs_resource_prefix }}_display_text"
+ - vpc.cidr == "10.10.0.0/16"
+
+- name: test create vpc idempotence
+ cs_vpc:
+ name: "{{ cs_resource_prefix }}_vpc"
+ display_text: "{{ cs_resource_prefix }}_display_text"
+ cidr: 10.10.0.0/16
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpc
+- name: verify test create vpc idempotence
+ assert:
+ that:
+ - vpc|success
+ - not vpc|changed
+ - vpc.name == "{{ cs_resource_prefix }}_vpc"
+ - vpc.display_text == "{{ cs_resource_prefix }}_display_text"
+ - vpc.cidr == "10.10.0.0/16"
+
+- name: test create vpc idempotence2
+ cs_vpc:
+ name: "{{ cs_resource_prefix }}_vpc"
+ cidr: 10.10.0.0/16
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpc
+- name: verify test create vpc idempotence
+ assert:
+ that:
+ - vpc|success
+ - not vpc|changed
+ - vpc.name == "{{ cs_resource_prefix }}_vpc"
+ - vpc.display_text == "{{ cs_resource_prefix }}_display_text"
+ - vpc.cidr == "10.10.0.0/16"
+
+- name: test update vpc
+ cs_vpc:
+ name: "{{ cs_resource_prefix }}_vpc"
+ display_text: "{{ cs_resource_prefix }}_display_text2"
+ cidr: 10.10.0.0/16
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpc
+- name: verify test create vpc
+ assert:
+ that:
+ - vpc|success
+ - vpc|changed
+ - vpc.name == "{{ cs_resource_prefix }}_vpc"
+ - vpc.display_text == "{{ cs_resource_prefix }}_display_text2"
+ - vpc.cidr == "10.10.0.0/16"
+
+- name: test update vpc idempotence
+ cs_vpc:
+ name: "{{ cs_resource_prefix }}_vpc"
+ display_text: "{{ cs_resource_prefix }}_display_text2"
+ cidr: 10.10.0.0/16
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpc
+- name: verify test create vpc
+ assert:
+ that:
+ - vpc|success
+ - not vpc|changed
+ - vpc.name == "{{ cs_resource_prefix }}_vpc"
+ - vpc.display_text == "{{ cs_resource_prefix }}_display_text2"
+ - vpc.cidr == "10.10.0.0/16"
+
+- name: test create network in vpc
+ cs_network:
+ name: "{{ cs_resource_prefix }}_net_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ network_offering: Offering for Isolated Vpc networks with Source Nat service enabled
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ gateway: 10.10.0.1
+ netmask: 255.255.255.0
+ register: vpc_net
+- name: verify test create network in vpc
+ assert:
+ that:
+ - vpc_net|success
+ - vpc_net|changed
+ - vpc_net.name == "{{ cs_resource_prefix }}_net_vpc"
+
+- name: test create network in vpc idempotence
+ cs_network:
+ name: "{{ cs_resource_prefix }}_net_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ network_offering: Offering for Isolated Vpc networks with Source Nat service enabled
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ gateway: 10.10.0.1
+ netmask: 255.255.255.0
+ register: vpc_net
+- name: verify test create network in vpc idempotence
+ assert:
+ that:
+ - vpc_net|success
+ - not vpc_net|changed
+ - vpc_net.name == "{{ cs_resource_prefix }}_net_vpc"
+
+- name: test create instance in vpc
+ cs_instance:
+ name: "{{ cs_resource_prefix }}-vm-vpc"
+ template: "{{ cs_common_template }}"
+ service_offering: "{{ cs_common_service_offering }}"
+ zone: "{{ cs_common_zone_adv }}"
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ register: instance
+- name: verify test create instance in vpc
+ assert:
+ that:
+ - instance|success
+ - instance|changed
+ - instance.name == "{{ cs_resource_prefix }}-vm-vpc"
+ - instance.state == "Running"
+
+- name: test create instance in vpc idempotence
+ cs_instance:
+ name: "{{ cs_resource_prefix }}-vm-vpc"
+ template: "{{ cs_common_template }}"
+ service_offering: "{{ cs_common_service_offering }}"
+ zone: "{{ cs_common_zone_adv }}"
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ register: instance
+- name: verify test create instance in vpc idempotence
+ assert:
+ that:
+ - instance|success
+ - not instance|changed
+ - instance.name == "{{ cs_resource_prefix }}-vm-vpc"
+ - instance.state == "Running"
+
+- name: test get ip address in vpc
+ cs_ip_address:
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ register: ip_address
+ when: instance.public_ip is undefined
+
+- name: test static nat in vpc
+ cs_staticnat:
+ vm: "{{ cs_resource_prefix }}-vm-vpc"
+ ip_address: "{{ ip_address.ip_address }}"
+ zone: "{{ cs_common_zone_adv }}"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ register: static_nat
+- name: verify test static nat in vpc
+ assert:
+ that:
+ - static_nat|success
+ - static_nat|changed
+
+- name: test static nat in vpc idempotence
+ cs_staticnat:
+ vm: "{{ cs_resource_prefix }}-vm-vpc"
+ ip_address: "{{ ip_address.ip_address }}"
+ zone: "{{ cs_common_zone_adv }}"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ register: static_nat
+- name: verify test static nat in vpc idempotence
+ assert:
+ that:
+ - static_nat|success
+ - not static_nat|changed
+
+- name: test remove static nat in vpc
+ cs_staticnat:
+ vm: "{{ cs_resource_prefix }}-vm-vpc"
+ ip_address: "{{ ip_address.ip_address }}"
+ zone: "{{ cs_common_zone_adv }}"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ state: absent
+ register: static_nat
+- name: verify test remove static nat in vpc
+ assert:
+ that:
+ - static_nat|success
+ - static_nat|changed
+
+- name: test remove static nat in vpc idempotence
+ cs_staticnat:
+ vm: "{{ cs_resource_prefix }}-vm-vpc"
+ ip_address: "{{ ip_address.ip_address }}"
+ zone: "{{ cs_common_zone_adv }}"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ state: absent
+ register: static_nat
+- name: verify test remove static nat in vpc idempotence
+ assert:
+ that:
+ - static_nat|success
+ - not static_nat|changed
+
+- name: test create port forwarding in vpc
+ cs_portforward:
+ ip_address: "{{ ip_address.ip_address }}"
+ vm: "{{ cs_resource_prefix }}-vm-vpc"
+ public_port: 80
+ private_port: 8080
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ register: port_forward
+- name: verify test create port forwarding in vpc
+ assert:
+ that:
+ - port_forward|success
+ - port_forward|changed
+
+- name: test create port forwarding in vpc idempotence
+ cs_portforward:
+ ip_address: "{{ ip_address.ip_address }}"
+ vm: "{{ cs_resource_prefix }}-vm-vpc"
+ public_port: 80
+ private_port: 8080
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ register: port_forward
+- name: verify test create port forwarding in vpc idempotence
+ assert:
+ that:
+ - port_forward|success
+ - not port_forward|changed
+
+- name: test remove port forwarding in vpc
+ cs_portforward:
+ ip_address: "{{ ip_address.ip_address }}"
+ vm: "{{ cs_resource_prefix }}-vm-vpc"
+ public_port: 80
+ private_port: 8080
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: port_forward
+- name: verify test remove port forwarding in vpc
+ assert:
+ that:
+ - port_forward|success
+ - port_forward|changed
+
+- name: test remove port forwarding in vpc idempotence
+ cs_portforward:
+ ip_address: "{{ ip_address.ip_address }}"
+ vm: "{{ cs_resource_prefix }}-vm-vpc"
+ public_port: 80
+ private_port: 8080
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: port_forward
+- name: verify test remove port forwarding in vpc idempotence
+ assert:
+ that:
+ - port_forward|success
+ - not port_forward|changed
+
+- name: test remove ip address from vpc
+ cs_ip_address:
+ network: "{{ cs_resource_prefix }}_net_vpc"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ ip_address: "{{ ip_address.ip_address }}"
+ state: absent
+ register: ip_address_removed
+- name: verify test remove static nat in vpc idempotence
+ assert:
+ that:
+ - ip_address_removed|success
+ - ip_address_removed|changed
+
+- name: test remove instance in vpc
+ cs_instance:
+ name: "{{ cs_resource_prefix }}-vm-vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ state: expunged
+ register: instance
+- name: verify test remove instance in vpc
+ assert:
+ that:
+ - instance|success
+ - instance|changed
+ - instance.name == "{{ cs_resource_prefix }}-vm-vpc"
+ - instance.state == "Running"
+
+- name: test remove instance in vpc idempotence
+ cs_instance:
+ name: "{{ cs_resource_prefix }}-vm-vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ state: expunged
+ register: instance
+- name: verify test remove instance in vpc idempotence
+ assert:
+ that:
+ - instance|success
+ - not instance|changed
+
+- name: test remove network in vpc
+ cs_network:
+ name: "{{ cs_resource_prefix }}_net_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ state: absent
+ register: vpc_net
+- name: verify test remove network in vpc
+ assert:
+ that:
+ - vpc_net|success
+ - vpc_net|changed
+ - vpc_net.name == "{{ cs_resource_prefix }}_net_vpc"
+
+- name: test remove network in vpc idempotence
+ cs_network:
+ name: "{{ cs_resource_prefix }}_net_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ state: absent
+ register: vpc_net
+- name: verify test remove network in vpc idempotence
+ assert:
+ that:
+ - vpc_net|success
+ - not vpc_net|changed
+
+- name: test remove vpc
+ cs_vpc:
+ name: "{{ cs_resource_prefix }}_vpc"
+ state: absent
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpc
+- name: verify test remove vpc
+ assert:
+ that:
+ - vpc|success
+ - vpc|changed
+ - vpc.name == "{{ cs_resource_prefix }}_vpc"
+ - vpc.display_text == "{{ cs_resource_prefix }}_display_text2"
+ - vpc.cidr == "10.10.0.0/16"
+
+- name: test remove vpc idempotence
+ cs_vpc:
+ name: "{{ cs_resource_prefix }}_vpc"
+ state: absent
+ register: vpc
+- name: verify test remove vpc idempotence
+ assert:
+ that:
+ - vpc|success
+ - not vpc|changed
diff --git a/test/integration/targets/test_cs_common/defaults/main.yml b/test/integration/targets/test_cs_common/defaults/main.yml
deleted file mode 100644
index ba9674ac92..0000000000
--- a/test/integration/targets/test_cs_common/defaults/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-cs_resource_prefix: cloudstack
diff --git a/test/utils/docker/cloudstack-simulator/Dockerfile b/test/utils/docker/cloudstack-simulator/Dockerfile
new file mode 100644
index 0000000000..3648317199
--- /dev/null
+++ b/test/utils/docker/cloudstack-simulator/Dockerfile
@@ -0,0 +1,64 @@
+FROM ubuntu:16.04
+
+MAINTAINER "René Moser" <mail@renemoser.net>
+
+RUN echo 'mysql-server mysql-server/root_password password root' | debconf-set-selections; \
+ echo 'mysql-server mysql-server/root_password_again password root' | debconf-set-selections;
+
+RUN apt-get -y update && apt-get install -y \
+ genisoimage \
+ libffi-dev \
+ libssl-dev \
+ sudo \
+ ipmitool \
+ maven \
+ netcat \
+ openjdk-8-jdk \
+ python-dev \
+ python-setuptools \
+ python-pip \
+ python-mysql.connector \
+ supervisor \
+ wget \
+ nginx \
+ jq \
+ mysql-server \
+ openssh-client \
+ && apt-get clean all \
+ && rm -rf /var/lib/apt/lists/*;
+
+# TODO: check if and why this is needed
+RUN mkdir -p /root/.ssh \
+ && chmod 0700 /root/.ssh \
+ && ssh-keygen -t rsa -N "" -f id_rsa.cloud
+
+RUN mkdir -p /var/run/mysqld; \
+ chown mysql /var/run/mysqld; \
+ echo '''sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"''' >> /etc/mysql/mysql.conf.d/mysqld.cnf
+
+RUN (/usr/bin/mysqld_safe &); sleep 5; mysqladmin -u root -proot password ''
+
+RUN wget https://github.com/apache/cloudstack/archive/4.9.2.0.tar.gz -O /opt/cloudstack.tar.gz; \
+ mkdir -p /opt/cloudstack; \
+ tar xvzf /opt/cloudstack.tar.gz -C /opt/cloudstack --strip-components=1
+
+WORKDIR /opt/cloudstack
+
+RUN mvn -Pdeveloper -Dsimulator -DskipTests clean install
+
+RUN (/usr/bin/mysqld_safe &); \
+ sleep 5; \
+ mvn -Pdeveloper -pl developer -Ddeploydb; \
+ mvn -Pdeveloper -pl developer -Ddeploydb-simulator; \
+ MARVIN_FILE=$(find /opt/cloudstack/tools/marvin/dist/ -name "Marvin*.tar.gz"); \
+ pip install $MARVIN_FILE;
+
+COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
+COPY zones.cfg /opt/zones.cfg
+COPY nginx_default.conf /etc/nginx/sites-available/default
+RUN pip install cs
+COPY run.sh /opt/run.sh
+
+EXPOSE 8888 8080 8096
+
+CMD ["/usr/bin/supervisord"]
diff --git a/test/utils/docker/cloudstack-simulator/Makefile b/test/utils/docker/cloudstack-simulator/Makefile
new file mode 100644
index 0000000000..52985bf5a0
--- /dev/null
+++ b/test/utils/docker/cloudstack-simulator/Makefile
@@ -0,0 +1,14 @@
+build:
+ docker build -t cloudstack-sim .
+
+clean:
+ docker rm -f cloudstack
+
+run:
+ docker run --name cloudstack -d -p 8080:8080 -p 8888:8888 cloudstack-sim
+
+shell:
+ docker exec -it cloudstack /bin/bash
+
+logs:
+ docker logs -f cloudstack
diff --git a/test/utils/docker/cloudstack-simulator/README.rst b/test/utils/docker/cloudstack-simulator/README.rst
new file mode 100644
index 0000000000..aa65580cd4
--- /dev/null
+++ b/test/utils/docker/cloudstack-simulator/README.rst
@@ -0,0 +1,31 @@
+CloudStack Simulator as Docker Image
+====================================
+
+The purpose of this docker image is to run automated integration tests for the CloudStack modules in Ansible.
+
+Setup
+-----
+
+The docker image runs the CloudStack simulator and contains two zones for the different network setups: `basic` and `advanced` networking.
+
+- CloudStack Zone: Sandbox-simulator-advanced
+- Zone: Sandbox-simulator-basic
+
+Build
+-----
+
+.. code-block:: shell
+
+ docker build -t ansible/cloudstack-simulator .
+
+Run
+---
+
+.. code-block:: shell
+
+ docker run --name cloudstack-simulator -d -p 8888:8888 ansible/cloudstack-simulator
+
+
+.. Note::
+
+ It may take some time until the zones are deployed. The web server will respond with HTTP 503 on port 8888 unless the zones are fully deployed.
diff --git a/test/utils/docker/cloudstack-simulator/nginx_default.conf b/test/utils/docker/cloudstack-simulator/nginx_default.conf
new file mode 100644
index 0000000000..8df35c57a7
--- /dev/null
+++ b/test/utils/docker/cloudstack-simulator/nginx_default.conf
@@ -0,0 +1,23 @@
+upstream cloudstack-backend {
+ server 127.0.0.1:8080;
+}
+
+server {
+ listen 8888 default_server;
+
+ root /var/www/html;
+
+ server_name _;
+
+ # waiting for zone to be deployed
+ if (!-f /var/www/html/admin.json) {
+ return 503;
+ }
+
+ location /client {
+ proxy_pass http://cloudstack-backend;
+ }
+ location / {
+
+ }
+}
diff --git a/test/utils/docker/cloudstack-simulator/run.sh b/test/utils/docker/cloudstack-simulator/run.sh
new file mode 100755
index 0000000000..107045c196
--- /dev/null
+++ b/test/utils/docker/cloudstack-simulator/run.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+until nc -z localhost 8096; do
+ echo "waiting for port 8096..."
+ sleep 3
+done
+
+sleep 3
+if [ ! -e /var/www/html/admin.json ]
+then
+ python /opt/cloudstack/tools/marvin/marvin/deployDataCenter.py -i /opt/zones.cfg
+ export CLOUDSTACK_ENDPOINT=http://127.0.0.1:8096
+ export CLOUDSTACK_KEY=""
+ export CLOUDSTACK_SECRET=""
+ cs listUsers account=admin | jq .user[0] > /var/www/html/admin.json
+fi
diff --git a/test/utils/docker/cloudstack-simulator/supervisord.conf b/test/utils/docker/cloudstack-simulator/supervisord.conf
new file mode 100644
index 0000000000..4e8c3effa2
--- /dev/null
+++ b/test/utils/docker/cloudstack-simulator/supervisord.conf
@@ -0,0 +1,28 @@
+[supervisord]
+nodaemon=true
+
+[program:mysqld]
+command=/usr/bin/mysqld_safe
+autostart=true
+autorestart=true
+user=root
+
+[program:cloudstack]
+command=/bin/bash -c "mvn -pl client jetty:run -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120"
+directory=/opt/cloudstack
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+user=root
+
+[program:nginx]
+command=/usr/sbin/nginx
+autostart=true
+autorestart=false
+user=root
+
+[program:deploy-zones]
+command = /opt/run.sh
+startsecs = 0
+autorestart = false
+startretries = 1
+user=root
diff --git a/test/utils/docker/cloudstack-simulator/zones.cfg b/test/utils/docker/cloudstack-simulator/zones.cfg
new file mode 100644
index 0000000000..ea3560c6bc
--- /dev/null
+++ b/test/utils/docker/cloudstack-simulator/zones.cfg
@@ -0,0 +1,310 @@
+{
+ "zones": [
+ {
+ "name": "Sandbox-simulator-basic",
+ "dns1": "8.8.8.8",
+ "physical_networks": [
+ {
+ "broadcastdomainrange": "Zone",
+ "name": "Sandbox-pnet",
+ "traffictypes": [
+ {
+ "typ": "Guest"
+ },
+ {
+ "typ": "Management"
+ }
+ ],
+ "providers": [
+ {
+ "broadcastdomainrange": "ZONE",
+ "name": "VirtualRouter"
+ },
+ {
+ "broadcastdomainrange": "Pod",
+ "name": "SecurityGroupProvider"
+ }
+ ],
+ "isolationmethods": [
+ "L3"
+ ]
+ }
+ ],
+ "securitygroupenabled": "true",
+ "networktype": "Basic",
+ "pods": [
+ {
+ "endip": "172.16.15.254",
+ "name": "POD0-basic",
+ "startip": "172.16.15.2",
+ "guestIpRanges": [
+ {
+ "startip": "60.147.41.2",
+ "endip": "60.147.41.254",
+ "netmask": "255.255.255.0",
+ "gateway": "60.147.41.1"
+ }
+ ],
+ "netmask": "255.255.255.0",
+ "clusters": [
+ {
+ "clustername": "C0-basic",
+ "hypervisor": "simulator",
+ "hosts": [
+ {
+ "username": "root",
+ "url": "http://sim/c0-basic/h0",
+ "password": "password"
+ },
+ {
+ "username": "root",
+ "url": "http://sim/c0-basic/h1",
+ "password": "password"
+ }
+ ],
+ "clustertype": "CloudManaged",
+ "primaryStorages": [
+ {
+ "url": "nfs://nfsstor:/export/home/sandbox/primary",
+ "name": "PS0-basic"
+ }
+ ]
+ }
+ ],
+ "gateway": "172.16.15.1"
+ }
+ ],
+ "internaldns1": "8.8.8.8",
+ "secondaryStorages": [
+ {
+ "url": "nfs://nfsstor:/export/home/sandbox/secondary",
+ "provider" : "NFS"
+ }
+ ]
+ },
+ {
+ "name": "Sandbox-simulator-advanced",
+ "guestcidraddress": "10.1.1.0/24",
+ "dns1": "10.147.28.7",
+ "physical_networks": [
+ {
+ "broadcastdomainrange": "Zone",
+ "vlan": "100-200",
+ "name": "Sandbox-pnet",
+ "traffictypes": [
+ {
+ "typ": "Guest"
+ },
+ {
+ "typ": "Management"
+ },
+ {
+ "typ": "Public"
+ }
+ ],
+ "providers": [
+ {
+ "broadcastdomainrange": "ZONE",
+ "name": "VirtualRouter"
+ },
+ {
+ "broadcastdomainrange": "ZONE",
+ "name": "VpcVirtualRouter"
+ },
+ {
+ "broadcastdomainrange": "ZONE",
+ "name": "InternalLbVm"
+ }
+ ],
+ "isolationmethods": [
+ "VLAN"
+ ]
+ }
+ ],
+ "vmwaredc": {
+ "username": "",
+ "vcenter": "",
+ "password": "",
+ "name": ""
+ },
+ "ipranges": [
+ {
+ "startip": "192.168.2.2",
+ "endip": "192.168.2.200",
+ "netmask": "255.255.255.0",
+ "vlan": "50",
+ "gateway": "192.168.2.1"
+ }
+ ],
+ "networktype": "Advanced",
+ "pods": [
+ {
+ "endip": "172.16.15.200",
+ "name": "POD0-adv",
+ "startip": "172.16.15.2",
+ "netmask": "255.255.255.0",
+ "clusters": [
+ {
+ "clustername": "C0-adv",
+ "hypervisor": "simulator",
+ "hosts": [
+ {
+ "username": "root",
+ "url": "http://sim/c0-adv/h0",
+ "password": "password"
+ },
+ {
+ "username": "root",
+ "url": "http://sim/c0-adv/h1",
+ "password": "password"
+ }
+ ],
+ "clustertype": "CloudManaged",
+ "primaryStorages": [
+ {
+ "url": "nfs://10.147.28.7:/export/home/sandbox/primary0",
+ "name": "PS0-adv"
+ },
+ {
+ "url": "nfs://10.147.28.7:/export/home/sandbox/primary1",
+ "name": "PS1-adv"
+ }
+ ]
+ },
+ {
+ "clustername": "C1-adv",
+ "hypervisor": "simulator",
+ "hosts": [
+ {
+ "username": "root",
+ "url": "http://sim/c1-adv/h0",
+ "password": "password"
+ }
+ ],
+ "clustertype": "CloudManaged",
+ "primaryStorages": [
+ {
+ "url": "nfs://10.147.28.7:/export/home/sandbox/primary2",
+ "name": "PS2-adv"
+ }
+ ]
+ }
+ ],
+ "gateway": "172.16.15.1"
+ }
+ ],
+ "internaldns1": "10.147.28.7",
+ "secondaryStorages": [
+ {
+ "url": "nfs://10.147.28.7:/export/home/sandbox/secondary",
+ "provider" : "NFS"
+ }
+ ]
+ }
+ ],
+ "dbSvr": {
+ "dbSvr": "localhost",
+ "passwd": "cloud",
+ "db": "cloud",
+ "port": 3306,
+ "user": "cloud"
+ },
+ "logger":
+ {
+ "LogFolderPath": "/tmp/"
+ },
+ "globalConfig": [
+ {
+ "name": "network.gc.wait",
+ "value": "20"
+ },
+ {
+ "name": "storage.cleanup.interval",
+ "value": "40"
+ },
+ {
+ "name": "vm.op.wait.interval",
+ "value": "5"
+ },
+ {
+ "name": "default.page.size",
+ "value": "500"
+ },
+ {
+ "name": "network.gc.interval",
+ "value": "20"
+ },
+ {
+ "name": "instance.name",
+ "value": "QA"
+ },
+ {
+ "name": "workers",
+ "value": "10"
+ },
+ {
+ "name": "account.cleanup.interval",
+ "value": "20"
+ },
+ {
+ "name": "guest.domain.suffix",
+ "value": "sandbox.simulator"
+ },
+ {
+ "name": "expunge.delay",
+ "value": "20"
+ },
+ {
+ "name": "vm.allocation.algorithm",
+ "value": "random"
+ },
+ {
+ "name": "expunge.interval",
+ "value": "20"
+ },
+ {
+ "name": "expunge.workers",
+ "value": "3"
+ },
+ {
+ "name": "check.pod.cidrs",
+ "value": "true"
+ },
+ {
+ "name": "secstorage.allowed.internal.sites",
+ "value": "10.147.28.0/24"
+ },
+ {
+ "name": "direct.agent.load.size",
+ "value": "1000"
+ },
+ {
+ "name": "enable.dynamic.scale.vm",
+ "value": "true"
+ },
+ {
+ "name": "ping.interval",
+ "value": "10"
+ },
+ {
+ "name": "ping.timeout",
+ "value": "1.5"
+ },
+ {
+ "name": "outofbandmanagement.sync.interval",
+ "value": "1000"
+ }
+ ],
+ "mgtSvr": [
+ {
+ "mgtSvrIp": "localhost",
+ "passwd": "password",
+ "user": "root",
+ "port": 8096,
+ "hypervisor": "simulator",
+ "useHttps": "False",
+ "certCAPath": "NA",
+ "certPath": "NA"
+ }
+ ]
+}