diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-18 05:52:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-18 05:52:22 +0000 |
commit | 38b7c80217c4e72b1d8988eb1e60bb6e77334114 (patch) | |
tree | 356e9fd3762877d07cde52d21e77070aeff7e789 /ansible_collections/community/sops/tests/integration | |
parent | Adding upstream version 7.7.0+dfsg. (diff) | |
download | ansible-38b7c80217c4e72b1d8988eb1e60bb6e77334114.tar.xz ansible-38b7c80217c4e72b1d8988eb1e60bb6e77334114.zip |
Adding upstream version 9.4.0+dfsg.upstream/9.4.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/community/sops/tests/integration')
11 files changed, 134 insertions, 3 deletions
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. |