mirror of https://github.com/ansible/ansible.git
hcloud: Fix testsuite (#55076)
parent
a971a0eb80
commit
3f579eb68f
@ -1,51 +1,53 @@
|
|||||||
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
|
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
- name: test gather hcloud image facts
|
- name: test gather hcloud floating ip facts
|
||||||
hcloud_floating_ip_facts:
|
hcloud_floating_ip_facts:
|
||||||
- name: verify test gather hcloud image facts in check mode
|
- name: verify test gather hcloud floating ip facts in check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ansible_facts.hcloud_floating_ip_facts| list | count == 1
|
- ansible_facts.hcloud_floating_ip_facts| list | count == 1
|
||||||
|
|
||||||
- name: test gather hcloud image facts in check mode
|
- name: test gather hcloud floating ip facts in check mode
|
||||||
hcloud_floating_ip_facts:
|
hcloud_floating_ip_facts:
|
||||||
check_mode: yes
|
check_mode: yes
|
||||||
|
|
||||||
- name: verify test gather hcloud image facts in check mode
|
- name: verify test gather hcloud floating ip facts in check mode
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ansible_facts.hcloud_floating_ip_facts| list | count == 1
|
- ansible_facts.hcloud_floating_ip_facts| list | count == 1
|
||||||
|
|
||||||
|
|
||||||
- name: test gather hcloud image facts with correct label selector
|
- name: test gather hcloud floating ip facts with correct label selector
|
||||||
hcloud_floating_ip_facts:
|
hcloud_floating_ip_facts:
|
||||||
label_selector: "key=value"
|
label_selector: "key=value"
|
||||||
- name: verify test gather hcloud image with correct label selector
|
- name: verify test gather hcloud floating ip with correct label selector
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ansible_facts.hcloud_floating_ip_facts|selectattr('description','equalto','{{ hcloud_test_floating_ip_name }}') | list | count == 1
|
- ansible_facts.hcloud_floating_ip_facts|selectattr('description','equalto','{{ hcloud_test_floating_ip_name }}') | list | count == 1
|
||||||
|
|
||||||
- name: test gather hcloud image facts with wrong label selector
|
- name: test gather hcloud floating ip facts with wrong label selector
|
||||||
hcloud_floating_ip_facts:
|
hcloud_floating_ip_facts:
|
||||||
label_selector: "key!=value"
|
label_selector: "key!=value"
|
||||||
- name: verify test gather hcloud image with wrong label selector
|
- name: verify test gather hcloud floating ip with wrong label selector
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ansible_facts.hcloud_floating_ip_facts | list | count == 0
|
- ansible_facts.hcloud_floating_ip_facts | list | count == 0
|
||||||
|
|
||||||
- name: test gather hcloud image facts with correct id
|
- name: test gather hcloud floating ip facts with correct id
|
||||||
hcloud_floating_ip_facts:
|
hcloud_floating_ip_facts:
|
||||||
id: "{{hcloud_test_floating_ip_id}}"
|
id: "{{hcloud_test_floating_ip_id}}"
|
||||||
- name: verify test gather hcloud image with correct id
|
- name: verify test gather hcloud floating ip with correct id
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ansible_facts.hcloud_floating_ip_facts|selectattr('description','equalto','{{ hcloud_test_floating_ip_name }}') | list | count == 1
|
- ansible_facts.hcloud_floating_ip_facts|selectattr('description','equalto','{{ hcloud_test_floating_ip_name }}') | list | count == 1
|
||||||
|
|
||||||
- name: test gather hcloud image facts with wrong id
|
- name: test gather hcloud floating ip facts with wrong id
|
||||||
hcloud_floating_ip_facts:
|
hcloud_floating_ip_facts:
|
||||||
id: "{{hcloud_test_floating_ip_id}}1"
|
id: "{{hcloud_test_floating_ip_id}}1"
|
||||||
- name: verify test gather hcloud image with wrong id
|
register: result
|
||||||
|
ignore_errors: yes
|
||||||
|
- name: verify test gather hcloud floating ip with wrong id
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ansible_facts.hcloud_floating_ip_facts | list | count == 0
|
- result is failed
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- setup_sshkey
|
@ -1,4 +1,5 @@
|
|||||||
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
|
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
|
||||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
---
|
---
|
||||||
hcloud_ssh_key_name: "test_ssh_key"
|
hcloud_prefix: "tests"
|
||||||
|
hcloud_ssh_key_name: "{{hcloud_prefix}}-ssh_key_facts"
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- setup_sshkey
|
Loading…
Reference in New Issue