forked from ansible/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cloudstack: add more integration tests
- Loading branch information
Showing
10 changed files
with
404 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
dependencies: | ||
- test_cs_common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
--- | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
dependencies: | ||
- test_cs_common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
- name: ensure iso is deleted | ||
cs_iso: | ||
name: "{{ cs_resource_prefix }}-iso" | ||
state: absent | ||
register: iso | ||
- name: verify ensure iso is deleted | ||
assert: | ||
that: | ||
- iso|success | ||
|
||
- 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 | ||
os_type: Debian GNU/Linux 7(64-bit) | ||
register: iso | ||
- name: verify test download iso | ||
assert: | ||
that: | ||
- iso|changed | ||
- iso.name == "{{ cs_resource_prefix }}-iso" | ||
|
||
- 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 | ||
os_type: Debian GNU/Linux 7(64-bit) | ||
register: iso | ||
- name: verify test download iso idempotence | ||
assert: | ||
that: | ||
- not iso|changed | ||
- iso.name == "{{ cs_resource_prefix }}-iso" | ||
|
||
# TODO: on 4.6 simulator no checksum was returned | ||
# TODO: check if this is a bug in 4.6 | ||
#- name: test download iso idempotence by checksum | ||
# cs_iso: | ||
# name: "{{ cs_resource_prefix }}-iso2" | ||
# checksum: "{{ iso.checksum }}" | ||
# url: http://mirror.switch.ch/ftp/mirror/debian-cd/current/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso | ||
# os_type: Debian GNU/Linux 7(64-bit) | ||
# register: iso2 | ||
#- name: verify test download iso idempotence by checksum | ||
# assert: | ||
# that: | ||
# - not iso2|changed | ||
# - iso2.name == "{{ cs_resource_prefix }}-iso" | ||
# - iso2.checksum == iso.checksum | ||
|
||
- name: test remove iso | ||
cs_iso: | ||
name: "{{ cs_resource_prefix }}-iso" | ||
state: absent | ||
register: iso | ||
- name: verify test remove iso | ||
assert: | ||
that: | ||
- iso|changed | ||
- iso.name == "{{ cs_resource_prefix }}-iso" | ||
|
||
- name: test remove iso idempotence | ||
cs_iso: | ||
name: "{{ cs_resource_prefix }}-iso" | ||
state: absent | ||
register: iso | ||
- name: verify test remove iso idempotence | ||
assert: | ||
that: | ||
- not iso|changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
dependencies: | ||
- test_cs_common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
--- | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
test_cs_instance_template: CentOS 5.3(64-bit) no GUI (Simulator) | ||
test_cs_instance_offering_1: Small Instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
dependencies: | ||
- test_cs_common |
Oops, something went wrong.