Skip to content

Commit

Permalink
Merge pull request containers#296 from Kiskae/upstream-tmpdir-fix
Browse files Browse the repository at this point in the history
test: remove hardcoded /tmp
  • Loading branch information
cgwalters authored Jun 4, 2024
2 parents 28dc491 + 6928fcf commit 3d2af03
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/test-checksums.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ TEST_ASSETS="$3"
has_fsck=$(check_erofs_fsck)

set -e
tmpfile=$(mktemp /tmp/lcfs-test.XXXXXX)
tmpfile2=$(mktemp /tmp/lcfs-test.XXXXXX)
tmpfile=$(mktemp --tmpdir lcfs-test.XXXXXX)
tmpfile2=$(mktemp --tmpdir lcfs-test.XXXXXX)
trap 'rm -rf -- "$tmpfile" "$tmpfile2"' EXIT

for format in erofs ; do
Expand Down
4 changes: 2 additions & 2 deletions tests/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ assert_file_has_content () {
}

check_whiteout () {
tmpfile=$(mktemp /tmp/lcfs-whiteout.XXXXXX)
tmpfile=$(mktemp --tmpdir lcfs-whiteout.XXXXXX)
rm -f $tmpfile
if mknod $tmpfile c 0 0 &> /dev/null; then
echo y
Expand Down Expand Up @@ -56,7 +56,7 @@ check_erofs_fsck () {

check_fsverity () {
fsverity --version >/dev/null 2>&1 || return 1
tmpfile=$(mktemp /var/tmp/lcfs-fsverity.XXXXXX)
tmpfile=$(mktemp --tmpdir lcfs-fsverity.XXXXXX)
echo foo > $tmpfile
fsverity enable $tmpfile >/dev/null 2>&1 || return 1
return 0
Expand Down
2 changes: 1 addition & 1 deletion tests/test-random-fuse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BINDIR="$1"

set -e

workdir=$(mktemp -d /var/tmp/lcfs-test.XXXXXX)
workdir=$(mktemp --directory --tmpdir lcfs-test.XXXXXX)
exit_cleanup() {
umount "$workdir/mnt" &> /dev/null || true
rm -rf -- "$workdir"
Expand Down
2 changes: 1 addition & 1 deletion tests/test-units.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BINDIR=$(cd "$1" && pwd)

set -e

workdir=$(mktemp -d /var/tmp/lcfs-test.XXXXXX)
workdir=$(mktemp --directory --tmpdir lcfs-test.XXXXXX)
trap 'rm -rf -- "$workdir"' EXIT

. $(dirname $0)/test-lib.sh
Expand Down

0 comments on commit 3d2af03

Please sign in to comment.