summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/cs_vpn_connection
diff options
context:
space:
mode:
authorRené Moser <mail@renemoser.net>2018-01-10 11:15:34 +0100
committerGitHub <noreply@github.com>2018-01-10 11:15:34 +0100
commit01091cddf6d85ffb584de99ae2d59b693fabaf0f (patch)
tree325c7629dee9ee1c86badc696ddef7bf928ae3c6 /test/integration/targets/cs_vpn_connection
parentUpdate astroid test constraint. (diff)
downloadansible-01091cddf6d85ffb584de99ae2d59b693fabaf0f.tar.xz
ansible-01091cddf6d85ffb584de99ae2d59b693fabaf0f.zip
cloudstack: new module cs_vpn_connection (#34669)
* cloudstack: new module cs_vpn_connection * cloudstack: add cs_vpn_connection tests * fix typos * remove local action in tests
Diffstat (limited to 'test/integration/targets/cs_vpn_connection')
-rw-r--r--test/integration/targets/cs_vpn_connection/aliases2
-rw-r--r--test/integration/targets/cs_vpn_connection/meta/main.yml3
-rw-r--r--test/integration/targets/cs_vpn_connection/tasks/main.yml200
3 files changed, 205 insertions, 0 deletions
diff --git a/test/integration/targets/cs_vpn_connection/aliases b/test/integration/targets/cs_vpn_connection/aliases
new file mode 100644
index 0000000000..ee8454c6d1
--- /dev/null
+++ b/test/integration/targets/cs_vpn_connection/aliases
@@ -0,0 +1,2 @@
+cloud/cs
+posix/ci/cloud/group1/cs
diff --git a/test/integration/targets/cs_vpn_connection/meta/main.yml b/test/integration/targets/cs_vpn_connection/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_vpn_connection/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/targets/cs_vpn_connection/tasks/main.yml b/test/integration/targets/cs_vpn_connection/tasks/main.yml
new file mode 100644
index 0000000000..c7bc060cc9
--- /dev/null
+++ b/test/integration/targets/cs_vpn_connection/tasks/main.yml
@@ -0,0 +1,200 @@
+---
+- name: setup vpc
+ cs_vpc:
+ name: my_vpc
+ display_text: my_vpc
+ cidr: 10.10.1.0/16
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpc
+- name: verify setup vpc
+ assert:
+ that:
+ - vpc is successful
+
+- name: setup customer gateway
+ cs_vpn_customer_gateway:
+ name: my_vpn_customer_gateway
+ cidr: 192.168.123.0/24
+ esp_policy: aes256-sha1;modp1536
+ gateway: 10.11.1.1
+ ike_policy: aes256-sha1;modp1536
+ ipsec_psk: ~S3¢r3Tk3Y¼
+ esp_lifetime: 3600
+ register: vcg
+- name: setup customer gateway
+ assert:
+ that:
+ - vcg is successful
+
+- name: setup remove vpn connection
+ cs_vpn_connection:
+ vpc: my_vpc
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: vpn_conn
+- name: verify setup remove vpn connection
+ assert:
+ that:
+ - vpn_conn is successful
+
+- name: setup vpn gateway absent
+ cs_vpn_gateway:
+ vpc: my_vpc
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: vpn_gateway
+- name: verify setup vpn gateway absent
+ assert:
+ that:
+ - vpn_gateway is successful
+
+- name: test fail create vpn connection without gateway and force
+ cs_vpn_connection:
+ vpn_customer_gateway: my_vpn_customer_gateway
+ vpc: my_vpc
+ zone: "{{ cs_common_zone_adv }}"
+ ignore_errors: yes
+ register: vpn_conn
+- name: verify test fail create vpn connection without gateway and force
+ assert:
+ that:
+ - vpn_conn is failed
+ - vpn_conn.msg == "VPN gateway not found and not forced to create one"
+
+- name: test create vpn connection with force in check mode
+ cs_vpn_connection:
+ vpn_customer_gateway: my_vpn_customer_gateway
+ vpc: my_vpc
+ force: yes
+ zone: "{{ cs_common_zone_adv }}"
+ check_mode: yes
+ register: vpn_conn
+- name: verify test create vpn connection with force in check mode
+ assert:
+ that:
+ - vpn_conn is changed
+
+- name: test create vpn connection with force
+ cs_vpn_connection:
+ vpn_customer_gateway: my_vpn_customer_gateway
+ vpc: my_vpc
+ force: yes
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpn_conn
+- name: verify test create vpn connection with force
+ assert:
+ that:
+ - vpn_conn is changed
+ - vpn_conn.vpn_customer_gateway == "my_vpn_customer_gateway"
+ - vpn_conn.vpc == "my_vpc"
+
+- name: test create vpn connection with force idempotence
+ cs_vpn_connection:
+ vpn_customer_gateway: my_vpn_customer_gateway
+ vpc: my_vpc
+ force: yes
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpn_conn
+- name: verify test create vpn connection with force idempotence
+ assert:
+ that:
+ - vpn_conn is not changed
+ - vpn_conn.vpn_customer_gateway == "my_vpn_customer_gateway"
+ - vpn_conn.vpc == "my_vpc"
+
+- name: test remove vpn connection in check mode
+ cs_vpn_connection:
+ vpc: my_vpc
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ check_mode: yes
+ register: vpn_conn
+- name: verify test remove vpn connection in check mode
+ assert:
+ that:
+ - vpn_conn is changed
+ - vpn_conn.vpn_customer_gateway == "my_vpn_customer_gateway"
+ - vpn_conn.vpc == "my_vpc"
+
+- name: test remove vpn connection
+ cs_vpn_connection:
+ vpc: my_vpc
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: vpn_conn
+- name: verify test remove vpn connection
+ assert:
+ that:
+ - vpn_conn is changed
+ - vpn_conn.vpn_customer_gateway == "my_vpn_customer_gateway"
+ - vpn_conn.vpc == "my_vpc"
+
+- name: test remove vpn connection idempotence
+ cs_vpn_connection:
+ vpc: my_vpc
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: vpn_conn
+- name: verify test remove vpn connection idempotence
+ assert:
+ that:
+ - vpn_conn is not changed
+
+- name: setup create vpn gateway
+ cs_vpn_gateway:
+ vpc: my_vpc
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpn_gateway
+- name: verify setup create vpn gateway
+ assert:
+ that:
+ - vpn_gateway is success
+
+- name: test create vpn connection without force in check mode
+ cs_vpn_connection:
+ vpn_customer_gateway: my_vpn_customer_gateway
+ vpc: my_vpc
+ zone: "{{ cs_common_zone_adv }}"
+ check_mode: yes
+ register: vpn_conn
+- name: verify test create vpn connection without force in check mode
+ assert:
+ that:
+ - vpn_conn is changed
+
+- name: test create vpn connection without force
+ cs_vpn_connection:
+ vpn_customer_gateway: my_vpn_customer_gateway
+ vpc: my_vpc
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpn_conn
+- name: verify test create vpn connection without force
+ assert:
+ that:
+ - vpn_conn is changed
+ - vpn_conn.vpn_customer_gateway == "my_vpn_customer_gateway"
+ - vpn_conn.vpc == "my_vpc"
+
+- name: test create vpn connection without force
+ cs_vpn_connection:
+ vpn_customer_gateway: my_vpn_customer_gateway
+ vpc: my_vpc
+ zone: "{{ cs_common_zone_adv }}"
+ register: vpn_conn
+- name: verify test create vpn connection without force
+ assert:
+ that:
+ - vpn_conn is not changed
+ - vpn_conn.vpn_customer_gateway == "my_vpn_customer_gateway"
+ - vpn_conn.vpc == "my_vpc"
+
+- name: cleanup remove vpn connection
+ cs_vpn_connection:
+ vpc: my_vpc
+ zone: "{{ cs_common_zone_adv }}"
+ state: absent
+ register: vpn_conn
+- name: verify cleanup remove vpn connection idempotence
+ assert:
+ that:
+ - vpn_conn is successful