diff --git a/tests/integration/targets/cs_account/tasks/main.yml b/tests/integration/targets/cs_account/tasks/main.yml index 7b7798b8..5bbe54be 100644 --- a/tests/integration/targets/cs_account/tasks/main.yml +++ b/tests/integration/targets/cs_account/tasks/main.yml @@ -1,11 +1,9 @@ --- - name: setup - cs_account: name={{ cs_resource_prefix }}_user state=absent + cs_account: + name: "{{ cs_resource_prefix }}_username" + state: absent register: acc -- name: verify setup - assert: - that: - - acc is successful - name: test fail if missing name action: cs_account @@ -42,7 +40,6 @@ - name: verify results of create account in check mode assert: that: - - acc is successful - acc is changed - name: test create user account @@ -58,7 +55,6 @@ - name: verify results of create account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -79,7 +75,6 @@ - name: verify results of create account idempotence assert: that: - - acc is successful - acc is not changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -96,7 +91,6 @@ - name: verify results of lock user account in check mode assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -112,7 +106,6 @@ - name: verify results of lock user account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -128,7 +121,6 @@ - name: verify results of lock user account idempotence assert: that: - - acc is successful - acc is not changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -145,7 +137,6 @@ - name: verify results of disable user account in check mode assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -161,7 +152,6 @@ - name: verify results of disable user account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -177,7 +167,6 @@ - name: verify results of disable user account idempotence assert: that: - - acc is successful - acc is not changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -194,7 +183,6 @@ - name: verify results of lock disabled user account in check mode assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -210,7 +198,6 @@ - name: verify results of lock disabled user account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -226,7 +213,6 @@ - name: verify results of lock disabled user account idempotence assert: that: - - acc is successful - acc is not changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -243,7 +229,6 @@ - name: verify results of enable user account in check mode assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -259,7 +244,6 @@ - name: verify results of enable user account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -275,7 +259,6 @@ - name: verify results of enable user account idempotence assert: that: - - acc is successful - acc is not changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -292,7 +275,6 @@ - name: verify results of remove user account in check mode assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -308,7 +290,6 @@ - name: verify results of remove user account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -324,7 +305,6 @@ - name: verify results of remove user account idempotence assert: that: - - acc is successful - acc is not changed - name: test create user disabled account @@ -341,7 +321,6 @@ - name: verify results of create disabled account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -357,7 +336,6 @@ - name: verify results of remove disabled user account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -379,7 +357,6 @@ - name: verify results of create locked account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -395,7 +372,6 @@ - name: verify results of remove locked user account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -417,7 +393,6 @@ - name: verify results of create unlocked/enabled account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" @@ -433,7 +408,6 @@ - name: verify results of remove unlocked/enabled user account assert: that: - - acc is successful - acc is changed - acc.name == "{{ cs_resource_prefix }}_user" - acc.network_domain == "example.com" diff --git a/tests/integration/targets/cs_firewall/tasks/main.yml b/tests/integration/targets/cs_firewall/tasks/main.yml index a303a9e8..5061ef89 100644 --- a/tests/integration/targets/cs_firewall/tasks/main.yml +++ b/tests/integration/targets/cs_firewall/tasks/main.yml @@ -6,10 +6,6 @@ network_domain: example.com zone: "{{ cs_common_zone_adv }}" register: net -- name: verify network setup - assert: - that: - - net is successful - name: setup instance to get network in implementation state cs_instance: @@ -48,11 +44,6 @@ ip_address: "{{ cs_firewall_ip_address }}" zone: "{{ cs_common_zone_adv }}" state: absent - register: fw -- name: verify setup - assert: - that: - - fw is successful - name: setup 5300 cs_firewall: @@ -65,11 +56,6 @@ - 4.5.6.0/24 zone: "{{ cs_common_zone_adv }}" state: absent - register: fw -- name: verify setup - assert: - that: - - fw is successful - name: setup all cs_firewall: @@ -78,11 +64,6 @@ type: egress zone: "{{ cs_common_zone_adv }}" state: absent - register: fw -- name: verify setup - assert: - that: - - fw is successful - name: test fail if missing params action: cs_firewall @@ -128,7 +109,6 @@ - name: verify results of present firewall rule ingress 80 in check mode assert: that: - - fw is successful - fw is changed - name: test present firewall rule ingress 80 @@ -140,7 +120,6 @@ - name: verify results of present firewall rule ingress 80 assert: that: - - fw is successful - fw is changed - fw.cidr == "0.0.0.0/0" - fw.cidrs == [ '0.0.0.0/0' ] @@ -159,7 +138,6 @@ - name: verify results of present firewall rule ingress 80 idempotence assert: that: - - fw is successful - fw is not changed - fw.cidr == "0.0.0.0/0" - fw.cidrs == [ '0.0.0.0/0' ] @@ -184,7 +162,6 @@ - name: verify results of present firewall rule ingress 5300 in check mode assert: that: - - fw is successful - fw is changed - name: test present firewall rule ingress 5300 @@ -201,7 +178,6 @@ - name: verify results of present firewall rule ingress 5300 assert: that: - - fw is successful - fw is changed - fw.cidr == "1.2.3.0/24,4.5.6.0/24" - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] @@ -225,7 +201,6 @@ - name: verify results of present firewall rule ingress 5300 idempotence assert: that: - - fw is successful - fw is not changed - fw.cidr == "1.2.3.0/24,4.5.6.0/24" - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] @@ -246,7 +221,6 @@ - name: verify results of present firewall rule egress all in check mode assert: that: - - fw is successful - fw is changed - name: test present firewall rule egress all @@ -259,7 +233,6 @@ - name: verify results of present firewall rule egress all assert: that: - - fw is successful - fw is changed - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] @@ -277,7 +250,6 @@ - name: verify results of present firewall rule egress all idempotence assert: that: - - fw is successful - fw is not changed - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] @@ -296,7 +268,6 @@ - name: verify results of absent firewall rule ingress 80 in check mode assert: that: - - fw is successful - fw is changed - fw.cidr == "0.0.0.0/0" - fw.cidrs == [ '0.0.0.0/0' ] @@ -316,7 +287,6 @@ - name: verify results of absent firewall rule ingress 80 assert: that: - - fw is successful - fw is changed - fw.cidr == "0.0.0.0/0" - fw.cidrs == [ '0.0.0.0/0' ] @@ -336,7 +306,6 @@ - name: verify results of absent firewall rule ingress 80 idempotence assert: that: - - fw is successful - fw is not changed - name: test absent firewall rule ingress 5300 in check mode @@ -355,7 +324,6 @@ - name: verify results of absent firewall rule ingress 5300 in check mode assert: that: - - fw is successful - fw is changed - fw.cidr == "1.2.3.0/24,4.5.6.0/24" - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] @@ -380,7 +348,6 @@ - name: verify results of absent firewall rule ingress 5300 assert: that: - - fw is successful - fw is changed - fw.cidr == "1.2.3.0/24,4.5.6.0/24" - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] @@ -405,7 +372,6 @@ - name: verify results of absent firewall rule ingress 5300 idempotence assert: that: - - fw is successful - fw is not changed - name: test absent firewall rule egress all in check mode @@ -420,7 +386,6 @@ - name: verify results of absent firewall rule egress all in check mode assert: that: - - fw is successful - fw is changed - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] @@ -439,7 +404,6 @@ - name: verify results of absent firewall rule egress all assert: that: - - fw is successful - fw is changed - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] @@ -458,7 +422,6 @@ - name: verify results of absent firewall rule egress all idempotence assert: that: - - fw is successful - fw is not changed - name: cleanup instance diff --git a/tests/integration/targets/cs_instance_info/tasks/main.yml b/tests/integration/targets/cs_instance_info/tasks/main.yml index d041ffe0..c56caf5a 100644 --- a/tests/integration/targets/cs_instance_info/tasks/main.yml +++ b/tests/integration/targets/cs_instance_info/tasks/main.yml @@ -1,27 +1,16 @@ --- - name: setup ssh key - cs_sshkeypair: name={{ cs_resource_prefix }}-sshkey + cs_sshkeypair: + name: "{{ cs_resource_prefix }}-sshkey" register: sshkey -- name: verify setup ssh key - assert: - that: - - sshkey is successful - name: setup affinity group - cs_affinitygroup: name={{ cs_resource_prefix }}-ag - register: ag -- name: verify setup affinity group - assert: - that: - - ag is successful + cs_affinitygroup: + name: "{{ cs_resource_prefix }}-ag" - name: setup security group - cs_securitygroup: name={{ cs_resource_prefix }}-sg - register: sg -- name: verify setup security group - assert: - that: - - sg is successful + cs_securitygroup: + name: "{{ cs_resource_prefix }}-sg" - name: setup instance cs_instance: @@ -32,11 +21,11 @@ security_group: "{{ cs_resource_prefix }}-sg" ssh_key: "{{ cs_resource_prefix }}-sshkey" tags: [] + zone: "{{ cs_common_zone_basic }}" register: instance -- name: verify create instance - assert: - that: - - instance is successful + until: instance is successful + retries: 20 + delay: 5 - name: test instance info in check mode cs_instance_info: diff --git a/tests/integration/targets/cs_instance_password_reset/tasks/main.yml b/tests/integration/targets/cs_instance_password_reset/tasks/main.yml index 543c8f59..8a9155b0 100644 --- a/tests/integration/targets/cs_instance_password_reset/tasks/main.yml +++ b/tests/integration/targets/cs_instance_password_reset/tasks/main.yml @@ -14,12 +14,14 @@ name: "{{ cs_common_template }}" template_filter: all password_enabled: no + zone: "{{ cs_common_zone_adv }}" - name: cleanup test VM cs_instance: name: test-nopassword zone: "{{ cs_common_zone_adv }}" state: expunged + - name: create test VM cs_instance: name: test-nopassword @@ -31,11 +33,13 @@ until: testvm_nopass is success retries: 12 delay: 10 + - name: stop test VM cs_instance: name: test-nopassword zone: "{{ cs_common_zone_adv }}" state: stopped + - name: reset nopassword cs_instance_password_reset: vm: test-nopassword @@ -53,12 +57,14 @@ name: "{{ cs_common_template }}" template_filter: all password_enabled: yes + zone: "{{ cs_common_zone_adv }}" - name: cleanup test VM cs_instance: name: test-password zone: "{{ cs_common_zone_adv }}" state: expunged + - name: create test VM cs_instance: name: test-password @@ -66,20 +72,23 @@ service_offering: "{{ cs_common_service_offering }}" zone: "{{ cs_common_zone_adv }}" state: started + - name: stop test VM cs_instance: name: test-password zone: "{{ cs_common_zone_adv }}" state: stopped + - name: reset password cs_instance_password_reset: vm: test-password zone: "{{ cs_common_zone_adv }}" register: reset3 -- debug: - var: reset3.password - name: verify that a password was set assert: that: - reset3 is success - reset3.password != '' + +- debug: + var: reset3.password diff --git a/tests/integration/targets/cs_iso/tasks/main.yml b/tests/integration/targets/cs_iso/tasks/main.yml index c767256c..de279224 100644 --- a/tests/integration/targets/cs_iso/tasks/main.yml +++ b/tests/integration/targets/cs_iso/tasks/main.yml @@ -2,6 +2,7 @@ - name: setup iso cs_iso: name: "{{ cs_resource_prefix }}-iso" + cross_zones: true state: absent register: iso - name: verify setup iso @@ -12,7 +13,7 @@ - name: test download iso in check mode cs_iso: name: "{{ cs_resource_prefix }}-iso" - url: http://mirror.switch.ch/ftp/mirror/debian-cd/current/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso + url: "{{ cs_iso_url }}" os_type: Debian GNU/Linux 7(64-bit) cross_zones: true register: iso @@ -25,7 +26,7 @@ - name: test download iso cs_iso: name: "{{ cs_resource_prefix }}-iso" - url: http://mirror.switch.ch/ftp/mirror/debian-cd/current/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso + url: "{{ cs_iso_url }}" os_type: Debian GNU/Linux 7(64-bit) cross_zones: true register: iso @@ -40,7 +41,7 @@ - name: test download iso idempotence cs_iso: name: "{{ cs_resource_prefix }}-iso" - url: http://mirror.switch.ch/ftp/mirror/debian-cd/current/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso + url: "{{ cs_iso_url }}" os_type: Debian GNU/Linux 7(64-bit) cross_zones: true register: iso @@ -56,7 +57,7 @@ cs_iso: name: "{{ cs_resource_prefix }}-iso" display_text: "{{ cs_resource_prefix }}-iso display_text" - url: http://mirror.switch.ch/ftp/mirror/debian-cd/current/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso + url: "{{ cs_iso_url }}" os_type: CentOS 7 cross_zones: true register: iso @@ -73,7 +74,7 @@ cs_iso: name: "{{ cs_resource_prefix }}-iso" display_text: "{{ cs_resource_prefix }}-iso display_text" - url: http://mirror.switch.ch/ftp/mirror/debian-cd/current/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso + url: "{{ cs_iso_url }}" os_type: CentOS 7 cross_zones: true register: iso @@ -89,7 +90,7 @@ cs_iso: name: "{{ cs_resource_prefix }}-iso" display_text: "{{ cs_resource_prefix }}-iso display_text" - url: http://mirror.switch.ch/ftp/mirror/debian-cd/current/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso + url: "{{ cs_iso_url }}" os_type: CentOS 7 cross_zones: true register: iso diff --git a/tests/integration/targets/cs_iso/vars/main b/tests/integration/targets/cs_iso/vars/main new file mode 100644 index 00000000..1670b14c --- /dev/null +++ b/tests/integration/targets/cs_iso/vars/main @@ -0,0 +1,2 @@ +--- +cs_iso_url: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.6.0-amd64-netinst.iso diff --git a/tests/integration/targets/cs_physical_network/tasks/main.yml b/tests/integration/targets/cs_physical_network/tasks/main.yml index 173fba8a..4b986a6b 100644 --- a/tests/integration/targets/cs_physical_network/tasks/main.yml +++ b/tests/integration/targets/cs_physical_network/tasks/main.yml @@ -14,6 +14,12 @@ state: disabled register: cszone +- name: ensure a network is absent + cs_physical_network: + name: net01 + zone: "{{ cszone.name }}" + state: absent + - name: setup a network in check_mode cs_physical_network: name: net01 @@ -25,7 +31,6 @@ - name: validate setup a network assert: that: - - pn is successful - pn is changed - pn.zone == cszone.name @@ -39,7 +44,6 @@ - name: validate setup a network assert: that: - - pn is successful - pn is changed - pn.name == 'net01' - pn.broadcast_domain_range == 'ZONE' @@ -57,7 +61,6 @@ - name: validate setup a network idempotence assert: that: - - pn is successful - pn is not changed - pn.name == 'net01' - pn.broadcast_domain_range == 'ZONE' @@ -75,7 +78,6 @@ - name: validate set a tag on a network assert: that: - - pn is successful - pn is changed - pn.name == 'net01' - pn.broadcast_domain_range == 'ZONE' @@ -93,7 +95,6 @@ - name: validate remove tag on a network assert: that: - - pn is successful - pn is changed - pn.name == 'net01' - pn.broadcast_domain_range == 'ZONE' @@ -116,10 +117,9 @@ - vpcvirtualrouter check_mode: yes register: pn -- name: validate ensure a network is enabled with specific nsps enabled +- name: validate ensure a network is enabled with specific nsps enabled in check mode assert: that: - - pn is successful - pn is changed - pn.name == 'net01' - pn.zone == cszone.name @@ -143,7 +143,6 @@ - name: validate ensure a network is enabled with specific nsps enabled assert: that: - - pn is successful - pn is changed - pn.name == 'net01' - pn.broadcast_domain_range == 'ZONE' @@ -164,7 +163,6 @@ - name: validate ensure a network is disabled assert: that: - - pn is successful - pn is changed - pn.name == 'net01' - pn.broadcast_domain_range == 'ZONE' @@ -182,7 +180,6 @@ - name: validate ensure a network is enabled assert: that: - - pn is successful - pn is changed - pn.name == 'net01' - pn.broadcast_domain_range == 'ZONE' @@ -201,7 +198,6 @@ - name: validate ensure a network is absent assert: that: - - pn is successful - pn is changed - pn.zone == cszone.name @@ -214,7 +210,6 @@ - name: validate ensure a network is absent assert: that: - - pn is successful - pn is changed - pn.zone == cszone.name - pn.name == 'net01' @@ -228,11 +223,10 @@ - name: validate ensure a network is absent idempotence assert: that: - - pn is successful - pn is not changed - pn.zone == cszone.name - name: cleanup zone cs_zone: name: "{{ cszone.name }}" - state: absent \ No newline at end of file + state: absent diff --git a/tests/integration/targets/cs_vmsnapshot/tasks/main.yml b/tests/integration/targets/cs_vmsnapshot/tasks/main.yml index 86766861..51ce5767 100644 --- a/tests/integration/targets/cs_vmsnapshot/tasks/main.yml +++ b/tests/integration/targets/cs_vmsnapshot/tasks/main.yml @@ -4,6 +4,7 @@ name: "{{ cs_resource_prefix }}-vm-snapshot" template: "{{ test_cs_instance_template }}" service_offering: "{{ test_cs_instance_offering_1 }}" + zone: "{{ cs_common_zone_basic }}" register: instance - name: verify create instance assert: @@ -14,6 +15,7 @@ cs_vmsnapshot: name: "{{ cs_resource_prefix }}_snapshot" vm: "{{ cs_resource_prefix }}-vm-snapshot" + zone: "{{ cs_common_zone_basic }}" state: absent register: snap - name: verify setup @@ -22,7 +24,8 @@ - snap is successful - name: test fail if missing name - action: cs_vmsnapshot + cs_vmsnapshot: + zone: "{{ cs_common_zone_basic }}" register: snap ignore_errors: true - name: verify results of fail if missing params @@ -35,6 +38,7 @@ cs_vmsnapshot: name: "{{ cs_resource_prefix }}_snapshot" vm: "{{ cs_resource_prefix }}-vm-snapshot" + zone: "{{ cs_common_zone_basic }}" snapshot_memory: yes register: snap check_mode: true @@ -47,6 +51,7 @@ cs_vmsnapshot: name: "{{ cs_resource_prefix }}_snapshot" vm: "{{ cs_resource_prefix }}-vm-snapshot" + zone: "{{ cs_common_zone_basic }}" snapshot_memory: yes register: snap - name: verify test create snapshot @@ -59,6 +64,7 @@ cs_vmsnapshot: name: "{{ cs_resource_prefix }}_snapshot" vm: "{{ cs_resource_prefix }}-vm-snapshot" + zone: "{{ cs_common_zone_basic }}" snapshot_memory: yes register: snap - name: verify test create snapshot idempotence @@ -71,6 +77,7 @@ cs_vmsnapshot: name: "{{ cs_resource_prefix }}_snapshot" vm: "{{ cs_resource_prefix }}-vm-snapshot" + zone: "{{ cs_common_zone_basic }}" state: revert register: snap check_mode: true @@ -84,6 +91,7 @@ cs_vmsnapshot: name: "{{ cs_resource_prefix }}_snapshot_unknown" vm: "{{ cs_resource_prefix }}-vm-snapshot" + zone: "{{ cs_common_zone_basic }}" state: revert register: snap ignore_errors: true @@ -97,6 +105,7 @@ cs_vmsnapshot: name: "{{ cs_resource_prefix }}_snapshot" vm: "{{ cs_resource_prefix }}-vm-snapshot" + zone: "{{ cs_common_zone_basic }}" state: revert register: snap - name: verify test revert snapshot @@ -109,6 +118,7 @@ cs_vmsnapshot: name: "{{ cs_resource_prefix }}_snapshot" vm: "{{ cs_resource_prefix }}-vm-snapshot" + zone: "{{ cs_common_zone_basic }}" state: absent register: snap check_mode: true @@ -122,6 +132,7 @@ cs_vmsnapshot: name: "{{ cs_resource_prefix }}_snapshot" vm: "{{ cs_resource_prefix }}-vm-snapshot" + zone: "{{ cs_common_zone_basic }}" state: absent register: snap - name: verify test remove snapshot @@ -134,6 +145,7 @@ cs_vmsnapshot: name: "{{ cs_resource_prefix }}_snapshot" vm: "{{ cs_resource_prefix }}-vm-snapshot" + zone: "{{ cs_common_zone_basic }}" state: absent register: snap - name: verify test remove snapshot idempotence @@ -144,6 +156,7 @@ - name: cleanup instance cs_instance: name: "{{ cs_resource_prefix }}-vm-snapshot" + zone: "{{ cs_common_zone_basic }}" state: expunged register: instance - name: verify destroy instance diff --git a/tests/integration/targets/cs_volume/tasks/common.yml b/tests/integration/targets/cs_volume/tasks/common.yml index 615ed45c..f011f858 100644 --- a/tests/integration/targets/cs_volume/tasks/common.yml +++ b/tests/integration/targets/cs_volume/tasks/common.yml @@ -1,6 +1,9 @@ --- - name: setup - cs_volume: name={{ cs_resource_prefix }}_vol state=absent + cs_volume: + name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" + state: absent register: vol - name: verify setup assert: @@ -12,6 +15,7 @@ name: "{{ test_cs_instance_1 }}" template: "{{ test_cs_instance_template }}" service_offering: "{{ test_cs_instance_offering_1 }}" + zone: "{{ cs_common_zone_basic }}" register: instance - name: verify create instance assert: @@ -23,6 +27,7 @@ name: "{{ test_cs_instance_2 }}" template: "{{ test_cs_instance_template }}" service_offering: "{{ test_cs_instance_offering_1 }}" + zone: "{{ cs_common_zone_basic }}" register: instance - name: verify create instance assert: @@ -30,7 +35,8 @@ - instance is successful - name: test fail if missing name - action: cs_volume + cs_volume: + zone: "{{ cs_common_zone_basic }}" register: vol ignore_errors: true - name: verify results of fail if missing name @@ -42,6 +48,7 @@ - name: test create volume in check mode cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" disk_offering: "{{ test_cs_disk_offering_1 }}" size: 20 register: vol @@ -54,6 +61,7 @@ - name: test create volume cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" disk_offering: "{{ test_cs_disk_offering_1 }}" size: 20 register: vol @@ -67,6 +75,7 @@ - name: test create volume idempotence cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" disk_offering: "{{ test_cs_disk_offering_1 }}" size: 20 register: vol @@ -80,6 +89,7 @@ - name: test shrink volume in check mode cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" disk_offering: "{{ test_cs_disk_offering_1 }}" size: 10 shrink_ok: yes @@ -95,6 +105,7 @@ - name: test shrink volume cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" disk_offering: "{{ test_cs_disk_offering_1 }}" size: 10 shrink_ok: yes @@ -109,6 +120,7 @@ - name: test shrink volume idempotence cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" disk_offering: "{{ test_cs_disk_offering_1 }}" size: 10 shrink_ok: yes @@ -123,6 +135,7 @@ - name: test attach volume in check mode cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" vm: "{{ test_cs_instance_1 }}" state: attached register: vol @@ -137,6 +150,7 @@ - name: test attach volume cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" vm: "{{ test_cs_instance_1 }}" state: attached register: vol @@ -151,6 +165,7 @@ - name: test attach volume idempotence cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" vm: "{{ test_cs_instance_1 }}" state: attached register: vol @@ -165,6 +180,7 @@ - name: test attach attached volume to another vm in check mdoe cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" vm: "{{ test_cs_instance_2 }}" state: attached register: vol @@ -180,6 +196,7 @@ - name: test attach attached volume to another vm cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" vm: "{{ test_cs_instance_2 }}" state: attached register: vol @@ -194,6 +211,7 @@ - name: test attach attached volume to another vm idempotence cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" vm: "{{ test_cs_instance_2 }}" state: attached register: vol @@ -208,6 +226,7 @@ - name: test detach volume in check mode cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" state: detached register: vol check_mode: true @@ -221,6 +240,7 @@ - name: test detach volume cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" state: detached register: vol - name: verify results test detach volume @@ -233,6 +253,7 @@ - name: test detach volume idempotence cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" state: detached register: vol - name: verify results test detach volume idempotence @@ -245,6 +266,7 @@ - name: test delete volume in check mode cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" state: absent register: vol check_mode: true @@ -257,6 +279,7 @@ - name: test delete volume cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" state: absent register: vol - name: verify results test create volume @@ -268,6 +291,7 @@ - name: test delete volume idempotence cs_volume: name: "{{ cs_resource_prefix }}_vol" + zone: "{{ cs_common_zone_basic }}" state: absent register: vol - name: verify results test delete volume idempotence @@ -278,6 +302,7 @@ - name: cleanup instance 1 cs_instance: name: "{{ test_cs_instance_1 }}" + zone: "{{ cs_common_zone_basic }}" state: absent register: instance - name: verify create instance @@ -288,6 +313,7 @@ - name: cleanup instance 2 cs_instance: name: "{{ test_cs_instance_2 }}" + zone: "{{ cs_common_zone_basic }}" state: absent register: instance - name: verify create instance