Skip to content

Commit

Permalink
add iso
Browse files Browse the repository at this point in the history
  • Loading branch information
resmo committed Nov 29, 2024
1 parent 6a71ad9 commit a7d590f
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/integration/targets/iso/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cloud/cs
cs/group1
cs/group3
3 changes: 3 additions & 0 deletions tests/integration/targets/iso/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
dependencies:
- cs_common
143 changes: 143 additions & 0 deletions tests/integration/targets/iso/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
---
- name: setup iso
ngine_io.cloudstack.iso:
name: "{{ cs_resource_prefix }}-iso"
cross_zones: true
state: absent
register: iso
- name: verify setup iso
assert:
that:
- iso is successful

- name: test download iso in check mode
ngine_io.cloudstack.iso:
name: "{{ cs_resource_prefix }}-iso"
url: "{{ cs_iso_url }}"
os_type: Debian GNU/Linux 7(64-bit)
cross_zones: true
register: iso
check_mode: true
- name: verify test download iso in check mode
assert:
that:
- iso is changed

- name: test download iso
ngine_io.cloudstack.iso:
name: "{{ cs_resource_prefix }}-iso"
url: "{{ cs_iso_url }}"
os_type: Debian GNU/Linux 7(64-bit)
cross_zones: true
register: iso
- name: verify test download iso
assert:
that:
- iso is changed
- iso.name == cs_resource_prefix + "-iso"
- iso.display_text == cs_resource_prefix + "-iso"
- iso.cross_zones == true

- name: test download iso idempotence
ngine_io.cloudstack.iso:
name: "{{ cs_resource_prefix }}-iso"
url: "{{ cs_iso_url }}"
os_type: Debian GNU/Linux 7(64-bit)
cross_zones: true
register: iso
- name: verify test download iso idempotence
assert:
that:
- iso is not changed
- iso.name == cs_resource_prefix + "-iso"
- iso.display_text == cs_resource_prefix + "-iso"
- iso.cross_zones == true

- name: test update iso in check mode
ngine_io.cloudstack.iso:
name: "{{ cs_resource_prefix }}-iso"
display_text: "{{ cs_resource_prefix }}-iso display_text"
url: "{{ cs_iso_url }}"
os_type: CentOS 7
cross_zones: true
register: iso
check_mode: true
- name: verify test update iso in check mode
assert:
that:
- iso is changed
- iso.name == cs_resource_prefix + "-iso"
- iso.display_text == cs_resource_prefix + "-iso"
- iso.cross_zones == true

- name: test update iso
ngine_io.cloudstack.iso:
name: "{{ cs_resource_prefix }}-iso"
display_text: "{{ cs_resource_prefix }}-iso display_text"
url: "{{ cs_iso_url }}"
os_type: CentOS 7
cross_zones: true
register: iso
- name: verify test update iso
assert:
that:
- iso is changed
- iso.name == cs_resource_prefix + "-iso"
- iso.display_text == cs_resource_prefix + "-iso display_text"
- iso.cross_zones == true

- name: test update iso idempotence
ngine_io.cloudstack.iso:
name: "{{ cs_resource_prefix }}-iso"
display_text: "{{ cs_resource_prefix }}-iso display_text"
url: "{{ cs_iso_url }}"
os_type: CentOS 7
cross_zones: true
register: iso
- name: verify test update iso idempotence
assert:
that:
- iso is not changed
- iso.name == cs_resource_prefix + "-iso"
- iso.display_text == cs_resource_prefix + "-iso display_text"
- iso.cross_zones == true

- name: test remove iso in check mode
ngine_io.cloudstack.iso:
name: "{{ cs_resource_prefix }}-iso"
state: absent
cross_zones: true
register: iso
check_mode: true
- name: verify test remove iso in check mode
assert:
that:
- iso is changed
- iso.name == cs_resource_prefix + "-iso"
- iso.display_text == cs_resource_prefix + "-iso display_text"
- iso.cross_zones == true

- name: test remove iso
ngine_io.cloudstack.iso:
name: "{{ cs_resource_prefix }}-iso"
state: absent
cross_zones: true
register: iso
- name: verify test remove iso
assert:
that:
- iso is changed
- iso.name == cs_resource_prefix + "-iso"
- iso.display_text == cs_resource_prefix + "-iso display_text"
- iso.cross_zones == true

- name: test remove iso idempotence
ngine_io.cloudstack.iso:
name: "{{ cs_resource_prefix }}-iso"
state: absent
cross_zones: true
register: iso
- name: verify test remove iso idempotence
assert:
that:
- iso is not changed
2 changes: 2 additions & 0 deletions tests/integration/targets/iso/vars/main
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
cs_iso_url: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.6.0-amd64-netinst.iso

0 comments on commit a7d590f

Please sign in to comment.