From edb5d143cca9deb18fcaaf652a15472d6deb318a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Tue, 11 Jun 2019 18:49:50 +0200 Subject: [PATCH] Work around bats corrupting IFS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CentOS, as of bats-0.4.0-1.20141016git3b33a5a.el7.noarch, misses the fix for https://github.com/sstephenson/bats/issues/89 , causing (read) not to split words at white space. Set IFS to the default value explicitly to work around this. Signed-off-by: Miloslav Trmač --- systemtest/010-inspect.bats | 2 +- systemtest/050-signing.bats | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/systemtest/010-inspect.bats b/systemtest/010-inspect.bats index b465d086bd..7da9bad943 100644 --- a/systemtest/010-inspect.bats +++ b/systemtest/010-inspect.bats @@ -44,7 +44,7 @@ load helpers # # The reason for a hardcoded list, instead of 'jq keys', is that RepoTags # is always empty locally, but a list remotely. - while read key expect; do + while IFS=$' \t\n' read key expect; do local=$(echo "$inspect_local" | jq -r ".$key") remote=$(echo "$inspect_remote" | jq -r ".$key") diff --git a/systemtest/050-signing.bats b/systemtest/050-signing.bats index 4f52141513..0f035c1687 100644 --- a/systemtest/050-signing.bats +++ b/systemtest/050-signing.bats @@ -97,7 +97,7 @@ END_POLICY_JSON # Push a bunch of images. Do so *without* --policy flag; this lets us # sign or not, creating images that will or won't conform to policy. - while read path sig comments; do + while IFS=$' \t\n' read path sig comments; do local sign_opt= if [[ $sig != '-' ]]; then sign_opt="--sign-by=${sig}@test.redhat.com" @@ -118,7 +118,7 @@ END_PUSH # Done pushing. Now try to fetch. From here on we use the --policy option. # The table below lists the paths to fetch, and the expected errors (or # none, if we expect them to pass). - while read path expected_error; do + while IFS=$' \t\n' read path expected_error; do expected_rc= if [[ -n $expected_error ]]; then expected_rc=1