diff options
author | Matt Clay <matt@mystile.com> | 2017-05-03 08:24:05 +0800 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2017-05-05 21:46:29 +0800 |
commit | 17e07a27b20e551f5f35674f43c05855f23dce22 (patch) | |
tree | 70e9d9829290eaa8496407ce0c6024a0159862ea /test/integration/roles | |
parent | ac72fd9d2c6dcc4017cf69605964cf18658c3188 (diff) | |
download | ansible-17e07a27b20e551f5f35674f43c05855f23dce22.tar.gz |
Enable cloud tests for use with ansible-test.
Diffstat (limited to 'test/integration/roles')
64 files changed, 2 insertions, 3516 deletions
diff --git a/test/integration/roles/setup_ec2 b/test/integration/roles/setup_ec2 new file mode 120000 index 0000000000..695decee54 --- /dev/null +++ b/test/integration/roles/setup_ec2 @@ -0,0 +1 @@ +../targets/setup_ec2
\ No newline at end of file diff --git a/test/integration/roles/setup_ec2/defaults/main.yml b/test/integration/roles/setup_ec2/defaults/main.yml deleted file mode 100644 index fb1f88b1ec..0000000000 --- a/test/integration/roles/setup_ec2/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -resource_prefix: 'ansible-testing-' diff --git a/test/integration/roles/setup_ec2/tasks/common.yml b/test/integration/roles/setup_ec2/tasks/common.yml deleted file mode 100644 index bf23f539a9..0000000000 --- a/test/integration/roles/setup_ec2/tasks/common.yml +++ /dev/null @@ -1,119 +0,0 @@ ---- - -# ============================================================ -- name: test with no parameters - action: "{{module_name}}" - register: result - ignore_errors: true - -- name: assert failure when called with no parameters - assert: - that: - - 'result.failed' - - 'result.msg == "missing required arguments: name"' - -# ============================================================ -- name: test with only name - action: "{{module_name}} name={{ec2_key_name}}" - register: result - ignore_errors: true - -- name: assert failure when called with only 'name' - assert: - that: - - 'result.failed' - - 'result.msg == "Either region or ec2_url must be specified"' - -# ============================================================ -- name: test invalid region parameter - action: "{{module_name}} name='{{ec2_key_name}}' region='asdf querty 1234'" - register: result - ignore_errors: true - -- name: assert invalid region parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("value of region must be one of:")' - -# ============================================================ -- name: test valid region parameter - action: "{{module_name}} name='{{ec2_key_name}}' region='{{ec2_region}}'" - register: result - ignore_errors: true - -- name: assert valid region parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - -# ============================================================ -- name: test environment variable EC2_REGION - action: "{{module_name}} name='{{ec2_key_name}}'" - environment: - EC2_REGION: '{{ec2_region}}' - register: result - ignore_errors: true - -- name: assert environment variable EC2_REGION - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - -# ============================================================ -- name: test invalid ec2_url parameter - action: "{{module_name}} name='{{ec2_key_name}}'" - environment: - EC2_URL: bogus.example.com - register: result - ignore_errors: true - -- name: assert invalid ec2_url parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - -# ============================================================ -- name: test valid ec2_url parameter - action: "{{module_name}} name='{{ec2_key_name}}'" - environment: - EC2_URL: '{{ec2_url}}' - register: result - ignore_errors: true - -- name: assert valid ec2_url parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - -# ============================================================ -- name: test credentials from environment - action: "{{module_name}} name='{{ec2_key_name}}'" - environment: - EC2_REGION: '{{ec2_region}}' - EC2_ACCESS_KEY: bogus_access_key - EC2_SECRET_KEY: bogus_secret_key - register: result - ignore_errors: true - -- name: assert ec2_key with valid ec2_url - assert: - that: - - 'result.failed' - - '"EC2ResponseError: 401 Unauthorized" in result.msg' - -# ============================================================ -- name: test credential parameters - action: "{{module_name}} name='{{ec2_key_name}}' ec2_region='{{ec2_region}}' ec2_access_key=bogus_access_key ec2_secret_key=bogus_secret_key" - register: result - ignore_errors: true - -- name: assert credential parameters - assert: - that: - - 'result.failed' - - '"EC2ResponseError: 401 Unauthorized" in result.msg' diff --git a/test/integration/roles/setup_sshkey b/test/integration/roles/setup_sshkey new file mode 120000 index 0000000000..aaef469c2e --- /dev/null +++ b/test/integration/roles/setup_sshkey @@ -0,0 +1 @@ +../targets/setup_sshkey
\ No newline at end of file diff --git a/test/integration/roles/setup_sshkey/tasks/main.yml b/test/integration/roles/setup_sshkey/tasks/main.yml deleted file mode 100644 index afea833198..0000000000 --- a/test/integration/roles/setup_sshkey/tasks/main.yml +++ /dev/null @@ -1,47 +0,0 @@ -# (c) 2014, James Laska <jlaska@ansible.com> - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. - -- name: create random file - shell: mktemp /tmp/id_rsa.XXXXXX - register: sshkey - tags: - - prepare - -- name: generate sshkey - shell: echo 'y' | ssh-keygen -P '' -f {{sshkey.stdout}} - tags: - - prepare - -- name: record key_material - command: cat {{sshkey.stdout}}.pub - register: key_material - tags: - - prepare - -- name: record fingerprint - shell: ssh-keygen -lf {{sshkey.stdout}}.pub - register: fingerprint - tags: - - prepare - -- name: set facts for future roles - set_fact: - sshkey: '{{sshkey.stdout}}' - key_material: '{{key_material.stdout}}' - fingerprint: '{{fingerprint.stdout.split()[1]}}' - tags: - - prepare diff --git a/test/integration/roles/test_cs_account/meta/main.yml b/test/integration/roles/test_cs_account/meta/main.yml deleted file mode 100644 index 03e38bd4f7..0000000000 --- a/test/integration/roles/test_cs_account/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - test_cs_common diff --git a/test/integration/roles/test_cs_account/tasks/main.yml b/test/integration/roles/test_cs_account/tasks/main.yml deleted file mode 100644 index 0061c66639..0000000000 --- a/test/integration/roles/test_cs_account/tasks/main.yml +++ /dev/null @@ -1,340 +0,0 @@ ---- -- name: setup - cs_account: name={{ cs_resource_prefix }}_user state=absent - register: acc -- name: verify setup - assert: - that: - - acc|success - -- name: test fail if missing name - action: cs_account - register: acc - ignore_errors: true -- name: verify results of fail if missing params - assert: - that: - - acc|failed - - 'acc.msg == "missing required arguments: name"' - -- name: test fail if missing params if state=present - cs_account: - name: "{{ cs_resource_prefix }}_user" - register: acc - ignore_errors: true -- name: verify results of fail if missing params if state=present - assert: - that: - - acc|failed - - 'acc.msg == "missing required arguments: email,username,password,first_name,last_name"' - -- name: test create user account - cs_account: - name: "{{ cs_resource_prefix }}_user" - username: "{{ cs_resource_prefix }}_username" - password: "{{ cs_resource_prefix }}_password" - 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" - register: acc -- name: verify results of create account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" - -- name: test create user account idempotence - cs_account: - name: "{{ cs_resource_prefix }}_user" - username: "{{ cs_resource_prefix }}_username" - password: "{{ cs_resource_prefix }}_password" - 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" - register: acc -- name: verify results of create account idempotence - assert: - that: - - acc|success - - not acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" - -- name: test lock user account - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: locked - register: acc -- name: verify results of lock user account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" - -- name: test lock user account idempotence - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: locked - register: acc -- name: verify results of lock user account idempotence - assert: - that: - - acc|success - - not acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" - -- name: test disable user account - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: disabled - register: acc -- name: verify results of disable user account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "disabled" - - acc.domain == "ROOT" - -- name: test disable user account idempotence - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: disabled - register: acc -- name: verify results of disable user account idempotence - assert: - that: - - acc|success - - not acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "disabled" - - acc.domain == "ROOT" - -- name: test lock disabled user account - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: locked - register: acc -- name: verify results of lock disabled user account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" - -- name: test lock disabled user account idempotence - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: locked - register: acc -- name: verify results of lock disabled user account idempotence - assert: - that: - - acc|success - - not acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" - -- name: test enable user account - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: enabled - register: acc -- name: verify results of enable user account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" - -- name: test enable user account idempotence - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: enabled - register: acc -- name: verify results of enable user account idempotence - assert: - that: - - acc|success - - not acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" - -- name: test remove user account - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: absent - register: acc -- name: verify results of remove user account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" - -- name: test remove user account idempotence - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: absent - register: acc -- name: verify results of remove user account idempotence - assert: - that: - - acc|success - - not acc|changed - -- name: test create user disabled account - cs_account: - name: "{{ cs_resource_prefix }}_user" - username: "{{ cs_resource_prefix }}_username" - password: "{{ cs_resource_prefix }}_password" - 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" - state: disabled - register: acc -- name: verify results of create disabled account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "disabled" - - acc.domain == "ROOT" - -- name: test remove disabled user account - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: absent - register: acc -- name: verify results of remove disabled user account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "disabled" - - acc.domain == "ROOT" - -- name: test create user locked account - cs_account: - name: "{{ cs_resource_prefix }}_user" - username: "{{ cs_resource_prefix }}_username" - password: "{{ cs_resource_prefix }}_password" - 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" - state: locked - register: acc -- name: verify results of create locked account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" - -- name: test remove locked user account - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: absent - register: acc -- name: verify results of remove locked user account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "locked" - - acc.domain == "ROOT" - -- name: test create user unlocked/enabled account - cs_account: - name: "{{ cs_resource_prefix }}_user" - username: "{{ cs_resource_prefix }}_username" - password: "{{ cs_resource_prefix }}_password" - 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" - state: unlocked - register: acc -- name: verify results of create unlocked/enabled account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" - -- name: test remove unlocked/enabled user account - cs_account: - name: "{{ cs_resource_prefix }}_user" - state: absent - register: acc -- name: verify results of remove unlocked/enabled user account - assert: - that: - - acc|success - - acc|changed - - acc.name == "{{ cs_resource_prefix }}_user" - - acc.network_domain == "{{ cs_resource_prefix }}.local" - - acc.account_type == "user" - - acc.state == "enabled" - - acc.domain == "ROOT" diff --git a/test/integration/roles/test_cs_affinitygroup/meta/main.yml b/test/integration/roles/test_cs_affinitygroup/meta/main.yml deleted file mode 100644 index 03e38bd4f7..0000000000 --- a/test/integration/roles/test_cs_affinitygroup/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - test_cs_common diff --git a/test/integration/roles/test_cs_affinitygroup/tasks/main.yml b/test/integration/roles/test_cs_affinitygroup/tasks/main.yml deleted file mode 100644 index b066bf4901..0000000000 --- a/test/integration/roles/test_cs_affinitygroup/tasks/main.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -- name: setup - cs_affinitygroup: name={{ cs_resource_prefix }}_ag state=absent - register: ag -- name: verify setup - assert: - that: - - ag|success - -- name: test fail if missing name - action: cs_affinitygroup - register: ag - ignore_errors: true -- name: verify results of fail if missing name - assert: - that: - - ag|failed - - "ag.msg == 'missing required arguments: name'" - -- name: test present affinity group - cs_affinitygroup: name={{ cs_resource_prefix }}_ag - register: ag -- name: verify results of create affinity group - assert: - that: - - ag|success - - ag|changed - - ag.name == "{{ cs_resource_prefix }}_ag" - -- name: test present affinity group is idempotence - cs_affinitygroup: name={{ cs_resource_prefix }}_ag - register: ag -- name: verify results present affinity group is idempotence - assert: - that: - - ag|success - - not ag|changed - - ag.name == "{{ cs_resource_prefix }}_ag" - -- name: test absent affinity group - cs_affinitygroup: name={{ cs_resource_prefix }}_ag state=absent - register: ag -- name: verify results of absent affinity group - assert: - that: - - ag|success - - ag|changed - - ag.name == "{{ cs_resource_prefix }}_ag" - -- name: test absent affinity group is idempotence - cs_affinitygroup: name={{ cs_resource_prefix }}_ag state=absent - register: ag -- name: verify results of absent affinity group is idempotence - assert: - that: - - ag|success - - not ag|changed - - ag.name is undefined diff --git a/test/integration/roles/test_cs_cluster/meta/main.yml b/test/integration/roles/test_cs_cluster/meta/main.yml deleted file mode 100644 index 03e38bd4f7..0000000000 --- a/test/integration/roles/test_cs_cluster/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - test_cs_common diff --git a/test/integration/roles/test_cs_cluster/tasks/main.yml b/test/integration/roles/test_cs_cluster/tasks/main.yml deleted file mode 100644 index bfaa09805d..0000000000 --- a/test/integration/roles/test_cs_cluster/tasks/main.yml +++ /dev/null @@ -1,211 +0,0 @@ ---- -- name: setup cluster is absent - cs_cluster: - name: "{{ cs_resource_prefix }}-cluster" - state: absent - register: cluster -- name: verify setup cluster is absent - assert: - that: - - cluster|success - -- name: setup zone is present - cs_zone: - name: "{{ cs_resource_prefix }}-zone" - dns1: 8.8.8.8 - dns2: 8.8.4.4 - network_type: basic - register: zone -- name: verify setup zone is present - assert: - that: - - zone|success - -- name: setup pod is preset - cs_pod: - name: "{{ cs_resource_prefix }}-pod" - zone: "{{ cs_resource_prefix }}-zone" - start_ip: 10.100.10.101 - gateway: 10.100.10.1 - netmask: 255.255.255.0 - register: pod -- name: verify setup pod is preset - assert: - that: - - pod|success - -- name: test fail if missing name - cs_cluster: - register: cluster - ignore_errors: true -- name: verify results of fail if missing name - assert: - that: - - cluster|failed - - "cluster.msg == 'missing required arguments: name'" - -- name: test create cluster - cs_cluster: - name: "{{ cs_resource_prefix }}-cluster" - zone: "{{ cs_resource_prefix }}-zone" - hypervisor: simulator - cluster_type: CloudManaged - register: cluster_origin - tags: disable -- name: verify test create cluster - assert: - that: - - cluster_origin|changed - - cluster_origin.name == "{{ cs_resource_prefix }}-cluster" - - cluster_origin.zone == "{{ cs_resource_prefix }}-zone" - - cluster_origin.allocation_state == "Enabled" - - cluster_origin.hypervisor == "Simulator" - - cluster_origin.cluster_type == "CloudManaged" - -- name: test create cluster idempotence - cs_cluster: - name: "{{ cs_resource_prefix }}-Cluster" - zone: "{{ cs_resource_prefix }}-Zone" - hypervisor: Simulator - cluster_type: CloudManaged - register: cluster -- name: verify test create cluster idempotence - assert: - that: - - cluster.id == cluster_origin.id - - not cluster|changed - - cluster.name == "{{ cs_resource_prefix }}-cluster" - - cluster.zone == "{{ cs_resource_prefix }}-zone" - - cluster.allocation_state == "Enabled" - - cluster_origin.hypervisor == "Simulator" - - cluster.cluster_type == "CloudManaged" - -- name: test update cluster - cs_cluster: - name: "{{ cs_resource_prefix }}-cluster" - zone: "{{ cs_resource_prefix }}-zone" - hypervisor: simulator - cluster_type: ExternalManaged - register: cluster -- name: verify test update cluster - assert: - that: - - cluster|changed - - cluster.name == "{{ cs_resource_prefix }}-cluster" - - cluster.zone == "{{ cs_resource_prefix }}-zone" - - cluster.allocation_state == "Enabled" - - cluster.hypervisor == "Simulator" - - cluster.cluster_type == "ExternalManaged" - - cluster.id == cluster_origin.id - -- name: test update cluster idempotence - cs_cluster: - name: "{{ cs_resource_prefix }}-cluster" - zone: "{{ cs_resource_prefix }}-zone" - hypervisor: simulator - cluster_type: ExternalManaged - register: cluster -- name: verify test update cluster idempotence - assert: - that: - - not cluster|changed - - cluster.name == "{{ cs_resource_prefix }}-cluster" - - cluster.zone == "{{ cs_resource_prefix }}-zone" - - cluster.allocation_state == "Enabled" - - cluster.hypervisor == "Simulator" - - cluster.cluster_type == "ExternalManaged" - - cluster.id == cluster_origin.id - -- name: test disable cluster - cs_cluster: - name: "{{ cs_resource_prefix }}-cluster" - state: disabled - register: cluster - tags: disable -- name: verify test disable cluster - assert: - that: - - cluster|changed - - cluster.name == "{{ cs_resource_prefix }}-cluster" - - cluster.zone == "{{ cs_resource_prefix }}-zone" - - cluster.allocation_state == "Disabled" - - cluster.hypervisor == "Simulator" - - cluster.cluster_type == "ExternalManaged" - - cluster.id == cluster_origin.id - tags: disable - -- name: test disable cluster idempotence - cs_cluster: - name: "{{ cs_resource_prefix }}-cluster" - state: disabled - register: cluster - tags: disable -- name: verify test disable cluster idempotence - assert: - that: - - not cluster|changed - - cluster.name == "{{ cs_resource_prefix }}-cluster" - - cluster.zone == "{{ cs_resource_prefix }}-zone" - - cluster.allocation_state == "Disabled" - - cluster.hypervisor == "Simulator" - - cluster.cluster_type == "ExternalManaged" - tags: disable - -- name: test enable cluster - cs_cluster: - name: "{{ cs_resource_prefix }}-cluster" - state: enabled - register: cluster -- name: verify test enable cluster - assert: - that: - - cluster|changed - - cluster.name == "{{ cs_resource_prefix }}-cluster" - - cluster.zone == "{{ cs_resource_prefix }}-zone" - - cluster.allocation_state == "Enabled" - - cluster.hypervisor == "Simulator" - - cluster.cluster_type == "ExternalManaged" - - cluster.id == cluster_origin.id - -- name: test enable cluster idempotence - cs_cluster: - name: "{{ cs_resource_prefix }}-cluster" - state: enabled - register: cluster -- name: verify test enable cluster idempotence - assert: - that: - - not cluster|changed - - cluster.name == "{{ cs_resource_prefix }}-cluster" - - cluster.zone == "{{ cs_resource_prefix }}-zone" - - cluster.allocation_state == "Enabled" - - cluster.hypervisor == "Simulator" - - cluster.cluster_type == "ExternalManaged" - - cluster.id == cluster_origin.id - -- name: test remove cluster - cs_cluster: - name: "{{ cs_resource_prefix }}-cluster" - zone: "{{ cs_resource_prefix }}-zone" - state: absent - register: cluster -- name: verify test remove cluster - assert: - that: - - cluster.id == cluster_origin.id - - cluster|changed - - cluster.name == "{{ cs_resource_prefix }}-cluster" - - cluster.zone == "{{ cs_resource_prefix }}-zone" - - cluster.allocation_state == "Enabled" - - cluster_origin.hypervisor == "Simulator" - -- name: test remove cluster idempotence - cs_cluster: - name: "{{ cs_resource_prefix }}-cluster" - zone: "{{ cs_resource_prefix }}-zone" - state: absent - register: cluster -- name: verify test remove cluster idempotence - assert: - that: - - not cluster|changed diff --git a/test/integration/roles/test_cs_domain/meta/main.yml b/test/integration/roles/test_cs_domain/meta/main.yml deleted file mode 100644 index 03e38bd4f7..0000000000 --- a/test/integration/roles/test_cs_domain/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - test_cs_common diff --git a/test/integration/roles/test_cs_domain/tasks/main.yml b/test/integration/roles/test_cs_domain/tasks/main.yml deleted file mode 100644 index 697a62f764..0000000000 --- a/test/integration/roles/test_cs_domain/tasks/main.yml +++ /dev/null @@ -1,112 +0,0 @@ ---- -- name: setup - cs_domain: path={{ cs_resource_prefix }}_domain state=absent - register: dom -- name: verify setup - assert: - that: - - dom|success - -- name: test fail if missing name - action: cs_domain - register: dom - ignore_errors: true -- name: verify results of fail if missing params - assert: - that: - - dom|failed - - 'dom.msg == "missing required arguments: path"' - -- name: test fail if ends with / - cs_domain: path={{ cs_resource_prefix }}_domain/ - register: dom - ignore_errors: true -- name: verify results of fail if ends with / - assert: - that: - - dom|failed - - dom.msg == "Path '{{ cs_resource_prefix }}_domain/' must not end with /" - -- name: test create a domain - cs_domain: path={{ cs_resource_prefix }}_domain - register: dom -- name: verify results of test create a domain - assert: - that: - - dom|changed - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain" - - dom.name == "{{ cs_resource_prefix }}_domain" - -- name: test create a domain idempotence - cs_domain: path={{ cs_resource_prefix }}_domain - register: dom -- name: verify results of test create a domain idempotence - assert: - that: - - not dom|changed - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain" - - dom.name == "{{ cs_resource_prefix }}_domain" - -- name: test create a subdomain - cs_domain: path=ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain - register: dom -- name: verify results of test create a domain - assert: - that: - - dom|changed - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain" - - dom.name == "{{ cs_resource_prefix }}_subdomain" - -- name: test create a subdomain idempotence - cs_domain: path=ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain - register: dom -- name: verify results of test create a subdomain idempotence - assert: - that: - - not dom|changed - -- name: test delete a subdomain - cs_domain: path=ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain state=absent - register: dom -- name: verify results of test delete a subdomain idempotence - assert: - that: - - dom|changed - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain" - - dom.name == "{{ cs_resource_prefix }}_subdomain" - -- name: test delete a subdomain idempotence - cs_domain: path=ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain state=absent - register: dom -- name: verify results of test delete a subdomain idempotence - assert: - that: - - not dom|changed - -- name: test create a subdomain 2 - cs_domain: path=ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain - register: dom -- name: verify results of test create a subdomain 2 - assert: - that: - - dom|changed - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain" - - dom.name == "{{ cs_resource_prefix }}_subdomain" - -- name: test delete a domain with clean up - cs_domain: path=ROOT/{{ cs_resource_prefix }}_domain state=absent clean_up=true - register: dom -- name: verify results of test delete a domain with clean up - assert: - that: - - dom|changed - - dom.path == "ROOT/{{ cs_resource_prefix }}_domain" - - dom.name == "{{ cs_resource_prefix }}_domain" - -- name: test delete a domain with clean up idempotence - cs_domain: path=ROOT/{{ cs_resource_prefix }}_domain state=absent clean_up=true - register: dom -- name: verify results of test delete a domain with clean up idempotence - assert: - that: - - not dom|changed diff --git a/test/integration/roles/test_cs_instancegroup/meta/main.yml b/test/integration/roles/test_cs_instancegroup/meta/main.yml deleted file mode 100644 index 03e38bd4f7..0000000000 --- a/test/integration/roles/test_cs_instancegroup/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - test_cs_common diff --git a/test/integration/roles/test_cs_instancegroup/tasks/main.yml b/test/integration/roles/test_cs_instancegroup/tasks/main.yml deleted file mode 100644 index d0f3c2258c..0000000000 --- a/test/integration/roles/test_cs_instancegroup/tasks/main.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -- name: setup - cs_instancegroup: name={{ cs_resource_prefix }}_ig state=absent - register: ig -- name: verify setup - assert: - that: - - ig|success - -- name: test fail if missing name - action: cs_instancegroup - register: ig - ignore_errors: true -- name: verify results of fail if missing name - assert: - that: - - ig|failed - - "ig.msg == 'missing required arguments: name'" - -- name: test present instance group - cs_instancegroup: name={{ cs_resource_prefix }}_ig - register: ig -- name: verify results of create instance group - assert: - that: - - ig|success - - ig|changed - - ig.name == "{{ cs_resource_prefix }}_ig" - -- name: test present instance group is idempotence - cs_instancegroup: name={{ cs_resource_prefix }}_ig - register: ig -- name: verify results present instance group is idempotence - assert: - that: - - ig|success - - not ig|changed - - ig.name == "{{ cs_resource_prefix }}_ig" - -- name: test absent instance group - cs_instancegroup: name={{ cs_resource_prefix }}_ig state=absent - register: ig -- name: verify results of absent instance group - assert: - that: - - ig|success - - ig|changed - - ig.name == "{{ cs_resource_prefix }}_ig" - -- name: test absent instance group is idempotence - cs_instancegroup: name={{ cs_resource_prefix }}_ig state=absent - register: ig -- name: verify results of absent instance group is idempotence - assert: - that: - - ig|success - - not ig|changed - - ig.name is undefined diff --git a/test/integration/roles/test_cs_project/meta/main.yml b/test/integration/roles/test_cs_project/meta/main.yml deleted file mode 100644 index 03e38bd4f7..0000000000 --- a/test/integration/roles/test_cs_project/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - test_cs_common diff --git a/test/integration/roles/test_cs_project/tasks/main.yml b/test/integration/roles/test_cs_project/tasks/main.yml deleted file mode 100644 index 0e2e2c1624..0000000000 --- a/test/integration/roles/test_cs_project/tasks/main.yml +++ /dev/null @@ -1,100 +0,0 @@ ---- -- name: ensure project does not exist - cs_project: - name: "{{ cs_resource_prefix }}-prj" - state: absent - register: prj -- name: verify project did not exist - assert: - that: - - prj|success - -- name: test create project - cs_project: - name: "{{ cs_resource_prefix }}-prj" - register: prj -- name: verify test create project - assert: - that: - - prj|changed - - prj.name == "{{ cs_resource_prefix }}-prj" - -- name: test create project idempotence - cs_project: - name: "{{ cs_resource_prefix }}-prj" - register: prj -- name: verify test create project idempotence - assert: - that: - - not prj|changed - - prj.name == "{{ cs_resource_prefix }}-prj" - -- name: test suspend project - cs_project: - name: "{{ cs_resource_prefix }}-prj" - state: suspended - register: prj -- name: verify test suspend project - assert: - that: - - prj|changed - - prj.name == "{{ cs_resource_prefix }}-prj" - - prj.state == "Suspended" - -- name: test suspend project idempotence - cs_project: - name: "{{ cs_resource_prefix }}-prj" - state: suspended - register: prj -- name: verify test suspend project idempotence - assert: - that: - - not prj|changed - - prj.name == "{{ cs_resource_prefix }}-prj" - - prj.state == "Suspended" - -- name: test activate project - cs_project: - name: "{{ cs_resource_prefix }}-prj" - state: active - register: prj -- name: verify test activate project - assert: - that: - - prj|changed - - prj.name == "{{ cs_resource_prefix }}-prj" - - prj.state == "Active" - -- name: test activate project idempotence - cs_project: - name: "{{ cs_resource_prefix }}-prj" - state: active - register: prj -- name: verify test activate project idempotence - assert: - that: - - not prj|changed - - prj.name == "{{ cs_resource_prefix }}-prj" - - prj.state == "Active" - -- name: test delete project - cs_project: - name: "{{ cs_resource_prefix }}-prj" - state: absent - register: prj -- name: verify test delete project - assert: - that: - - prj|changed - - prj.name == "{{ cs_resource_prefix }}-prj" - - prj.state == "Active" - -- name: test delete project idempotence - cs_project: - name: "{{ cs_resource_prefix }}-prj" - state: absent - register: prj -- name: verify test delete project idempotence - assert: - that: - - not prj|changed diff --git a/test/integration/roles/test_cs_resourcelimit/meta/main.yml b/test/integration/roles/test_cs_resourcelimit/meta/main.yml deleted file mode 100644 index 03e38bd4f7..0000000000 --- a/test/integration/roles/test_cs_resourcelimit/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - test_cs_common diff --git a/test/integration/roles/test_cs_resourcelimit/tasks/cpu.yml b/test/integration/roles/test_cs_resourcelimit/tasks/cpu.yml deleted file mode 100644 index 5faa6a9233..0000000000 --- a/test/integration/roles/test_cs_resourcelimit/tasks/cpu.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -- name: setup cpu limits account - cs_resourcelimit: - type: cpu - limit: 20 - account: "{{ cs_resource_prefix }}_user" - domain: "{{ cs_resource_prefix }}-domain" - register: rl -- name: verify setup cpu limits account - assert: - that: - - rl|success - - rl.domain == "{{ cs_resource_prefix }}-domain" - - rl.account == "{{ cs_resource_prefix }}_user" - - rl.limit == 20 - - rl.resource_type == "cpu" - -- name: set cpu limits for domain - cs_resourcelimit: - type: cpu - limit: 12 - domain: "{{ cs_resource_prefix }}-domain" - register: rl -- name: verify set cpu limits for domain - assert: - that: - - rl|changed - - rl.domain == "{{ cs_resource_prefix }}-domain" - - rl.limit == 12 - - rl.resource_type == "cpu" - -- name: set cpu limits for domain idempotence - cs_resourcelimit: - type: cpu - limit: 12 - domain: "{{ cs_resource_prefix }}-domain" - register: rl -- name: verify set cpu limits for domain - assert: - that: - - not rl|changed - - rl.domain == "{{ cs_resource_prefix }}-domain" - - rl.limit == 12 - - rl.resource_type == "cpu" - -- name: set cpu limits for account - cs_resourcelimit: - type: cpu - limit: 10 - account: "{{ cs_resource_prefix }}_user" - domain: "{{ cs_resource_prefix }}-domain" - register: rl -- name: verify set cpu limits for account - assert: - that: - - rl|changed - - rl.domain == "{{ cs_resource_prefix }}-domain" - - rl.account == "{{ cs_resource_prefix }}_user" - - rl.limit == 10 - - rl.resource_type == "cpu" - -- name: set cpu limits for account idempotence - cs_resourcelimit: - type: cpu - limit: 10 - account: "{{ cs_resource_prefix }}_user" - domain: "{{ cs_resource_prefix }}-domain" - register: rl -- name: verify set cpu limits for account idempotence - assert: - that: - - not rl|changed - - rl.domain == "{{ cs_resource_prefix }}-domain" - - rl.account == "{{ cs_resource_prefix }}_user" - - rl.limit == 10 - - rl.resource_type == "cpu" diff --git a/test/integration/roles/test_cs_resourcelimit/tasks/instance.yml b/test/integration/roles/test_cs_resourcelimit/tasks/instance.yml deleted file mode 100644 index 9fea9a3545..0000000000 --- a/test/integration/roles/test_cs_resourcelimit/tasks/instance.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -- name: setup instance limits account - cs_resourcelimit: - type: instance - limit: 20 - account: "{{ cs_resource_prefix }}_user" - domain: "{{ cs_resource_prefix }}-domain" - register: rl -- name: verify setup instance limits account - assert: - that: - - rl|success - - rl.domain == "{{ cs_resource_prefix }}-domain" - - rl.account == "{{ cs_resource_prefix }}_user" - - rl.limit == 20 - - rl.resource_type == "instance" - -- name: set instance limits for domain - cs_resourcelimit: - type: instance - limit: 12 - domain: "{{ cs_resource_prefix }}-domain" - register: rl -- name: verify set instance limits for domain - assert: - that: - - rl|changed - - rl.domain == "{{ cs_resource_prefix }}-domain" - - rl.limit == 12 - - rl.resource_type == "instance" - -- name: set instance limits for domain idempotence - cs_resourcelimit: - type: instance - limit: 12 - domain: "{{ cs_resource_prefix }}-domain" - register: rl -- name: verify set instance limits for domain - assert: - that: - - not rl|changed - - rl.domain == "{{ cs_resource_prefix }}-domain" - - rl.limit == 12 - - rl.resource_type == "instance" - -- name: set instance limits for account - cs_resourcelimit: - type: instance - limit: 10 - account: "{{ cs_resource_prefix }}_user" - domain: "{{ cs_resource_prefix }}-domain" - register: rl -- name: verify set instance limits for account - assert: - that: - - rl|changed - - rl.domain == "{{ cs_resource_prefix }}-domain" - - rl.account == "{{ cs_resource_prefix }}_user" - - rl.limit == 10 - - rl.resource_type == "instance" - -- name: set instance limits for account idempotence - cs_resourcelimit: - type: instance - limit: 10 - account: "{{ cs_resource_prefix }}_user" - domain: "{{ cs_resource_prefix }}-domain" - register: rl -- name: verify set instance limits for account idempotence - assert: - that: - - not rl|changed - - rl.domain == "{{ cs_resource_prefix }}-domain" - - rl.account == "{{ cs_resource_prefix }}_user" - - rl.limit == 10 - - rl.resource_type == "instance" diff --git a/test/integration/roles/test_cs_resourcelimit/tasks/main.yml b/test/integration/roles/test_cs_resourcelimit/tasks/main.yml deleted file mode 100644 index f662bb939a..0000000000 --- a/test/integration/roles/test_cs_resourcelimit/tasks/main.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- -- name: setup domain - cs_domain: path={{ cs_resource_prefix }}-domain - register: dom -- name: verify setup domain - assert: - that: - - dom|success - -- name: setup account - cs_account: - name: "{{ cs_resource_prefix }}_user" - username: "{{ cs_resource_prefix }}_username" - password: "{{ cs_resource_prefix }}_password" - 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" - domain: "{{ cs_resource_prefix }}-domain" - register: acc -- name: verify setup account - assert: - that: - - acc|success - -- name: test failed unkonwn type - cs_resourcelimit: - type: unkonwn - limit: 20 - domain: "{{ cs_resource_prefix }}-domain" - register: rl - ignore_errors: yes -- name: verify test failed unkonwn type - assert: - that: - - rl|failed - -- name: test failed missing type - cs_resourcelimit: - register: rl - ignore_errors: yes -- name: verify test failed missing type - assert: - that: - - rl|failed - -- name: setup resource limits domain - cs_resourcelimit: - type: instance - limit: 20 - domain: "{{ cs_resource_prefix }}-domain" - register: rl -- name: verify setup resource limits domain - assert: - that: - - rl|success - - rl.domain == "{{ cs_resource_prefix }}-domain" - - rl.limit == 20 - -- include: instance.yml -- include: cpu.yml diff --git a/test/integration/roles/test_cs_securitygroup/meta/main.yml b/test/integration/roles/test_cs_securitygroup/meta/main.yml deleted file mode 100644 index 03e38bd4f7..0000000000 --- a/test/integration/roles/test_cs_securitygroup/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - test_cs_common diff --git a/test/integration/roles/test_cs_securitygroup/tasks/main.yml b/test/integration/roles/test_cs_securitygroup/tasks/main.yml deleted file mode 100644 index de62ba150f..0000000000 --- a/test/integration/roles/test_cs_securitygroup/tasks/main.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -- name: setup - cs_securitygroup: name={{ cs_resource_prefix }}_sg state=absent - register: sg -- name: verify setup - assert: - that: - - sg|success - -- name: test fail if missing name - action: cs_securitygroup - register: sg - ignore_errors: true -- name: verify results of fail if missing name - assert: - that: - - sg|failed - - "sg.msg == 'missing required arguments: name'" - -- name: test present security group - cs_securitygroup: name={{ cs_resource_prefix }}_sg - register: sg -- name: verify results of create security group - assert: - that: - - sg|success - - sg|changed - - sg.name == "{{ cs_resource_prefix }}_sg" - -- name: test present security group is idempotence - cs_securitygroup: name={{ cs_resource_prefix }}_sg - register: sg -- name: verify results present security group is idempotence - assert: - that: - - sg|success - - not sg|changed - - sg.name == "{{ cs_resource_prefix }}_sg" - -- name: test absent security group - cs_securitygroup: name={{ cs_resource_prefix }}_sg state=absent - register: sg -- name: verify results of absent security group - assert: - that: - - sg|success - - sg|changed - - sg.name == "{{ cs_resource_prefix }}_sg" - -- name: test absent security group is idempotence - cs_securitygroup: name={{ cs_resource_prefix }}_sg state=absent - register: sg -- name: verify results of absent security group is idempotence - assert: - that: - - sg|success - - not sg|changed - - sg.name is undefined diff --git a/test/integration/roles/test_cs_securitygroup_rule/meta/main.yml b/test/integration/roles/test_cs_securitygroup_rule/meta/main.yml deleted file mode 100644 index 03e38bd4f7..0000000000 --- a/test/integration/roles/test_cs_securitygroup_rule/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - test_cs_common diff --git a/test/integration/roles/test_cs_securitygroup_rule/tasks/absent.yml b/test/integration/roles/test_cs_securitygroup_rule/tasks/absent.yml deleted file mode 100644 index 8ee080a8ae..0000000000 --- a/test/integration/roles/test_cs_securitygroup_rule/tasks/absent.yml +++ /dev/null @@ -1,105 +0,0 @@ -- name: test remove http range rule - cs_securitygroup_rule: - security_group: default - start_port: 8000 - end_port: 8888 - cidr: 1.2.3.4/32 - state: absent - register: sg_rule -- name: verify create http range rule - assert: - that: - - sg_rule|success - - sg_rule|changed - - sg_rule.type == 'ingress' - - sg_rule.security_group == 'default' - - sg_rule.protocol == 'tcp' - - sg_rule.start_port == 8000 - - sg_rule.end_port == 8888 - - sg_rule.cidr == '1.2.3.4/32' - -- name: test remove http range rule idempotence - cs_securitygroup_rule: - security_group: default - start_port: 8000 - end_port: 8888 - cidr: 1.2.3.4/32 - state: absent - register: sg_rule -- name: verify create http range rule idempotence - assert: - that: - - sg_rule|success - - not sg_rule|changed - -- name: test remove single port udp rule - cs_securitygroup_rule: - security_group: default - port: 5353 - protocol: udp - type: egress - user_security_group: '{{ cs_resource_prefix }}_sg' - state: absent - register: sg_rule -- name: verify remove single port udp rule - assert: - that: - - sg_rule|success - - sg_rule|changed - - sg_rule.type == 'egress' - - sg_rule.security_group == 'default' - - sg_rule.protocol == 'udp' - - sg_rule.start_port == 5353 - - sg_rule.end_port == 5353 - - sg_rule.user_security_group == '{{ cs_resource_prefix }}_sg' - -- name: test remove single port udp rule idempotence - cs_securitygroup_rule: - security_group: default - port: 5353 - protocol: udp - type: egress - user_security_group: '{{ cs_resource_prefix }}_sg' - state: absent - register: sg_rule -- name: verify remove single port udp rule idempotence - assert: - that: - - sg_rule|success - - not sg_rule|changed - -- name: test remove icmp rule - cs_securitygroup_rule: - security_group: default - protocol: icmp - type: ingress - icmp_type: -1 - icmp_code: -1 - state: absent - register: sg_rule -- name: verify icmp rule - assert: - that: - - sg_rule|success - - sg_rule|changed - - sg_rule.type == 'ingress' - - sg_rule.security_group == 'default' - - sg_rule.cidr == '0.0.0.0/0' - - sg_rule.protocol == 'icmp' - - sg_rule.icmp_code == -1 - - sg_rule.icmp_type == -1 - -- name: test remove icmp rule idempotence - cs_securitygroup_rule: - security_group: default - protocol: icmp - type: ingress - icmp_type: -1 - icmp_code: -1 - state: absent - register: sg_rule -- name: verify icmp rule idempotence - assert: - that: - - sg_rule|success - - not sg_rule|changed diff --git a/test/integration/roles/test_cs_securitygroup_rule/tasks/cleanup.yml b/test/integration/roles/test_cs_securitygroup_rule/tasks/cleanup.yml deleted file mode 100644 index 712ab5c6ce..0000000000 --- a/test/integration/roles/test_cs_securitygroup_rule/tasks/cleanup.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: cleanup custom security group - cs_securitygroup: name={{ cs_resource_prefix }}_sg state=absent - register: sg -- name: verify setup - assert: - that: - - sg|success diff --git a/test/integration/roles/test_cs_securitygroup_rule/tasks/main.yml b/test/integration/roles/test_cs_securitygroup_rule/tasks/main.yml deleted file mode 100644 index e76745cb54..0000000000 --- a/test/integration/roles/test_cs_securitygroup_rule/tasks/main.yml +++ /dev/null @@ -1,4 +0,0 @@ -- include: setup.yml -- include: present.yml -- include: absent.yml -- include: cleanup.yml diff --git a/test/integration/roles/test_cs_securitygroup_rule/tasks/present.yml b/test/integration/roles/test_cs_securitygroup_rule/tasks/present.yml deleted file mode 100644 index 3eed928736..0000000000 --- a/test/integration/roles/test_cs_securitygroup_rule/tasks/present.yml +++ /dev/null @@ -1,118 +0,0 @@ -- name: test create http range rule - cs_securitygroup_rule: - security_group: default - start_port: 8000 - end_port: 8888 - cidr: 1.2.3.4/32 - register: sg_rule -- name: verify create http range rule - assert: - that: - - sg_rule|success - - sg_rule|changed - - sg_rule.type == 'ingress' - - sg_rule.security_group == 'default' - - sg_rule.protocol == 'tcp' - - sg_rule.start_port == 8000 - - sg_rule.end_port == 8888 - - sg_rule.cidr == '1.2.3.4/32' - -- name: test create http range rule idempotence - cs_securitygroup_rule: - security_group: default - start_port: 8000 - end_port: 8888 - cidr: 1.2.3.4/32 - register: sg_rule -- name: verify create http range rule idempotence - assert: - that: - - sg_rule|success - - not sg_rule|changed - - sg_rule.type == 'ingress' - - sg_rule.security_group == 'default' - - sg_rule.protocol == 'tcp' - - sg_rule.start_port == 8000 - - sg_rule.end_port == 8888 - - sg_rule.cidr == '1.2.3.4/32' - -- name: test create single port udp rule - cs_securitygroup_rule: - security_group: default - port: 5353 - protocol: udp - type: egress - user_security_group: '{{ cs_resource_prefix }}_sg' - register: sg_rule -- name: verify create single port udp rule - assert: - that: - - sg_rule|success - - sg_rule|changed - - sg_rule.type == 'egress' - - sg_rule.security_group == 'default' - - sg_rule.protocol == 'udp' - - sg_rule.start_port == 5353 - - sg_rule.end_port == 5353 - - sg_rule.user_security_group == '{{ cs_resource_prefix }}_sg' - - -- name: test single port udp rule idempotence - cs_securitygroup_rule: - security_group: default - port: 5353 - protocol: udp - type: egress - user_security_group: '{{ cs_resource_prefix }}_sg' - register: sg_rule -- name: verify single port udp rule idempotence - assert: - that: - - sg_rule|success - - not sg_rule|changed - - sg_rule.type == 'egress' - - sg_rule.security_group == 'default' - - sg_rule.protocol == 'udp' - - sg_rule.start_port == 5353 - - sg_rule.end_port == 5353 - - sg_rule.user_security_group == '{{ cs_resource_prefix }}_sg' - -- name: test icmp rule - cs_securitygroup_rule: - security_group: default - protocol: icmp - type: ingress - icmp_type: -1 - icmp_code: -1 - register: sg_rule -- name: verify icmp rule - assert: - that: - - sg_rule|success - - sg_rule|changed - - sg_rule.type == 'ingress' - - sg_rule.security_group == 'default' - - sg_rule.cidr == '0.0.0.0/0' - - sg_rule.protocol == 'icmp' - - sg_rule.icmp_code == -1 - - sg_rule.icmp_type == -1 - -- name: test icmp rule idempotence - cs_securitygroup_rule: - security_group: default - protocol: icmp - type: ingress - icmp_type: -1 - icmp_code: -1 - register: sg_rule -- name: verify icmp rule idempotence - assert: - that: - - sg_rule|success - - not sg_rule|changed - - sg_rule.type == 'ingress' - - sg_rule.security_group == 'default' - - sg_rule.cidr == '0.0.0.0/0' - - sg_rule.protocol == 'icmp' - - sg_rule.icmp_code == -1 - - sg_rule.icmp_type == -1 diff --git a/test/integration/roles/test_cs_securitygroup_rule/tasks/setup.yml b/test/integration/roles/test_cs_securitygroup_rule/tasks/setup.yml deleted file mode 100644 index 797330ebc1..0000000000 --- a/test/integration/roles/test_cs_securitygroup_rule/tasks/setup.yml +++ /dev/null @@ -1,56 +0,0 @@ -- name: setup custom security group - cs_securitygroup: name={{ cs_resource_prefix }}_sg - register: sg -- name: verify setup - assert: - that: - - sg|success - -- name: setup default security group - cs_securitygroup: name=default - register: sg -- name: verify setup - assert: - that: - - sg|success - -- name: setup remove icmp rule - cs_securitygroup_rule: - security_group: default - protocol: icmp - type: ingress - icmp_type: -1 - icmp_code: -1 - state: absent - register: sg_rule -- name: verify remove icmp rule - assert: - that: - - sg_rule|success - -- name: setup remove http range rule - cs_securitygroup_rule: - security_group: default - start_port: 8000 - end_port: 8888 - cidr: 1.2.3.4/32 - state: absent - register: sg_rule -- name: verify remove http range rule - assert: - that: - - sg_rule|success - -- name: setup remove single port udp rule - cs_securitygroup_rule: - security_group: default - port: 5353 - protocol: udp - type: egress - user_security_group: '{{ cs_resource_prefix }}-user-sg' - state: absent - register: sg_rule -- name: verify remove single port udp rule - assert: - that: - - sg_rule|success diff --git a/test/integration/roles/test_cs_user/meta/main.yml b/test/integration/roles/test_cs_user/meta/main.yml deleted file mode 100644 index 03e38bd4f7..0000000000 --- a/test/integration/roles/test_cs_user/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - test_cs_common diff --git a/test/integration/roles/test_cs_user/tasks/main.yml b/test/integration/roles/test_cs_user/tasks/main.yml deleted file mode 100644 index e88612bc21..0000000000 --- a/test/integration/roles/test_cs_user/tasks/main.yml +++ /dev/null @@ -1,396 +0,0 @@ ---- -- name: setup - cs_user: username={{ cs_resource_prefix }}_user state=absent - register: user -- name: verify setup - assert: - that: - - user|success - -- name: test fail if missing username - action: cs_user - register: user - ignore_errors: true -- name: verify results of fail if missing params - assert: - that: - - user|failed - - 'user.msg == "missing required arguments: username"' - -- name: test fail if missing params if state=present - cs_user: - username: "{{ cs_resource_prefix }}_user" - register: user - ignore_errors: true -- name: verify results of fail if missing params if state=present - assert: - that: - - user|failed - - 'user.msg == "missing required arguments: account,email,password,first_name,last_name"' - -- name: test create user - cs_user: - username: "{{ cs_resource_prefix }}_user" - password: "{{ cs_resource_prefix }}_password" - last_name: "{{ cs_resource_prefix }}_last_name" - first_name: "{{ cs_resource_prefix }}_first_name" - email: "{{ cs_resource_prefix }}@example.com" - account: "admin" - register: user -- name: verify results of create user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.first_name == "{{ cs_resource_prefix }}_first_name" - - user.last_name == "{{ cs_resource_prefix }}_last_name" - - user.email == "{{ cs_resource_prefix }}@example.com" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "enabled" - - user.domain == "ROOT" - -- name: test create user idempotence - cs_user: - username: "{{ cs_resource_prefix }}_user" - password: "{{ cs_resource_prefix }}_password" - last_name: "{{ cs_resource_prefix }}_last_name" - first_name: "{{ cs_resource_prefix }}_first_name" - email: "{{ cs_resource_prefix }}@example.com" - account: "admin" - register: user -- name: verify results of create user idempotence - assert: - that: - - user|success - - not user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.first_name == "{{ cs_resource_prefix }}_first_name" - - user.last_name == "{{ cs_resource_prefix }}_last_name" - - user.email == "{{ cs_resource_prefix }}@example.com" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "enabled" - - user.domain == "ROOT" - -- name: test update user - cs_user: - username: "{{ cs_resource_prefix }}_user" - password: "{{ cs_resource_prefix }}_password" - last_name: "{{ cs_resource_prefix }}_last_name1" - first_name: "{{ cs_resource_prefix }}_first_name1" - email: "{{ cs_resource_prefix }}@example.com1" - account: "admin" - register: user -- name: verify results of update user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.first_name == "{{ cs_resource_prefix }}_first_name1" - - user.last_name == "{{ cs_resource_prefix }}_last_name1" - - user.email == "{{ cs_resource_prefix }}@example.com1" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "enabled" - - user.domain == "ROOT" - -- name: test update user idempotence - cs_user: - username: "{{ cs_resource_prefix }}_user" - password: "{{ cs_resource_prefix }}_password" - last_name: "{{ cs_resource_prefix }}_last_name1" - first_name: "{{ cs_resource_prefix }}_first_name1" - email: "{{ cs_resource_prefix }}@example.com1" - account: "admin" - register: user -- name: verify results of update user idempotence - assert: - that: - - user|success - - not user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.first_name == "{{ cs_resource_prefix }}_first_name1" - - user.last_name == "{{ cs_resource_prefix }}_last_name1" - - user.email == "{{ cs_resource_prefix }}@example.com1" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "enabled" - - user.domain == "ROOT" - -- name: test lock user - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: locked - register: user -- name: verify results of lock user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "locked" - - user.domain == "ROOT" - -- name: test lock user idempotence - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: locked - register: user -- name: verify results of lock user idempotence - assert: - that: - - user|success - - not user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "locked" - - user.domain == "ROOT" - -- name: test disable user - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: disabled - register: user -- name: verify results of disable user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "disabled" - - user.domain == "ROOT" - -- name: test disable user idempotence - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: disabled - register: user -- name: verify results of disable user idempotence - assert: - that: - - user|success - - not user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "disabled" - - user.domain == "ROOT" - -- name: test lock disabled user - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: locked - register: user -- name: verify results of lock disabled user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "locked" - - user.domain == "ROOT" - -- name: test lock disabled user idempotence - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: locked - register: user -- name: verify results of lock disabled user idempotence - assert: - that: - - user|success - - not user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "locked" - - user.domain == "ROOT" - -- name: test enable user - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: enabled - register: user -- name: verify results of enable user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "enabled" - - user.domain == "ROOT" - -- name: test enable user idempotence using unlocked - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: unlocked - register: user -- name: verify results of enable user idempotence - assert: - that: - - user|success - - not user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "enabled" - - user.domain == "ROOT" - -- name: test remove user - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: absent - register: user -- name: verify results of remove user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "enabled" - - user.domain == "ROOT" - -- name: test remove user idempotence - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: absent - register: user -- name: verify results of remove user idempotence - assert: - that: - - user|success - - not user|changed - -- name: test create locked user - cs_user: - username: "{{ cs_resource_prefix }}_user" - password: "{{ cs_resource_prefix }}_password" - last_name: "{{ cs_resource_prefix }}_last_name" - first_name: "{{ cs_resource_prefix }}_first_name" - email: "{{ cs_resource_prefix }}@example.com" - account: "admin" - state: locked - register: user -- name: verify results of create locked user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.first_name == "{{ cs_resource_prefix }}_first_name" - - user.last_name == "{{ cs_resource_prefix }}_last_name" - - user.email == "{{ cs_resource_prefix }}@example.com" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "locked" - - user.domain == "ROOT" - -- name: test remove locked user - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: absent - register: user -- name: verify results of remove locked user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "locked" - - user.domain == "ROOT" - -- name: test create disabled user - cs_user: - username: "{{ cs_resource_prefix }}_user" - password: "{{ cs_resource_prefix }}_password" - last_name: "{{ cs_resource_prefix }}_last_name" - first_name: "{{ cs_resource_prefix }}_first_name" - email: "{{ cs_resource_prefix }}@example.com" - account: "admin" - state: disabled - register: user -- name: verify results of create disabled user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.first_name == "{{ cs_resource_prefix }}_first_name" - - user.last_name == "{{ cs_resource_prefix }}_last_name" - - user.email == "{{ cs_resource_prefix }}@example.com" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "disabled" - - user.domain == "ROOT" - -- name: test remove disabled user - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: absent - register: user -- name: verify results of remove disabled user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "disabled" - - user.domain == "ROOT" - -- name: test create enabled user - cs_user: - username: "{{ cs_resource_prefix }}_user" - password: "{{ cs_resource_prefix }}_password" - last_name: "{{ cs_resource_prefix }}_last_name" - first_name: "{{ cs_resource_prefix }}_first_name" - email: "{{ cs_resource_prefix }}@example.com" - account: "admin" - state: enabled - register: user -- name: verify results of create enabled user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.first_name == "{{ cs_resource_prefix }}_first_name" - - user.last_name == "{{ cs_resource_prefix }}_last_name" - - user.email == "{{ cs_resource_prefix }}@example.com" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "enabled" - - user.domain == "ROOT" - -- name: test remove enabled user - cs_user: - username: "{{ cs_resource_prefix }}_user" - state: absent - register: user -- name: verify results of remove enabled user - assert: - that: - - user|success - - user|changed - - user.username == "{{ cs_resource_prefix }}_user" - - user.account_type == "root_admin" - - user.account == "admin" - - user.state == "enabled" - - user.domain == "ROOT" diff --git a/test/integration/roles/test_ec2_ami/defaults/main.yml b/test/integration/roles/test_ec2_ami/defaults/main.yml deleted file mode 100644 index ec51507c21..0000000000 --- a/test/integration/roles/test_ec2_ami/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for test_ec2_ami diff --git a/test/integration/roles/test_ec2_ami/meta/main.yml b/test/integration/roles/test_ec2_ami/meta/main.yml deleted file mode 100644 index 1f64f1169a..0000000000 --- a/test/integration/roles/test_ec2_ami/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - prepare_tests - - setup_ec2 diff --git a/test/integration/roles/test_ec2_ami/tasks/main.yml b/test/integration/roles/test_ec2_ami/tasks/main.yml deleted file mode 100644 index 523d465c34..0000000000 --- a/test/integration/roles/test_ec2_ami/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# tasks file for test_ec2_ami diff --git a/test/integration/roles/test_ec2_ami/vars/main.yml b/test/integration/roles/test_ec2_ami/vars/main.yml deleted file mode 100644 index edb7a0b7cc..0000000000 --- a/test/integration/roles/test_ec2_ami/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for test_ec2_ami diff --git a/test/integration/roles/test_ec2_elb_lb/defaults/main.yml b/test/integration/roles/test_ec2_elb_lb/defaults/main.yml deleted file mode 100644 index 76164523d4..0000000000 --- a/test/integration/roles/test_ec2_elb_lb/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# defaults file for test_ec2_eip -tag_prefix: '{{resource_prefix}}' diff --git a/test/integration/roles/test_ec2_elb_lb/meta/main.yml b/test/integration/roles/test_ec2_elb_lb/meta/main.yml deleted file mode 100644 index 1f64f1169a..0000000000 --- a/test/integration/roles/test_ec2_elb_lb/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - prepare_tests - - setup_ec2 diff --git a/test/integration/roles/test_ec2_elb_lb/tasks/main.yml b/test/integration/roles/test_ec2_elb_lb/tasks/main.yml deleted file mode 100644 index b18d6b4f6c..0000000000 --- a/test/integration/roles/test_ec2_elb_lb/tasks/main.yml +++ /dev/null @@ -1,424 +0,0 @@ ---- -# __Test Info__ -# Create a self signed cert and upload it to AWS -# http://www.akadia.com/services/ssh_test_certificate.html -# http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/ssl-server-cert.html - -# __Test Outline__ -# -# __ec2_elb_lb__ -# create test elb with listeners and certificate -# change AZ's -# change listeners -# remove listeners -# remove elb - -# __ec2-common__ -# test environment variable EC2_REGION -# test with no parameters -# test with only instance_id -# test invalid region parameter -# test valid region parameter -# test invalid ec2_url parameter -# test valid ec2_url parameter -# test credentials from environment -# test credential parameters - -- block: - - # ============================================================ - # create test elb with listeners, certificate, and health check - - - name: Create ELB - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: "{{ ec2_region }}" - ec2_access_key: "{{ ec2_access_key }}" - ec2_secret_key: "{{ ec2_secret_key }}" - security_token: "{{ security_token }}" - state: present - zones: - - us-east-1c - - us-east-1d - listeners: - - protocol: http - load_balancer_port: 80 - instance_port: 80 - - protocol: http - load_balancer_port: 8080 - instance_port: 8080 - health_check: - ping_protocol: http - ping_port: 80 - ping_path: "/index.html" - response_timeout: 5 - interval: 30 - unhealthy_threshold: 2 - healthy_threshold: 10 - register: info - - - assert: - that: - - 'info.changed' - - '"failed" not in info' - - 'info.elb.status == "created"' - - '"us-east-1c" in info.elb.zones' - - '"us-east-1d" in info.elb.zones' - - 'info.elb.health_check.healthy_threshold == 10' - - 'info.elb.health_check.interval == 30' - - 'info.elb.health_check.target == "HTTP:80/index.html"' - - 'info.elb.health_check.timeout == 5' - - 'info.elb.health_check.unhealthy_threshold == 2' - - '[80, 80, "HTTP", "HTTP"] in info.elb.listeners' - - '[8080, 8080, "HTTP", "HTTP"] in info.elb.listeners' - - # ============================================================ - - # check ports, would be cool, but we are at the mercy of AWS - # to start things in a timely manner - - #- name: check to make sure 80 is listening - # wait_for: host={{ info.elb.dns_name }} port=80 timeout=600 - # register: result - - #- name: assert can connect to port# - # assert: 'result.state == "started"' - - #- name: check to make sure 443 is listening - # wait_for: host={{ info.elb.dns_name }} port=443 timeout=600 - # register: result - - #- name: assert can connect to port# - # assert: 'result.state == "started"' - - # ============================================================ - - # Change AZ's - - - name: Change AZ's - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: "{{ ec2_region }}" - ec2_access_key: "{{ ec2_access_key }}" - ec2_secret_key: "{{ ec2_secret_key }}" - security_token: "{{ security_token }}" - state: present - zones: - - us-east-1b - listeners: - - protocol: http - load_balancer_port: 80 - instance_port: 80 - purge_zones: yes - health_check: - ping_protocol: http - ping_port: 80 - ping_path: "/index.html" - response_timeout: 5 - interval: 30 - unhealthy_threshold: 2 - healthy_threshold: 10 - register: info - - - - - assert: - that: - - '"failed" not in info' - - 'info.elb.status == "ok"' - - 'info.changed' - - 'info.elb.zones[0] == "us-east-1b"' - - # ============================================================ - - # Update AZ's - - - name: Update AZ's - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: "{{ ec2_region }}" - ec2_access_key: "{{ ec2_access_key }}" - ec2_secret_key: "{{ ec2_secret_key }}" - security_token: "{{ security_token }}" - state: present - zones: - - us-east-1b - - us-east-1c - - us-east-1d - listeners: - - protocol: http - load_balancer_port: 80 - instance_port: 80 - purge_zones: yes - register: info - - - assert: - that: - - '"failed" not in info' - - 'info.changed' - - 'info.elb.status == "ok"' - - '"us-east-1b" in info.elb.zones' - - '"us-east-1c" in info.elb.zones' - - '"us-east-1d" in info.elb.zones' - - - # ============================================================ - - # Purge Listeners - - - name: Purge Listeners - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: "{{ ec2_region }}" - ec2_access_key: "{{ ec2_access_key }}" - ec2_secret_key: "{{ ec2_secret_key }}" - security_token: "{{ security_token }}" - state: present - zones: - - us-east-1b - - us-east-1c - - us-east-1d - listeners: - - protocol: http - load_balancer_port: 80 - instance_port: 81 - purge_listeners: yes - register: info - - - assert: - that: - - '"failed" not in info' - - 'info.elb.status == "ok"' - - 'info.changed' - - '[80, 81, "HTTP", "HTTP"] in info.elb.listeners' - - 'info.elb.listeners|length == 1' - - - - # ============================================================ - - # add Listeners - - - name: Add Listeners - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: "{{ ec2_region }}" - ec2_access_key: "{{ ec2_access_key }}" - ec2_secret_key: "{{ ec2_secret_key }}" - security_token: "{{ security_token }}" - state: present - zones: - - us-east-1b - - us-east-1c - - us-east-1d - listeners: - - protocol: http - load_balancer_port: 8081 - instance_port: 8081 - purge_listeners: no - register: info - - - assert: - that: - - '"failed" not in info' - - 'info.elb.status == "ok"' - - 'info.changed' - - '[80, 81, "HTTP", "HTTP"] in info.elb.listeners' - - '[8081, 8081, "HTTP", "HTTP"] in info.elb.listeners' - - 'info.elb.listeners|length == 2' - - - # ============================================================ - - - name: test with no parameters - ec2_elb_lb: - register: result - ignore_errors: true - - - name: assert failure when called with no parameters - assert: - that: - - 'result.failed' - - 'result.msg == "missing required arguments: name,state"' - - - - # ============================================================ - - name: test with only name - ec2_elb_lb: - name="{{ tag_prefix }}" - register: result - ignore_errors: true - - - name: assert failure when called with only name - assert: - that: - - 'result.failed' - - 'result.msg == "missing required arguments: state"' - - - # ============================================================ - - name: test invalid region parameter - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: 'asdf querty 1234' - state: present - listeners: - - protocol: http - load_balancer_port: 80 - instance_port: 80 - zones: - - us-east-1c - - us-east-1d - register: result - ignore_errors: true - - - name: assert invalid region parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("Region asdf querty 1234 does not seem to be available ")' - - - # ============================================================ - - name: test valid region parameter - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: "{{ ec2_region }}" - state: present - zones: - - us-east-1a - - us-east-1d - listeners: - - protocol: http - load_balancer_port: 80 - instance_port: 80 - - register: result - ignore_errors: true - - - name: assert valid region parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - - - # ============================================================ - - - name: test invalid ec2_url parameter - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: "{{ ec2_region }}" - state: present - zones: - - us-east-1a - - us-east-1d - listeners: - - protocol: http - load_balancer_port: 80 - instance_port: 80 - environment: - EC2_URL: bogus.example.com - register: result - ignore_errors: true - - - name: assert invalid ec2_url parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - - - # ============================================================ - - name: test valid ec2_url parameter - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: "{{ ec2_region }}" - state: present - zones: - - us-east-1a - - us-east-1d - listeners: - - protocol: http - load_balancer_port: 80 - instance_port: 80 - environment: - EC2_URL: '{{ec2_url}}' - register: result - ignore_errors: true - - - name: assert valid ec2_url parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - - - # ============================================================ - - name: test credentials from environment - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: "{{ ec2_region }}" - state: present - zones: - - us-east-1a - - us-east-1d - listeners: - - protocol: http - load_balancer_port: 80 - instance_port: 80 - environment: - EC2_ACCESS_KEY: bogus_access_key - EC2_SECRET_KEY: bogus_secret_key - register: result - ignore_errors: true - - - name: assert credentials from environment - assert: - that: - - 'result.failed' - - '"InvalidClientTokenId" in result.exception' - - - # ============================================================ - - name: test credential parameters - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: "{{ ec2_region }}" - state: present - zones: - - us-east-1a - - us-east-1d - listeners: - - protocol: http - load_balancer_port: 80 - instance_port: 80 - register: result - ignore_errors: true - - - name: assert credential parameters - assert: - that: - - 'result.failed' - - '"No handler was ready to authenticate. 1 handlers were checked." in result.msg' - - always: - - # ============================================================ - - name: remove the test load balancer completely - ec2_elb_lb: - name: "{{ tag_prefix }}" - region: "{{ ec2_region }}" - state: absent - ec2_access_key: "{{ ec2_access_key }}" - ec2_secret_key: "{{ ec2_secret_key }}" - security_token: "{{ security_token }}" - register: result - - - name: assert the load balancer was removed - assert: - that: - - 'result.changed' - - 'result.elb.name == "{{tag_prefix}}"' - - 'result.elb.status == "deleted"' diff --git a/test/integration/roles/test_ec2_elb_lb/vars/main.yml b/test/integration/roles/test_ec2_elb_lb/vars/main.yml deleted file mode 100644 index 79194af1ef..0000000000 --- a/test/integration/roles/test_ec2_elb_lb/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for test_ec2_elb_lb diff --git a/test/integration/roles/test_ec2_facts/defaults/main.yml b/test/integration/roles/test_ec2_facts/defaults/main.yml deleted file mode 100644 index c25743914a..0000000000 --- a/test/integration/roles/test_ec2_facts/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for test_ec2_facts diff --git a/test/integration/roles/test_ec2_facts/meta/main.yml b/test/integration/roles/test_ec2_facts/meta/main.yml deleted file mode 100644 index 1f64f1169a..0000000000 --- a/test/integration/roles/test_ec2_facts/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - prepare_tests - - setup_ec2 diff --git a/test/integration/roles/test_ec2_facts/tasks/main.yml b/test/integration/roles/test_ec2_facts/tasks/main.yml deleted file mode 100644 index 8ea9fcf1f8..0000000000 --- a/test/integration/roles/test_ec2_facts/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# tasks file for test_ec2_facts diff --git a/test/integration/roles/test_ec2_facts/vars/main.yml b/test/integration/roles/test_ec2_facts/vars/main.yml deleted file mode 100644 index bb8f6c1875..0000000000 --- a/test/integration/roles/test_ec2_facts/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for test_ec2_facts diff --git a/test/integration/roles/test_ec2_group/defaults/main.yml b/test/integration/roles/test_ec2_group/defaults/main.yml deleted file mode 100644 index a48051eac7..0000000000 --- a/test/integration/roles/test_ec2_group/defaults/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# defaults file for test_ec2_group -ec2_group_name: '{{resource_prefix}}' -ec2_group_description: 'Created by ansible integration tests' diff --git a/test/integration/roles/test_ec2_group/meta/main.yml b/test/integration/roles/test_ec2_group/meta/main.yml deleted file mode 100644 index 1f64f1169a..0000000000 --- a/test/integration/roles/test_ec2_group/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - prepare_tests - - setup_ec2 diff --git a/test/integration/roles/test_ec2_group/tasks/main.yml b/test/integration/roles/test_ec2_group/tasks/main.yml deleted file mode 100644 index 4e5ae3f991..0000000000 --- a/test/integration/roles/test_ec2_group/tasks/main.yml +++ /dev/null @@ -1,287 +0,0 @@ ---- -# A Note about ec2 environment variable name preference: -# - EC2_URL -> AWS_URL -# - EC2_ACCESS_KEY -> AWS_ACCESS_KEY_ID -> AWS_ACCESS_KEY -# - EC2_SECRET_KEY -> AWS_SECRET_ACCESS_KEY -> AWX_SECRET_KEY -# - EC2_REGION -> AWS_REGION -# - -# - include: ../../setup_ec2/tasks/common.yml module_name=ec2_group - -- block: - - # ============================================================ - - name: test failure with no parameters - ec2_group: - register: result - ignore_errors: true - - - name: assert failure with no parameters - assert: - that: - - 'result.failed' - - 'result.msg == "missing required arguments: name"' - - # ============================================================ - - name: test failure with only name - ec2_group: - name='{{ec2_group_name}}' - register: result - ignore_errors: true - - - name: assert failure with only name - assert: - that: - - 'result.failed' - - 'result.msg == "Must provide description when state is present."' - - # ============================================================ - - name: test failure with only description - ec2_group: - description='{{ec2_group_description}}' - register: result - ignore_errors: true - - - name: assert failure with only description - assert: - that: - - 'result.failed' - - 'result.msg == "missing required arguments: name"' - - # ============================================================ - - name: test failure with empty description (AWS API requires non-empty string desc) - ec2_group: - name='{{ec2_group_name}}' - description='' - region='{{ec2_region}}' - register: result - ignore_errors: true - - - name: assert failure with empty description - assert: - that: - - 'result.failed' - - 'result.msg == "Must provide description when state is present."' - - # ============================================================ - - name: test invalid region parameter - ec2_group: - name='{{ec2_group_name}}' - description='{{ec2_group_description}}' - region='asdf querty 1234' - register: result - ignore_errors: true - - - name: assert invalid region parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("Region asdf querty 1234 does not seem to be available for aws module boto.ec2. If the region definitely exists, you may need to upgrade boto or extend with endpoints_path")' - - # ============================================================ - - name: test valid region parameter - ec2_group: - name='{{ec2_group_name}}' - description='{{ec2_group_description}}' - region='{{ec2_region}}' - register: result - ignore_errors: true - - - name: assert valid region parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - - # ============================================================ - - name: test environment variable EC2_REGION - ec2_group: - name='{{ec2_group_name}}' - description='{{ec2_group_description}}' - environment: - EC2_REGION: '{{ec2_region}}' - register: result - ignore_errors: true - - - name: assert environment variable EC2_REGION - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - - # ============================================================ - - name: test invalid ec2_url parameter - ec2_group: - name='{{ec2_group_name}}' - description='{{ec2_group_description}}' - environment: - EC2_URL: bogus.example.com - register: result - ignore_errors: true - - - name: assert invalid ec2_url parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - - # ============================================================ - - name: test valid ec2_url parameter - ec2_group: - name='{{ec2_group_name}}' - description='{{ec2_group_description}}' - environment: - EC2_URL: '{{ec2_url}}' - register: result - ignore_errors: true - - - name: assert valid ec2_url parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - - # ============================================================ - - name: test credentials from environment - ec2_group: - name='{{ec2_group_name}}' - description='{{ec2_group_description}}' - environment: - EC2_REGION: '{{ec2_region}}' - EC2_ACCESS_KEY: bogus_access_key - EC2_SECRET_KEY: bogus_secret_key - register: result - ignore_errors: true - - - name: assert ec2_group with valid ec2_url - assert: - that: - - 'result.failed' - - '"Error in get_all_security_groups: AWS was not able to validate the provided access credentials" in result.msg' - - # ============================================================ - - name: test credential parameters - ec2_group: - name='{{ec2_group_name}}' - description='{{ec2_group_description}}' - ec2_region='{{ec2_region}}' - ec2_access_key='bogus_access_key' - ec2_secret_key='bogus_secret_key' - register: result - ignore_errors: true - - - name: assert credential parameters - assert: - that: - - 'result.failed' - - '"Error in get_all_security_groups: AWS was not able to validate the provided access credentials" in result.msg' - - # ============================================================ - - name: test state=absent - ec2_group: - name='{{ec2_group_name}}' - description='{{ec2_group_description}}' - ec2_region='{{ec2_region}}' - ec2_access_key='{{ec2_access_key}}' - ec2_secret_key='{{ec2_secret_key}}' - security_token='{{security_token}}' - state=absent - register: result - - - name: assert state=absent - assert: - that: - - '"failed" not in result' - - # ============================================================ - - name: test state=present (expected changed=true) - ec2_group: - name='{{ec2_group_name}}' - description='{{ec2_group_description}}' - ec2_region='{{ec2_region}}' - ec2_access_key='{{ec2_access_key}}' - ec2_secret_key='{{ec2_secret_key}}' - security_token='{{security_token}}' - state=present - register: result - - - name: assert state=present (expected changed=true) - assert: - that: - - 'result.changed' - - 'result.group_id.startswith("sg-")' - - # ============================================================ - - name: test state=present different description raises error - ec2_group: - name='{{ec2_group_name}}' - description='{{ec2_group_description}}CHANGED' - ec2_region='{{ec2_region}}' - ec2_access_key='{{ec2_access_key}}' - ec2_secret_key='{{ec2_secret_key}}' - security_token='{{security_token}}' - state=present - ignore_errors: true - register: result - - - name: assert matching group with non-matching description raises error - assert: - that: - - 'result.failed' - - '"Group description does not match existing group. ec2_group does not support this case." in result.msg' - - # ============================================================ - - name: test state=present (expected changed=false) - ec2_group: - name='{{ec2_group_name}}' - description='{{ec2_group_description}}' - ec2_region='{{ec2_region}}' - ec2_access_key='{{ec2_access_key}}' - ec2_secret_key='{{ec2_secret_key}}' - security_token='{{security_token}}' - state=present - register: result - - - name: assert state=present (expected changed=false) - assert: - that: - - 'not result.changed' - - 'result.group_id.startswith("sg-")' - - # ============================================================ - - name: test state=absent (expected changed=true) - ec2_group: - name='{{ec2_group_name}}' - state=absent - environment: - EC2_REGION: '{{ec2_region}}' - EC2_ACCESS_KEY: '{{ec2_access_key}}' - EC2_SECRET_KEY: '{{ec2_secret_key}}' - EC2_SECURITY_TOKEN: '{{security_token|default("")}}' - register: result - - - name: assert state=absent (expected changed=true) - assert: - that: - - 'result.changed' - - 'not result.group_id' - - always: - - # ============================================================ - - name: test state=absent (expected changed=false) - ec2_group: - name='{{ec2_group_name}}' - state=absent - environment: - EC2_REGION: '{{ec2_region}}' - EC2_ACCESS_KEY: '{{ec2_access_key}}' - EC2_SECRET_KEY: '{{ec2_secret_key}}' - EC2_SECURITY_TOKEN: '{{security_token|default("")}}' - register: result - - - name: assert state=absent (expected changed=false) - assert: - that: - - 'not result.changed' - - 'not result.group_id' diff --git a/test/integration/roles/test_ec2_key/defaults/main.yml b/test/integration/roles/test_ec2_key/defaults/main.yml deleted file mode 100644 index df0082d999..0000000000 --- a/test/integration/roles/test_ec2_key/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# defaults file for test_ec2_key -ec2_key_name: '{{resource_prefix}}' diff --git a/test/integration/roles/test_ec2_key/meta/main.yml b/test/integration/roles/test_ec2_key/meta/main.yml deleted file mode 100644 index 45f0cedf8e..0000000000 --- a/test/integration/roles/test_ec2_key/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ -dependencies: - - prepare_tests - - setup_sshkey - - setup_ec2 diff --git a/test/integration/roles/test_ec2_key/tasks/main.yml b/test/integration/roles/test_ec2_key/tasks/main.yml deleted file mode 100644 index 637d67ab0e..0000000000 --- a/test/integration/roles/test_ec2_key/tasks/main.yml +++ /dev/null @@ -1,350 +0,0 @@ ---- -# A Note about ec2 environment variable name preference: -# - EC2_URL -> AWS_URL -# - EC2_ACCESS_KEY -> AWS_ACCESS_KEY_ID -> AWS_ACCESS_KEY -# - EC2_SECRET_KEY -> AWS_SECRET_ACCESS_KEY -> AWX_SECRET_KEY -# - EC2_REGION -> AWS_REGION -# -# TODO - name: test 'region' parameter -# TODO - name: test 'state=absent' parameter for existing key -# TODO - name: test 'state=absent' parameter for missing key -# TODO - name: test 'validate_certs' parameter - -# ============================================================ -# - include: ../../setup_ec2/tasks/common.yml module_name=ec2_key - -- block: - - # ============================================================ - - name: test with no parameters - ec2_key: - register: result - ignore_errors: true - - - name: assert failure when called with no parameters - assert: - that: - - 'result.failed' - - 'result.msg == "missing required arguments: name"' - - # ============================================================ - - name: test with only name - ec2_key: - name={{ec2_key_name}} - register: result - ignore_errors: true - - - name: assert failure when called with only 'name' - assert: - that: - - 'result.failed' - - 'result.msg == "Either region or ec2_url must be specified"' - - # ============================================================ - - name: test invalid region parameter - ec2_key: - name={{ec2_key_name}} - region='asdf querty 1234' - register: result - ignore_errors: true - - - name: assert invalid region parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("Region asdf querty 1234 does not seem to be available ")' - - # ============================================================ - - name: test valid region parameter - ec2_key: - name={{ec2_key_name}} - region={{ec2_region}} - register: result - ignore_errors: true - - - name: assert valid region parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - - # ============================================================ - - name: test environment variable EC2_REGION - ec2_key: - name={{ec2_key_name}} - environment: - EC2_REGION: '{{ec2_region}}' - register: result - ignore_errors: true - - - name: assert environment variable EC2_REGION - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - - # ============================================================ - - name: test invalid ec2_url parameter - ec2_key: - name={{ec2_key_name}} - environment: - EC2_URL: bogus.example.com - register: result - ignore_errors: true - - - name: assert invalid ec2_url parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - - # ============================================================ - - name: test valid ec2_url parameter - ec2_key: - name={{ec2_key_name}} - environment: - EC2_URL: '{{ec2_url}}' - register: result - ignore_errors: true - - - name: assert valid ec2_url parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - - # ============================================================ - - name: test credentials from environment - ec2_key: - name={{ec2_key_name}} - environment: - EC2_REGION: '{{ec2_region}}' - EC2_ACCESS_KEY: bogus_access_key - EC2_SECRET_KEY: bogus_secret_key - register: result - ignore_errors: true - - - name: assert ec2_key with valid ec2_url - assert: - that: - - 'result.failed' - - '"EC2ResponseError: 401 Unauthorized" in result.module_stderr' - - # ============================================================ - - name: test credential parameters - ec2_key: - name={{ec2_key_name}} - ec2_region={{ec2_region}} - ec2_access_key=bogus_access_key - ec2_secret_key=bogus_secret_key - register: result - ignore_errors: true - - - name: assert credential parameters - assert: - that: - - 'result.failed' - - '"EC2ResponseError: 401 Unauthorized" in result.module_stderr' - - # ============================================================ - - name: test state=absent with key_material - ec2_key: - name='{{ec2_key_name}}' - ec2_region={{ec2_region}} - ec2_access_key={{ec2_access_key}} - ec2_secret_key={{ec2_secret_key}} - security_token={{security_token}} - state=absent - register: result - - - name: assert state=absent with key_material - assert: - that: - - '"failed" not in result' - - # ============================================================ - - name: test state=present without key_material - ec2_key: - name='{{ec2_key_name}}' - ec2_region={{ec2_region}} - ec2_access_key={{ec2_access_key}} - ec2_secret_key={{ec2_secret_key}} - security_token={{security_token}} - state=present - register: result - - - name: assert state=present without key_material - assert: - that: - - 'result.changed' - - '"failed" not in result' - - '"key" in result' - - '"name" in result.key' - - '"fingerprint" in result.key' - - '"private_key" in result.key' - - 'result.key.name == "{{ec2_key_name}}"' - - # ============================================================ - - name: test state=absent without key_material - ec2_key: - name='{{ec2_key_name}}' - state=absent - environment: - EC2_REGION: '{{ec2_region}}' - EC2_ACCESS_KEY: '{{ec2_access_key}}' - EC2_SECRET_KEY: '{{ec2_secret_key}}' - EC2_SECURITY_TOKEN: '{{security_token|default("")}}' - register: result - - - name: assert state=absent without key_material - assert: - that: - - 'result.changed' - - '"failed" not in result' - - '"key" in result' - - 'result.key == None' - - # ============================================================ - - name: test state=present with key_material - ec2_key: - name='{{ec2_key_name}}' - key_material='{{key_material}}' - state=present - environment: - EC2_REGION: '{{ec2_region}}' - EC2_ACCESS_KEY: '{{ec2_access_key}}' - EC2_SECRET_KEY: '{{ec2_secret_key}}' - EC2_SECURITY_TOKEN: '{{security_token|default("")}}' - register: result - - - name: assert state=present with key_material - assert: - that: - - '"failed" not in result' - - 'result.changed == True' - - '"key" in result' - - '"name" in result.key' - - 'result.key.name == "{{ec2_key_name}}"' - - '"fingerprint" in result.key' - - '"private_key" not in result.key' - # FIXME - why don't the fingerprints match? - # - 'result.key.fingerprint == "{{fingerprint}}"' - - # ============================================================ - - name: test state=absent with key_material - ec2_key: - name='{{ec2_key_name}}' - key_material='{{key_material}}' - ec2_region='{{ec2_region}}' - ec2_access_key='{{ec2_access_key}}' - ec2_secret_key='{{ec2_secret_key}}' - security_token='{{security_token}}' - state=absent - register: result - - - name: assert state=absent with key_material - assert: - that: - - 'result.changed' - - '"failed" not in result' - - '"key" in result' - - 'result.key == None' - - # ============================================================ - - name: test state=present with key_material with_files (expect changed=true) - ec2_key: - name='{{ec2_key_name}}' - state=present - key_material='{{ item }}' - with_file: '{{sshkey}}.pub' - environment: - EC2_REGION: '{{ec2_region}}' - EC2_ACCESS_KEY: '{{ec2_access_key}}' - EC2_SECRET_KEY: '{{ec2_secret_key}}' - EC2_SECURITY_TOKEN: '{{security_token|default("")}}' - register: result - - - name: assert state=present with key_material with_files (expect changed=true) - assert: - that: - - 'result.msg == "All items completed"' - - 'result.changed == True' - - '"results" in result' - - '"item" in result.results[0]' - - '"key" in result.results[0]' - - '"name" in result.results[0].key' - - 'result.results[0].key.name == "{{ec2_key_name}}"' - - '"fingerprint" in result.results[0].key' - - '"private_key" not in result.results[0].key' - # FIXME - why doesn't result.key.fingerprint == {{fingerprint}} - # - 'result.key.fingerprint == "{{fingerprint}}"' - - # ============================================================ - - name: test state=present with key_material with_files (expect changed=false) - ec2_key: - name='{{ec2_key_name}}' - state=present - key_material='{{ item }}' - with_file: '{{sshkey}}.pub' - environment: - EC2_REGION: '{{ec2_region}}' - EC2_ACCESS_KEY: '{{ec2_access_key}}' - EC2_SECRET_KEY: '{{ec2_secret_key}}' - EC2_SECURITY_TOKEN: '{{security_token|default("")}}' - register: result - - - name: assert state=present with key_material with_files (expect changed=false) - assert: - that: - - 'result.msg == "All items completed"' - - 'not result.changed' - - '"results" in result' - - '"item" in result.results[0]' - - '"key" in result.results[0]' - - '"name" in result.results[0].key' - - 'result.results[0].key.name == "{{ec2_key_name}}"' - - '"fingerprint" in result.results[0].key' - - '"private_key" not in result.results[0].key' - # FIXME - why doesn't result.key.fingerprint == {{fingerprint}} - # - 'result.key.fingerprint == "{{fingerprint}}"' - - # ============================================================ - - name: test state=absent with key_material (expect changed=true) - ec2_key: - name='{{ec2_key_name}}' - ec2_region='{{ec2_region}}' - ec2_access_key='{{ec2_access_key}}' - ec2_secret_key='{{ec2_secret_key}}' - security_token='{{security_token}}' - key_material='{{key_material}}' - state=absent - register: result - - - name: assert state=absent with key_material (expect changed=true) - assert: - that: - - 'result.changed' - - '"failed" not in result' - - '"key" in result' - - 'result.key == None' - - always: - - # ============================================================ - - name: test state=absent (expect changed=false) - ec2_key: - name='{{ec2_key_name}}' - ec2_region='{{ec2_region}}' - ec2_access_key='{{ec2_access_key}}' - ec2_secret_key='{{ec2_secret_key}}' - security_token='{{security_token}}' - state=absent - register: result - - - name: assert state=absent with key_material (expect changed=false) - assert: - that: - - 'not result.changed' - - '"failed" not in result' - - '"key" in result' - - 'result.key == None' diff --git a/test/integration/roles/test_ec2_tag/defaults/main.yml b/test/integration/roles/test_ec2_tag/defaults/main.yml deleted file mode 100644 index 6aa39c7360..0000000000 --- a/test/integration/roles/test_ec2_tag/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for test_ec2_tag diff --git a/test/integration/roles/test_ec2_tag/meta/main.yml b/test/integration/roles/test_ec2_tag/meta/main.yml deleted file mode 100644 index 1f64f1169a..0000000000 --- a/test/integration/roles/test_ec2_tag/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - prepare_tests - - setup_ec2 diff --git a/test/integration/roles/test_ec2_tag/tasks/main.yml b/test/integration/roles/test_ec2_tag/tasks/main.yml deleted file mode 100644 index 213ca4689e..0000000000 --- a/test/integration/roles/test_ec2_tag/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# tasks file for test_ec2_tag diff --git a/test/integration/roles/test_ec2_tag/vars/main.yml b/test/integration/roles/test_ec2_tag/vars/main.yml deleted file mode 100644 index c2d0654aef..0000000000 --- a/test/integration/roles/test_ec2_tag/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for test_ec2_tag diff --git a/test/integration/roles/test_ec2_vol/defaults/main.yml b/test/integration/roles/test_ec2_vol/defaults/main.yml deleted file mode 100644 index 9e806468b5..0000000000 --- a/test/integration/roles/test_ec2_vol/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for test_ec2_vol diff --git a/test/integration/roles/test_ec2_vol/meta/main.yml b/test/integration/roles/test_ec2_vol/meta/main.yml deleted file mode 100644 index 1f64f1169a..0000000000 --- a/test/integration/roles/test_ec2_vol/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - prepare_tests - - setup_ec2 diff --git a/test/integration/roles/test_ec2_vol/tasks/main.yml b/test/integration/roles/test_ec2_vol/tasks/main.yml deleted file mode 100644 index 0f0d046bf5..0000000000 --- a/test/integration/roles/test_ec2_vol/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# tasks file for test_ec2_vol diff --git a/test/integration/roles/test_ec2_vol/vars/main.yml b/test/integration/roles/test_ec2_vol/vars/main.yml deleted file mode 100644 index 362fe8115c..0000000000 --- a/test/integration/roles/test_ec2_vol/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for test_ec2_vol diff --git a/test/integration/roles/test_ec2_vpc/defaults/main.yml b/test/integration/roles/test_ec2_vpc/defaults/main.yml deleted file mode 100644 index 4487c4a8d8..0000000000 --- a/test/integration/roles/test_ec2_vpc/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for test_ec2_vpc diff --git a/test/integration/roles/test_ec2_vpc/meta/main.yml b/test/integration/roles/test_ec2_vpc/meta/main.yml deleted file mode 100644 index 1f64f1169a..0000000000 --- a/test/integration/roles/test_ec2_vpc/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - prepare_tests - - setup_ec2 diff --git a/test/integration/roles/test_ec2_vpc/tasks/main.yml b/test/integration/roles/test_ec2_vpc/tasks/main.yml deleted file mode 100644 index 28cad8e522..0000000000 --- a/test/integration/roles/test_ec2_vpc/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# tasks file for test_ec2_vpc diff --git a/test/integration/roles/test_ec2_vpc/vars/main.yml b/test/integration/roles/test_ec2_vpc/vars/main.yml deleted file mode 100644 index e0fe3ae8e4..0000000000 --- a/test/integration/roles/test_ec2_vpc/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for test_ec2_vpc diff --git a/test/integration/roles/test_ecs_ecr/defaults/main.yml b/test/integration/roles/test_ecs_ecr/defaults/main.yml deleted file mode 100644 index a244f90c31..0000000000 --- a/test/integration/roles/test_ecs_ecr/defaults/main.yml +++ /dev/null @@ -1,10 +0,0 @@ -policy: - Version: '2008-10-17' - Statement: - - Sid: new statement - Effect: Allow - Principal: "*" - Action: - - ecr:GetDownloadUrlForLayer - - ecr:BatchGetImage - - ecr:BatchCheckLayerAvailability diff --git a/test/integration/roles/test_ecs_ecr/meta/main.yml b/test/integration/roles/test_ecs_ecr/meta/main.yml deleted file mode 100644 index 1f64f1169a..0000000000 --- a/test/integration/roles/test_ecs_ecr/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - prepare_tests - - setup_ec2 diff --git a/test/integration/roles/test_ecs_ecr/tasks/main.yml b/test/integration/roles/test_ecs_ecr/tasks/main.yml deleted file mode 100644 index f8b7c73ed0..0000000000 --- a/test/integration/roles/test_ecs_ecr/tasks/main.yml +++ /dev/null @@ -1,341 +0,0 @@ ---- -- set_fact: - ecr_name: 'ecr-test-{{ ansible_date_time.epoch }}' - -- block: - - - name: When creating with check mode - ecs_ecr: - name: '{{ ecr_name }}' - region: '{{ ec2_region }}' - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - check_mode: yes - - - name: it should skip, change and create - assert: - that: - - result|skipped - - result|changed - - result.created - - - - name: When specifying a registry that is inaccessible - ecs_ecr: - registry_id: 999999999999 - name: '{{ ecr_name }}' - region: '{{ ec2_region }}' - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - ignore_errors: true - - - name: it should fail with an AccessDeniedException - assert: - that: - - result|failed - - '"AccessDeniedException" in result.msg' - - - - name: When creating a repository - ecs_ecr: - name: '{{ ecr_name }}' - region: '{{ ec2_region }}' - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - - - name: it should change and create - assert: - that: - - result|changed - - result.created - - - - name: When creating a repository that already exists in check mode - ecs_ecr: - name: '{{ ecr_name }}' - region: '{{ ec2_region }}' - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - check_mode: yes - - - name: it should not skip, should not change - assert: - that: - - not result|skipped - - not result|changed - - - - name: When creating a repository that already exists - ecs_ecr: - name: '{{ ecr_name }}' - region: '{{ ec2_region }}' - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - - - name: it should not change - assert: - that: - - not result|changed - - - - name: When in check mode, and deleting a policy that does not exists - ecs_ecr: - region: '{{ ec2_region }}' - name: '{{ ecr_name }}' - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - delete_policy: yes - register: result - check_mode: yes - - - name: it should not skip and not change - assert: - that: - - not result|skipped - - not result|changed - - - - name: When in check mode, setting policy on a repository that has no policy - ecs_ecr: - region: '{{ ec2_region }}' - name: '{{ ecr_name }}' - policy: '{{ policy }}' - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - check_mode: yes - - - name: it should skip, change and not create - assert: - that: - - result|skipped - - result|changed - - not result.created - - - - name: When setting policy on a repository that has no policy - ecs_ecr: - region: '{{ ec2_region }}' - name: '{{ ecr_name }}' - policy: '{{ policy }}' - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - - - name: it should change and not create - assert: - that: - - result|changed - - not result.created - - - - name: When in check mode, and deleting a policy that exists - ecs_ecr: - region: '{{ ec2_region }}' - name: '{{ ecr_name }}' - delete_policy: yes - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - check_mode: yes - - - name: it should skip, change but not create - assert: - that: - - result|skipped - - result|changed - - not result.created - - - - name: When deleting a policy that exists - ecs_ecr: - region: '{{ ec2_region }}' - name: '{{ ecr_name }}' - delete_policy: yes - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - - - name: it should change and not create - assert: - that: - - result|changed - - not result.created - - - - name: When setting a policy as a string - ecs_ecr: - region: '{{ ec2_region }}' - name: '{{ ecr_name }}' - policy: '{{ policy | to_json }}' - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - - - name: it should change and not create - assert: - that: - - result|changed - - not result.created - - - - name: When setting a policy to its current value - ecs_ecr: - region: '{{ ec2_region }}' - name: '{{ ecr_name }}' - policy: '{{ policy }}' - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - - - name: it should not change - assert: - that: - - not result|changed - - - - name: When omitting policy on a repository that has a policy - ecs_ecr: - region: '{{ ec2_region }}' - name: '{{ ecr_name }}' - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - - - name: it should not change - assert: - that: - - not result|changed - - - - name: When specifying both policy and delete_policy - ecs_ecr: - region: '{{ ec2_region }}' - name: '{{ ecr_name }}' - policy: '{{ policy }}' - delete_policy: yes - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - ignore_errors: true - - - name: it should fail - assert: - that: - - result|failed - - - - name: When specifying invalid JSON for policy - ecs_ecr: - region: '{{ ec2_region }}' - name: '{{ ecr_name }}' - policy_text: "Ceci n'est pas une JSON" - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - ignore_errors: true - - - name: it should fail - assert: - that: - - result|failed - - - - name: When in check mode, deleting a policy that exists - ecs_ecr: - name: '{{ ecr_name }}' - region: '{{ ec2_region }}' - state: absent - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - check_mode: yes - - - name: it should skip, change and not create - assert: - that: - - result|skipped - - result|changed - - not result.created - - - - name: When deleting a policy that exists - ecs_ecr: - name: '{{ ecr_name }}' - region: '{{ ec2_region }}' - state: absent - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - - - name: it should change - assert: - that: - - result|changed - - - - name: When in check mode, deleting a policy that does not exist - ecs_ecr: - name: '{{ ecr_name }}' - region: '{{ ec2_region }}' - state: absent - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - check_mode: yes - - - name: it should not change - assert: - that: - - not result|skipped - - not result|changed - - - - name: When deleting a policy that does not exist - ecs_ecr: - name: '{{ ecr_name }}' - region: '{{ ec2_region }}' - state: absent - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' - register: result - - - name: it should not change - assert: - that: - - not result|changed - - always: - - - name: Delete lingering ECR repository - ecs_ecr: - name: '{{ ecr_name }}' - region: '{{ ec2_region }}' - state: absent - ec2_access_key: '{{ec2_access_key}}' - ec2_secret_key: '{{ec2_secret_key}}' - security_token: '{{security_token}}' |