Skip to content

Commit

Permalink
PR #277 from @rstyd: dereference symlinks in $CH_TEST_IMGDIR and $CH_…
Browse files Browse the repository at this point in the history
…TEST_TARDIR (closes #143)
  • Loading branch information
rstyd authored and reidpr committed Nov 1, 2018
1 parent 2686af1 commit d27b3c2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/common.bash
Expand Up @@ -160,9 +160,15 @@ else
ch_cray=
fi

# Separate directories for tarballs and images
ch_imgdir=$CH_TEST_IMGDIR
ch_tardir=$CH_TEST_TARDIR
# Separate directories for tarballs and images.
#
# Canonicalize both so the have consistent paths and we can reliably use them
# in tests (see issue #143). We use readlink(1) rather than realpath(2),
# despite the admonition in the man page, because it's more portable [1].
#
# [1]: https://unix.stackexchange.com/a/136527
ch_imgdir=$(readlink -ef "$CH_TEST_IMGDIR")
ch_tardir=$(readlink -ef "$CH_TEST_TARDIR")

# Some test variables
ch_tag=$(basename "$BATS_TEST_DIRNAME")
Expand Down

0 comments on commit d27b3c2

Please sign in to comment.