Skip to content

Commit

Permalink
Work around bats corrupting IFS
Browse files Browse the repository at this point in the history
CentOS, as of bats-0.4.0-1.20141016git3b33a5a.el7.noarch, misses the fix
for sstephenson/bats#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č <[email protected]>
  • Loading branch information
mtrmac committed Feb 27, 2020
1 parent fc93e93 commit c9be3cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion systemtest/010-inspect.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
4 changes: 2 additions & 2 deletions systemtest/050-signing.bats
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,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"
Expand All @@ -117,7 +117,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
Expand Down

0 comments on commit c9be3cc

Please sign in to comment.