summaryrefslogtreecommitdiff
path: root/test/integration/targets/cs_network_acl
diff options
context:
space:
mode:
authorRené Moser <mail@renemoser.net>2017-05-15 10:57:38 +0200
committerGitHub <noreply@github.com>2017-05-15 10:57:38 +0200
commit3ca3163af17f4caf00d02b3bbad4b969ecfdb442 (patch)
tree59f120ca4871994889dfb9bf8cdb2f2a5a44fb6b /test/integration/targets/cs_network_acl
parent6410e139037db14189a47173b90fe110566f69d9 (diff)
downloadansible-3ca3163af17f4caf00d02b3bbad4b969ecfdb442.tar.gz
cloudstack: add new module cs_network_acl (#24609)
Diffstat (limited to 'test/integration/targets/cs_network_acl')
-rw-r--r--test/integration/targets/cs_network_acl/aliases2
-rw-r--r--test/integration/targets/cs_network_acl/meta/main.yml3
-rw-r--r--test/integration/targets/cs_network_acl/tasks/main.yml90
3 files changed, 95 insertions, 0 deletions
diff --git a/test/integration/targets/cs_network_acl/aliases b/test/integration/targets/cs_network_acl/aliases
new file mode 100644
index 0000000000..ba249b99d7
--- /dev/null
+++ b/test/integration/targets/cs_network_acl/aliases
@@ -0,0 +1,2 @@
+cloud/cs
+posix/ci/cloud/cs
diff --git a/test/integration/targets/cs_network_acl/meta/main.yml b/test/integration/targets/cs_network_acl/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_network_acl/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/targets/cs_network_acl/tasks/main.yml b/test/integration/targets/cs_network_acl/tasks/main.yml
new file mode 100644
index 0000000000..5b39ac379b
--- /dev/null
+++ b/test/integration/targets/cs_network_acl/tasks/main.yml
@@ -0,0 +1,90 @@
+---
+- name: setup 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 setup vpc
+ assert:
+ that:
+ - vpc|success
+
+- name: setup network acl absent
+ cs_network_acl:
+ name: "{{ cs_resource_prefix }}_acl"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: acl
+- name: verify setup network acl absent
+ assert:
+ that:
+ - acl|success
+
+- name: test fail missing param name and vpc for network acl
+ cs_network_acl:
+ ignore_errors: true
+ register: acl
+- name: verify test fail missing param name and vpc for network acl
+ assert:
+ that:
+ - acl|failed
+ - "acl.msg.startswith('missing required arguments: ')"
+
+- name: test create network acl
+ cs_network_acl:
+ name: "{{ cs_resource_prefix }}_acl"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ register: acl
+- name: verify test create network acl
+ assert:
+ that:
+ - acl|success
+ - acl|changed
+ - acl.vpc == "{{ cs_resource_prefix }}_vpc"
+ - acl.name == "{{ cs_resource_prefix }}_acl"
+
+- name: test create network acl idempotence
+ cs_network_acl:
+ name: "{{ cs_resource_prefix }}_acl"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ register: acl
+- name: verify test create network acl idempotence
+ assert:
+ that:
+ - acl|success
+ - not acl|changed
+ - acl.vpc == "{{ cs_resource_prefix }}_vpc"
+ - acl.name == "{{ cs_resource_prefix }}_acl"
+
+- name: test remove network acl
+ cs_network_acl:
+ name: "{{ cs_resource_prefix }}_acl"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: acl
+- name: verify test remove network acl
+ assert:
+ that:
+ - acl|success
+ - acl|changed
+ - acl.vpc == "{{ cs_resource_prefix }}_vpc"
+ - acl.name == "{{ cs_resource_prefix }}_acl"
+
+- name: test remove network acl idempotence
+ cs_network_acl:
+ name: "{{ cs_resource_prefix }}_acl"
+ vpc: "{{ cs_resource_prefix }}_vpc"
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: acl
+- name: verify test remove network acl idempotence
+ assert:
+ that:
+ - acl|success
+ - not acl|changed