summaryrefslogtreecommitdiffstats
path: root/ansible_collections/community/sops/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ansible_collections/community/sops/tests')
-rw-r--r--ansible_collections/community/sops/tests/ee/all.yml2
-rw-r--r--ansible_collections/community/sops/tests/integration/targets/filter__latest_version/aliases9
-rw-r--r--ansible_collections/community/sops/tests/integration/targets/filter__latest_version/tasks/main.yml39
-rw-r--r--ansible_collections/community/sops/tests/integration/targets/role_install_latest/meta/main.yml7
-rw-r--r--ansible_collections/community/sops/tests/integration/targets/role_install_localhost_remote/meta/main.yml7
-rw-r--r--ansible_collections/community/sops/tests/integration/targets/role_install_version/meta/main.yml7
-rw-r--r--ansible_collections/community/sops/tests/integration/targets/role_install_version/tasks/main.yml18
-rw-r--r--ansible_collections/community/sops/tests/integration/targets/setup_pkg_mgr/tasks/archlinux.yml28
-rw-r--r--ansible_collections/community/sops/tests/integration/targets/setup_pkg_mgr/tasks/main.yml9
-rw-r--r--ansible_collections/community/sops/tests/integration/targets/setup_sops/meta/main.yml7
-rw-r--r--ansible_collections/community/sops/tests/integration/targets/setup_sops/tasks/install.yml4
-rw-r--r--ansible_collections/community/sops/tests/integration/targets/var_sops/README.md2
-rwxr-xr-xansible_collections/community/sops/tests/sanity/extra/extra-docs.py2
-rw-r--r--ansible_collections/community/sops/tests/sanity/ignore-2.10.txt3
-rw-r--r--ansible_collections/community/sops/tests/sanity/ignore-2.11.txt2
-rw-r--r--ansible_collections/community/sops/tests/sanity/ignore-2.12.txt2
-rw-r--r--ansible_collections/community/sops/tests/sanity/ignore-2.13.txt4
-rw-r--r--ansible_collections/community/sops/tests/sanity/ignore-2.14.txt4
-rw-r--r--ansible_collections/community/sops/tests/sanity/ignore-2.17.txt4
-rw-r--r--ansible_collections/community/sops/tests/sanity/ignore-2.17.txt.license3
-rw-r--r--ansible_collections/community/sops/tests/sanity/ignore-2.9.txt3
21 files changed, 161 insertions, 5 deletions
diff --git a/ansible_collections/community/sops/tests/ee/all.yml b/ansible_collections/community/sops/tests/ee/all.yml
index 18c7eda41..f42fdb634 100644
--- a/ansible_collections/community/sops/tests/ee/all.yml
+++ b/ansible_collections/community/sops/tests/ee/all.yml
@@ -7,7 +7,7 @@
tasks:
- name: Download sops test GPG key on localhost
get_url:
- url: https://raw.githubusercontent.com/mozilla/sops/master/pgp/sops_functional_tests_key.asc
+ url: https://raw.githubusercontent.com/getsops/sops/master/pgp/sops_functional_tests_key.asc
dest: /tmp/sops_functional_tests_key.asc
- name: Import sops test GPG key on localhost
command: gpg --import /tmp/sops_functional_tests_key.asc
diff --git a/ansible_collections/community/sops/tests/integration/targets/filter__latest_version/aliases b/ansible_collections/community/sops/tests/integration/targets/filter__latest_version/aliases
new file mode 100644
index 000000000..977ec3882
--- /dev/null
+++ b/ansible_collections/community/sops/tests/integration/targets/filter__latest_version/aliases
@@ -0,0 +1,9 @@
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+gha/main
+skip/aix
+skip/osx
+skip/freebsd
+skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller
diff --git a/ansible_collections/community/sops/tests/integration/targets/filter__latest_version/tasks/main.yml b/ansible_collections/community/sops/tests/integration/targets/filter__latest_version/tasks/main.yml
new file mode 100644
index 000000000..6d1ba661d
--- /dev/null
+++ b/ansible_collections/community/sops/tests/integration/targets/filter__latest_version/tasks/main.yml
@@ -0,0 +1,39 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+- name: Test _latest_version filter
+ ansible.builtin.assert:
+ that:
+ - list_0 | community.sops._latest_version == '1.0.0'
+ - list_1 | community.sops._latest_version == '1.2.1'
+ - list_2 | community.sops._latest_version == '1.2.1'
+ - list_3 | community.sops._latest_version == '1.2.3'
+ - list_4 | community.sops._latest_version == ''
+ - "[] | community.sops._latest_version == ''"
+ vars:
+ list_0:
+ - '1'
+ - '1.0'
+ - 1.0.0
+ list_1:
+ - '1.0'
+ - 1.2.1
+ - 1.0.0
+ list_2:
+ - '1.0'
+ - 1.2.1
+ - 1.2.1-rc.1
+ - 1.0.0
+ list_3:
+ - '1.0'
+ - 1.2.3
+ - 1.4.0-rc.1
+ - 1.4.0-a1+5
+ - 1.4.0+5
+ - 1.0.0
+ list_4:
+ - 1.4.0-rc.1
+ - 1.4.0-a1+5
+ - 1.4.0+5
diff --git a/ansible_collections/community/sops/tests/integration/targets/role_install_latest/meta/main.yml b/ansible_collections/community/sops/tests/integration/targets/role_install_latest/meta/main.yml
new file mode 100644
index 000000000..2fcd152f9
--- /dev/null
+++ b/ansible_collections/community/sops/tests/integration/targets/role_install_latest/meta/main.yml
@@ -0,0 +1,7 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+dependencies:
+ - setup_pkg_mgr
diff --git a/ansible_collections/community/sops/tests/integration/targets/role_install_localhost_remote/meta/main.yml b/ansible_collections/community/sops/tests/integration/targets/role_install_localhost_remote/meta/main.yml
new file mode 100644
index 000000000..2fcd152f9
--- /dev/null
+++ b/ansible_collections/community/sops/tests/integration/targets/role_install_localhost_remote/meta/main.yml
@@ -0,0 +1,7 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+dependencies:
+ - setup_pkg_mgr
diff --git a/ansible_collections/community/sops/tests/integration/targets/role_install_version/meta/main.yml b/ansible_collections/community/sops/tests/integration/targets/role_install_version/meta/main.yml
new file mode 100644
index 000000000..2fcd152f9
--- /dev/null
+++ b/ansible_collections/community/sops/tests/integration/targets/role_install_version/meta/main.yml
@@ -0,0 +1,7 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+dependencies:
+ - setup_pkg_mgr
diff --git a/ansible_collections/community/sops/tests/integration/targets/role_install_version/tasks/main.yml b/ansible_collections/community/sops/tests/integration/targets/role_install_version/tasks/main.yml
index 037a13b58..6443596b5 100644
--- a/ansible_collections/community/sops/tests/integration/targets/role_install_version/tasks/main.yml
+++ b/ansible_collections/community/sops/tests/integration/targets/role_install_version/tasks/main.yml
@@ -38,3 +38,21 @@
that:
- >-
'sops 3.7.0' in output.stdout
+
+- name: Install sops 3.8.0-rc.1
+ include_role:
+ name: community.sops.install
+ vars:
+ sops_version: 3.8.0-rc.1
+ sops_github_token: "{{ github_token | default('') | string }}"
+
+- name: Figure out sops version
+ command:
+ cmd: sops --version --disable-version-check
+ register: output
+
+- name: Check sops version
+ assert:
+ that:
+ - >-
+ 'sops 3.8.0-rc.1' == output.stdout
diff --git a/ansible_collections/community/sops/tests/integration/targets/setup_pkg_mgr/tasks/archlinux.yml b/ansible_collections/community/sops/tests/integration/targets/setup_pkg_mgr/tasks/archlinux.yml
new file mode 100644
index 000000000..f471cc19a
--- /dev/null
+++ b/ansible_collections/community/sops/tests/integration/targets/setup_pkg_mgr/tasks/archlinux.yml
@@ -0,0 +1,28 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# Since Arch Linux is a rolling distribution, it regularly needs its packages upgraded, otherwise some tests might
+# stop working due to conflicts during package installation. Since there is no good way to do this on container
+# startup time, we use the setup_pkg_mgr setup role to do this once per CI run (hopefully). In case the Arch Linux
+# tests are run outside of a container, we're using a date-based tag (see below) to avoid this running more than
+# once per day.
+
+- name: Create tag
+ copy:
+ dest: /tmp/.ansible_archlinux_sysupgrade_tag
+ content: |
+ Last ArchLinux system upgrade by integration tests was done on {{ ansible_facts.date_time.date }}.
+ register: archlinux_upgrade_tag
+
+- name: Upgrade all packages
+ pacman:
+ update_cache: true
+ upgrade: true
+ when: archlinux_upgrade_tag is changed
+
+- name: Remove EXTERNALLY-MANAGED file
+ file:
+ path: /usr/lib/python{{ ansible_python.version.major }}.{{ ansible_python.version.minor }}/EXTERNALLY-MANAGED
+ state: absent
diff --git a/ansible_collections/community/sops/tests/integration/targets/setup_pkg_mgr/tasks/main.yml b/ansible_collections/community/sops/tests/integration/targets/setup_pkg_mgr/tasks/main.yml
new file mode 100644
index 000000000..5b4c0be38
--- /dev/null
+++ b/ansible_collections/community/sops/tests/integration/targets/setup_pkg_mgr/tasks/main.yml
@@ -0,0 +1,9 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+- when: ansible_os_family == "Archlinux"
+ block:
+ - name: ArchLinux specific setup
+ include_tasks: archlinux.yml
diff --git a/ansible_collections/community/sops/tests/integration/targets/setup_sops/meta/main.yml b/ansible_collections/community/sops/tests/integration/targets/setup_sops/meta/main.yml
new file mode 100644
index 000000000..2fcd152f9
--- /dev/null
+++ b/ansible_collections/community/sops/tests/integration/targets/setup_sops/meta/main.yml
@@ -0,0 +1,7 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+dependencies:
+ - setup_pkg_mgr
diff --git a/ansible_collections/community/sops/tests/integration/targets/setup_sops/tasks/install.yml b/ansible_collections/community/sops/tests/integration/targets/setup_sops/tasks/install.yml
index 29ff98e18..86416fa68 100644
--- a/ansible_collections/community/sops/tests/integration/targets/setup_sops/tasks/install.yml
+++ b/ansible_collections/community/sops/tests/integration/targets/setup_sops/tasks/install.yml
@@ -19,7 +19,7 @@
- name: Download sops test GPG key on localhost
get_url:
- url: https://raw.githubusercontent.com/mozilla/sops/master/pgp/sops_functional_tests_key.asc
+ url: https://raw.githubusercontent.com/getsops/sops/master/pgp/sops_functional_tests_key.asc
dest: /tmp/sops_functional_tests_key.asc
delegate_to: localhost
@@ -43,7 +43,7 @@
- name: Download sops test GPG key on remote
get_url:
- url: https://raw.githubusercontent.com/mozilla/sops/master/pgp/sops_functional_tests_key.asc
+ url: https://raw.githubusercontent.com/getsops/sops/master/pgp/sops_functional_tests_key.asc
dest: /tmp/sops_functional_tests_key.asc
- name: Import sops test GPG key on remote
diff --git a/ansible_collections/community/sops/tests/integration/targets/var_sops/README.md b/ansible_collections/community/sops/tests/integration/targets/var_sops/README.md
index 38a3cfaa5..dad222e7a 100644
--- a/ansible_collections/community/sops/tests/integration/targets/var_sops/README.md
+++ b/ansible_collections/community/sops/tests/integration/targets/var_sops/README.md
@@ -23,4 +23,4 @@ If possible, extend an existing test. If that's not possible, or if you are afra
2. Create a `playbook.yml` and `validate.sh` in there (copy from a similar test and adjust);
3. Create subdirectories `group_vars` and/or `host_vars` and fill them as needed.
-For creating sops encrypted files, use the private GPG keys from https://raw.githubusercontent.com/mozilla/sops/master/pgp/sops_functional_tests_key.asc. There is a `.sops.yaml` file in this directory which makes sure that sops automatically uses the correct one of the keys provided in that file.
+For creating sops encrypted files, use the private GPG keys from https://raw.githubusercontent.com/getsops/sops/master/pgp/sops_functional_tests_key.asc. There is a `.sops.yaml` file in this directory which makes sure that sops automatically uses the correct one of the keys provided in that file.
diff --git a/ansible_collections/community/sops/tests/sanity/extra/extra-docs.py b/ansible_collections/community/sops/tests/sanity/extra/extra-docs.py
index c636beb08..251e6d70f 100755
--- a/ansible_collections/community/sops/tests/sanity/extra/extra-docs.py
+++ b/ansible_collections/community/sops/tests/sanity/extra/extra-docs.py
@@ -17,7 +17,7 @@ def main():
suffix = ':{env}'.format(env=env["ANSIBLE_COLLECTIONS_PATH"]) if 'ANSIBLE_COLLECTIONS_PATH' in env else ''
env['ANSIBLE_COLLECTIONS_PATH'] = '{root}{suffix}'.format(root=os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd()))), suffix=suffix)
p = subprocess.run(
- ['antsibull-docs', 'lint-collection-docs', '--plugin-docs', '--disallow-semantic-markup', '--skip-rstcheck', '.'],
+ ['antsibull-docs', 'lint-collection-docs', '--plugin-docs', '--skip-rstcheck', '.'],
env=env,
check=False,
)
diff --git a/ansible_collections/community/sops/tests/sanity/ignore-2.10.txt b/ansible_collections/community/sops/tests/sanity/ignore-2.10.txt
index 787dfec72..aacf26fbd 100644
--- a/ansible_collections/community/sops/tests/sanity/ignore-2.10.txt
+++ b/ansible_collections/community/sops/tests/sanity/ignore-2.10.txt
@@ -1,3 +1,6 @@
+docs/docsite/rst/guide.rst rstcheck
+plugins/modules/load_vars.py validate-modules:invalid-documentation
+plugins/modules/sops_encrypt.py validate-modules:invalid-documentation
tests/integration/targets/filter_decrypt/files/hidden-binary.yaml yamllint:error
tests/integration/targets/filter_decrypt/files/hidden-json.yaml yamllint:error
tests/integration/targets/lookup_sops/files/hidden-binary.yaml yamllint:error
diff --git a/ansible_collections/community/sops/tests/sanity/ignore-2.11.txt b/ansible_collections/community/sops/tests/sanity/ignore-2.11.txt
index 787dfec72..0db7d8897 100644
--- a/ansible_collections/community/sops/tests/sanity/ignore-2.11.txt
+++ b/ansible_collections/community/sops/tests/sanity/ignore-2.11.txt
@@ -1,3 +1,5 @@
+plugins/modules/load_vars.py validate-modules:invalid-documentation
+plugins/modules/sops_encrypt.py validate-modules:invalid-documentation
tests/integration/targets/filter_decrypt/files/hidden-binary.yaml yamllint:error
tests/integration/targets/filter_decrypt/files/hidden-json.yaml yamllint:error
tests/integration/targets/lookup_sops/files/hidden-binary.yaml yamllint:error
diff --git a/ansible_collections/community/sops/tests/sanity/ignore-2.12.txt b/ansible_collections/community/sops/tests/sanity/ignore-2.12.txt
index 787dfec72..0db7d8897 100644
--- a/ansible_collections/community/sops/tests/sanity/ignore-2.12.txt
+++ b/ansible_collections/community/sops/tests/sanity/ignore-2.12.txt
@@ -1,3 +1,5 @@
+plugins/modules/load_vars.py validate-modules:invalid-documentation
+plugins/modules/sops_encrypt.py validate-modules:invalid-documentation
tests/integration/targets/filter_decrypt/files/hidden-binary.yaml yamllint:error
tests/integration/targets/filter_decrypt/files/hidden-json.yaml yamllint:error
tests/integration/targets/lookup_sops/files/hidden-binary.yaml yamllint:error
diff --git a/ansible_collections/community/sops/tests/sanity/ignore-2.13.txt b/ansible_collections/community/sops/tests/sanity/ignore-2.13.txt
index 787dfec72..be35d9d66 100644
--- a/ansible_collections/community/sops/tests/sanity/ignore-2.13.txt
+++ b/ansible_collections/community/sops/tests/sanity/ignore-2.13.txt
@@ -1,3 +1,7 @@
+plugins/lookup/sops.py validate-modules:invalid-documentation
+plugins/modules/load_vars.py validate-modules:invalid-documentation
+plugins/modules/sops_encrypt.py validate-modules:invalid-documentation
+plugins/vars/sops.py validate-modules:invalid-documentation
tests/integration/targets/filter_decrypt/files/hidden-binary.yaml yamllint:error
tests/integration/targets/filter_decrypt/files/hidden-json.yaml yamllint:error
tests/integration/targets/lookup_sops/files/hidden-binary.yaml yamllint:error
diff --git a/ansible_collections/community/sops/tests/sanity/ignore-2.14.txt b/ansible_collections/community/sops/tests/sanity/ignore-2.14.txt
index 787dfec72..be35d9d66 100644
--- a/ansible_collections/community/sops/tests/sanity/ignore-2.14.txt
+++ b/ansible_collections/community/sops/tests/sanity/ignore-2.14.txt
@@ -1,3 +1,7 @@
+plugins/lookup/sops.py validate-modules:invalid-documentation
+plugins/modules/load_vars.py validate-modules:invalid-documentation
+plugins/modules/sops_encrypt.py validate-modules:invalid-documentation
+plugins/vars/sops.py validate-modules:invalid-documentation
tests/integration/targets/filter_decrypt/files/hidden-binary.yaml yamllint:error
tests/integration/targets/filter_decrypt/files/hidden-json.yaml yamllint:error
tests/integration/targets/lookup_sops/files/hidden-binary.yaml yamllint:error
diff --git a/ansible_collections/community/sops/tests/sanity/ignore-2.17.txt b/ansible_collections/community/sops/tests/sanity/ignore-2.17.txt
new file mode 100644
index 000000000..787dfec72
--- /dev/null
+++ b/ansible_collections/community/sops/tests/sanity/ignore-2.17.txt
@@ -0,0 +1,4 @@
+tests/integration/targets/filter_decrypt/files/hidden-binary.yaml yamllint:error
+tests/integration/targets/filter_decrypt/files/hidden-json.yaml yamllint:error
+tests/integration/targets/lookup_sops/files/hidden-binary.yaml yamllint:error
+tests/integration/targets/lookup_sops/files/hidden-json.yaml yamllint:error
diff --git a/ansible_collections/community/sops/tests/sanity/ignore-2.17.txt.license b/ansible_collections/community/sops/tests/sanity/ignore-2.17.txt.license
new file mode 100644
index 000000000..edff8c768
--- /dev/null
+++ b/ansible_collections/community/sops/tests/sanity/ignore-2.17.txt.license
@@ -0,0 +1,3 @@
+GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+SPDX-License-Identifier: GPL-3.0-or-later
+SPDX-FileCopyrightText: Ansible Project
diff --git a/ansible_collections/community/sops/tests/sanity/ignore-2.9.txt b/ansible_collections/community/sops/tests/sanity/ignore-2.9.txt
index 787dfec72..aacf26fbd 100644
--- a/ansible_collections/community/sops/tests/sanity/ignore-2.9.txt
+++ b/ansible_collections/community/sops/tests/sanity/ignore-2.9.txt
@@ -1,3 +1,6 @@
+docs/docsite/rst/guide.rst rstcheck
+plugins/modules/load_vars.py validate-modules:invalid-documentation
+plugins/modules/sops_encrypt.py validate-modules:invalid-documentation
tests/integration/targets/filter_decrypt/files/hidden-binary.yaml yamllint:error
tests/integration/targets/filter_decrypt/files/hidden-json.yaml yamllint:error
tests/integration/targets/lookup_sops/files/hidden-binary.yaml yamllint:error