diff options
author | Ed Santiago <santiago@redhat.com> | 2019-05-02 05:49:50 -0600 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2019-05-02 08:14:59 -0600 |
commit | 295c531ecec8661408f01ac4e015d75fec865376 (patch) | |
tree | 207a92de67c76264dc4563588e84a261facb8570 /contrib/cirrus/integration_test.sh | |
parent | 7d05ff3fc772a7be4860ed4a3cd59a62f8bb893a (diff) | |
download | podman-295c531ecec8661408f01ac4e015d75fec865376.tar.gz podman-295c531ecec8661408f01ac4e015d75fec865376.tar.bz2 podman-295c531ecec8661408f01ac4e015d75fec865376.zip |
cirrus lib.sh: refactor req_env_var()
Existing code was not working due to a bash gotcha ('exit'
from a pipeline). It also had unnecessary duplication.
New version is safer; also includes unit tests run under localunit.
Existing invocations of req_env_var replaced via:
$ [ edit setup_environment.sh, move one closing quote to its own line ]
$ perl -ni -e 's/(?<=req_env_var )"(\S+)\s+\$\1"/$1/; if (/req_env_var "$/ .. /^\s*"/) { chomp; s/(?<=\S)\s.*//; if (/^\s*"/) { print "\n" } else { unless (/req_env_var/) { s/^\s+//; print " ";} print;} } else { print }' $(ack -l req_env_var)
$ [ hand-massage an incorrect instance of '@' in lib.sh:ircmsg() ]
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'contrib/cirrus/integration_test.sh')
-rwxr-xr-x | contrib/cirrus/integration_test.sh | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/contrib/cirrus/integration_test.sh b/contrib/cirrus/integration_test.sh index 95387ff49..71223803c 100755 --- a/contrib/cirrus/integration_test.sh +++ b/contrib/cirrus/integration_test.sh @@ -3,13 +3,7 @@ set -e source $(dirname $0)/lib.sh -req_env_var " -GOSRC $GOSRC -SCRIPT_BASE $SCRIPT_BASE -OS_RELEASE_ID $OS_RELEASE_ID -OS_RELEASE_VER $OS_RELEASE_VER -CONTAINER_RUNTIME $CONTAINER_RUNTIME -" +req_env_var GOSRC SCRIPT_BASE OS_RELEASE_ID OS_RELEASE_VER CONTAINER_RUNTIME exit_handler() { set +ex @@ -39,7 +33,7 @@ then exit $? elif [[ "$SPECIALMODE" == "rootless" ]] then - req_env_var "ROOTLESS_USER $ROOTLESS_USER" + req_env_var ROOTLESS_USER set -x ssh $ROOTLESS_USER@localhost \ -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=no \ |