Debian Codegraph @

ansible_collections/community/sops/tests/integration/targets/vars_sops/test-bad-file-error/validate.sh

raw
1 #!/bin/sh
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 [ "$1" != 4 ]; then
9 exit 1
10 fi
11
12 ( grep -F "ERROR! error with file" "$2" && grep "sops metadata not found" "$2" ) || ( grep -F "[ERROR]: error with file" "$2" && grep "sops metadata not found" "$2" ) || ( grep -F "ERROR! SOPS vars plugin: file" "$2" && grep "is not encrypted" "$2" ) || ( grep -F "[ERROR]: SOPS vars plugin: file" "$2" && grep "is not encrypted" "$2" )
13 ( grep -vF "[WARNING]: SOPS vars plugin: skipping unencrypted file" "$2" )