Debian Codegraph @

ansible_collections/community/sops/tests/integration/targets/vars_sops/run-tests.sh

raw
1 #!/usr/bin/env bash
2 # Copyright (c) Ansible Project
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)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 set -eux
7
8 if [ "$(command -v sops)" == "" ]; then
9 echo "sops is not installed"
10 exit 1
11 fi
12
13 # Get hold of SOPS version
14 set +e
15 SOPS_VERSION_RAW="$(sops --version --disable-version-check)" || SOPS_VERSION_RAW="$(sops --version)"
16 set -e
17 SOPS_VERSION="$(echo "${SOPS_VERSION_RAW}" | sed -E 's/^sops ([0-9.]+).*/\1/g')"
18
19 # Run all tests
20 for TEST in $(find . -maxdepth 1 -type d -name 'test-*' | sort); do
21 ./run-test.sh "${TEST}" "${SOPS_VERSION}" "$@"
22 done