summaryrefslogtreecommitdiffstats
path: root/collections-debian-merged/ansible_collections/community/digitalocean/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 20:03:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 20:03:01 +0000
commita453ac31f3428614cceb99027f8efbdb9258a40b (patch)
treef61f87408f32a8511cbd91799f9cececb53e0374 /collections-debian-merged/ansible_collections/community/digitalocean/tests
parentInitial commit. (diff)
downloadansible-a453ac31f3428614cceb99027f8efbdb9258a40b.tar.xz
ansible-a453ac31f3428614cceb99027f8efbdb9258a40b.zip
Adding upstream version 2.10.7+merged+base+2.10.8+dfsg.upstream/2.10.7+merged+base+2.10.8+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collections-debian-merged/ansible_collections/community/digitalocean/tests')
-rw-r--r--collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_floating_ip/aliases1
-rw-r--r--collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_floating_ip/tasks/main.yml42
-rw-r--r--collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_sshkey/aliases1
-rw-r--r--collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_sshkey/tasks/main.yml29
-rw-r--r--collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_tag/aliases2
-rw-r--r--collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_tag/tasks/main.yml51
-rw-r--r--collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.10.txt16
-rw-r--r--collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.11.txt16
-rw-r--r--collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.9.txt16
9 files changed, 174 insertions, 0 deletions
diff --git a/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_floating_ip/aliases b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_floating_ip/aliases
new file mode 100644
index 00000000..ad7ccf7a
--- /dev/null
+++ b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_floating_ip/aliases
@@ -0,0 +1 @@
+unsupported
diff --git a/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_floating_ip/tasks/main.yml b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_floating_ip/tasks/main.yml
new file mode 100644
index 00000000..91b10d77
--- /dev/null
+++ b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_floating_ip/tasks/main.yml
@@ -0,0 +1,42 @@
+---
+- name: Test API key is provided.
+ fail:
+ msg: do_api_key should be defined in integration_config.yml
+ when: do_api_key is not defined
+
+- name: "Make sure that the Floating IP is absent"
+ digital_ocean_floating_ip:
+ state: absent
+ ip: "8.8.8.8"
+ oauth_token: "{{ do_api_key }}"
+ register: result
+
+- name: Verify that the Floating IP didn't change
+ assert:
+ that:
+ - "not result.changed"
+
+- name: "Create a Floating IP"
+ digital_ocean_floating_ip:
+ state: present
+ region: "lon1"
+ oauth_token: "{{ do_api_key }}"
+ register: result
+
+- name: Verify that a Floating IP was created
+ assert:
+ that:
+ - "result.changed"
+
+- name: "Destroy Floating IP"
+ digital_ocean_floating_ip:
+ state: absent
+ ip: "{{ result.data.floating_ip.ip }}"
+ region: "lon1"
+ oauth_token: "{{ do_api_key }}"
+ register: result
+
+- name: Verify that a Floating IP was deleted
+ assert:
+ that:
+ - " result.changed"
diff --git a/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_sshkey/aliases b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_sshkey/aliases
new file mode 100644
index 00000000..ad7ccf7a
--- /dev/null
+++ b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_sshkey/aliases
@@ -0,0 +1 @@
+unsupported
diff --git a/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_sshkey/tasks/main.yml b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_sshkey/tasks/main.yml
new file mode 100644
index 00000000..ce82c208
--- /dev/null
+++ b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_sshkey/tasks/main.yml
@@ -0,0 +1,29 @@
+---
+- name: Test API key is provided.
+ fail:
+ msg: do_api_key should be defined in integration_config.yml
+ when: do_api_key is not defined
+
+- name: Create ssh key
+ digital_ocean_sshkey:
+ name: test-key1
+ ssh_pub_key: "{{ dummy_ssh_pub_key }}"
+ oauth_token: "{{ do_api_key }}"
+ register: result
+
+- name: Verify that SSH key was created
+ assert:
+ that:
+ - "result.changed"
+
+- name: "Delete ssh key"
+ digital_ocean_sshkey:
+ state: "absent"
+ fingerprint: "{{ result.data.ssh_key.fingerprint }}"
+ oauth_token: "{{ do_api_key }}"
+ register: result
+
+- name: Verify that SSH key was deleted
+ assert:
+ that:
+ - "result.changed"
diff --git a/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_tag/aliases b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_tag/aliases
new file mode 100644
index 00000000..6320774d
--- /dev/null
+++ b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_tag/aliases
@@ -0,0 +1,2 @@
+digital_ocean
+unsupported
diff --git a/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_tag/tasks/main.yml b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_tag/tasks/main.yml
new file mode 100644
index 00000000..aea355fa
--- /dev/null
+++ b/collections-debian-merged/ansible_collections/community/digitalocean/tests/integration/targets/digital_ocean_tag/tasks/main.yml
@@ -0,0 +1,51 @@
+---
+- block:
+ - name: Test API key is provided.
+ fail:
+ msg: do_api_key should be defined in integration_config.yml
+ when: do_api_key is not defined
+
+ - name: Create a new tag
+ digital_ocean_tag:
+ oauth_token: '{{do_api_key}}'
+ name: integration-test
+ state: present
+ register: create_tag
+
+ - name: Create a new tag for idempotency
+ digital_ocean_tag:
+ oauth_token: '{{do_api_key}}'
+ name: integration-test
+ state: present
+ register: create_tag_idempotent
+
+ - debug:
+ var: create_tag
+
+ - assert:
+ that:
+ - create_tag.changed == True
+ - create_tag_idempotent.changed == False
+ - create_tag.data.tag.name == "integration-test"
+
+ always:
+ - name: Delete tag
+ digital_ocean_tag:
+ oauth_token: '{{do_api_key}}'
+ name: integration-test
+ state: absent
+ register: delete_tag
+
+# FIXME: Deleting a tag isn't idempotent
+# - name: Delete tag with idempotency
+# digital_ocean_tag:
+# oauth_token: '{{do_api_key}}'
+# name: integration-test
+# state: absent
+# register: delete_tag_idempotent
+
+ - assert:
+ that:
+ - delete_tag.changed == True
+# FIXME: Deleting a tag isn't idempotent
+# - delete_tag_idempotent.changed == False
diff --git a/collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.10.txt b/collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.10.txt
new file mode 100644
index 00000000..9c927f9c
--- /dev/null
+++ b/collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.10.txt
@@ -0,0 +1,16 @@
+plugins/modules/digital_ocean.py validate-modules:doc-missing-type
+plugins/modules/digital_ocean.py validate-modules:parameter-list-no-elements
+plugins/modules/digital_ocean.py validate-modules:parameter-type-not-in-doc
+plugins/modules/digital_ocean.py validate-modules:undocumented-parameter
+plugins/modules/digital_ocean_droplet.py validate-modules:doc-missing-type
+plugins/modules/digital_ocean_droplet.py validate-modules:doc-required-mismatch
+plugins/modules/digital_ocean_droplet.py validate-modules:parameter-list-no-elements
+plugins/modules/digital_ocean_droplet.py validate-modules:parameter-type-not-in-doc
+plugins/modules/digital_ocean_floating_ip.py validate-modules:doc-default-does-not-match-spec
+plugins/modules/digital_ocean_floating_ip.py validate-modules:doc-missing-type
+plugins/modules/digital_ocean_floating_ip.py validate-modules:parameter-type-not-in-doc
+plugins/modules/digital_ocean_floating_ip.py validate-modules:undocumented-parameter
+plugins/modules/digital_ocean_sshkey.py validate-modules:doc-default-does-not-match-spec
+plugins/modules/digital_ocean_sshkey.py validate-modules:doc-missing-type
+plugins/modules/digital_ocean_sshkey.py validate-modules:parameter-type-not-in-doc
+plugins/modules/digital_ocean_sshkey.py validate-modules:undocumented-parameter
diff --git a/collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.11.txt b/collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.11.txt
new file mode 100644
index 00000000..9c927f9c
--- /dev/null
+++ b/collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.11.txt
@@ -0,0 +1,16 @@
+plugins/modules/digital_ocean.py validate-modules:doc-missing-type
+plugins/modules/digital_ocean.py validate-modules:parameter-list-no-elements
+plugins/modules/digital_ocean.py validate-modules:parameter-type-not-in-doc
+plugins/modules/digital_ocean.py validate-modules:undocumented-parameter
+plugins/modules/digital_ocean_droplet.py validate-modules:doc-missing-type
+plugins/modules/digital_ocean_droplet.py validate-modules:doc-required-mismatch
+plugins/modules/digital_ocean_droplet.py validate-modules:parameter-list-no-elements
+plugins/modules/digital_ocean_droplet.py validate-modules:parameter-type-not-in-doc
+plugins/modules/digital_ocean_floating_ip.py validate-modules:doc-default-does-not-match-spec
+plugins/modules/digital_ocean_floating_ip.py validate-modules:doc-missing-type
+plugins/modules/digital_ocean_floating_ip.py validate-modules:parameter-type-not-in-doc
+plugins/modules/digital_ocean_floating_ip.py validate-modules:undocumented-parameter
+plugins/modules/digital_ocean_sshkey.py validate-modules:doc-default-does-not-match-spec
+plugins/modules/digital_ocean_sshkey.py validate-modules:doc-missing-type
+plugins/modules/digital_ocean_sshkey.py validate-modules:parameter-type-not-in-doc
+plugins/modules/digital_ocean_sshkey.py validate-modules:undocumented-parameter
diff --git a/collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.9.txt b/collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.9.txt
new file mode 100644
index 00000000..482732d9
--- /dev/null
+++ b/collections-debian-merged/ansible_collections/community/digitalocean/tests/sanity/ignore-2.9.txt
@@ -0,0 +1,16 @@
+plugins/modules/digital_ocean.py validate-modules:deprecation-mismatch
+plugins/modules/digital_ocean.py validate-modules:invalid-documentation
+plugins/modules/digital_ocean.py validate-modules:missing-main-call
+plugins/modules/digital_ocean_droplet.py validate-modules:doc-missing-type
+plugins/modules/digital_ocean_droplet.py validate-modules:parameter-type-not-in-doc
+plugins/modules/digital_ocean_floating_ip.py validate-modules:doc-default-does-not-match-spec
+plugins/modules/digital_ocean_floating_ip.py validate-modules:doc-missing-type
+plugins/modules/digital_ocean_floating_ip.py validate-modules:parameter-type-not-in-doc
+plugins/modules/digital_ocean_floating_ip.py validate-modules:undocumented-parameter
+plugins/modules/digital_ocean_sshkey.py validate-modules:doc-default-does-not-match-spec
+plugins/modules/digital_ocean_sshkey.py validate-modules:doc-missing-type
+plugins/modules/digital_ocean_sshkey.py validate-modules:parameter-type-not-in-doc
+plugins/modules/digital_ocean_sshkey.py validate-modules:undocumented-parameter
+plugins/modules/digital_ocean_sshkey_facts.py validate-modules:deprecation-mismatch
+plugins/modules/digital_ocean_sshkey_facts.py validate-modules:invalid-documentation
+plugins/modules/digital_ocean_sshkey_facts.py validate-modules:missing-main-call