From b9149cefc4d03a44d8193788f8fc22c8ad43e205 Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Tue, 17 Oct 2023 16:55:53 +0000 Subject: [PATCH] make test that works? --- examples/chtest/Build | 2 ++ test/run/ch-run_misc.bats | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/chtest/Build b/examples/chtest/Build index b575c6f27..b55121b82 100755 --- a/examples/chtest/Build +++ b/examples/chtest/Build @@ -125,6 +125,8 @@ chmod 0777 img/maxperms_file mkdir img/maxperms_dir chmod 1777 img/maxperms_dir +# Get rid of “/root” directory, used for “HOME” test in “ch-run_misc.bats”. +rmdir "$img"/root ## Tar it up. diff --git a/test/run/ch-run_misc.bats b/test/run/ch-run_misc.bats index cbab23857..eee8f1cc9 100644 --- a/test/run/ch-run_misc.bats +++ b/test/run/ch-run_misc.bats @@ -60,6 +60,8 @@ EOF } @test "\$HOME" { + LC_ALL=C + scope quick echo "host: $HOME" [[ $HOME ]] @@ -67,18 +69,14 @@ EOF # default: no change # shellcheck disable=SC2016 - run ch-run "$ch_timg" -- /bin/sh -c 'echo $HOME' + run ch-run hello -- /bin/sh -c 'echo $HOME' echo "$output" [[ $status -eq 0 ]] [[ $output = "/root" ]] # default: no “/root” - ch-image build -t noroot -f - . << 'EOF' - FROM alpine:latest - RUN rm -rf /root -EOF # shellcheck disable=SC2016 - run ch-run noroot -- /bin/sh -c 'echo $HOME' + run ch-run "$ch_timg" -- /bin/sh -c 'echo $HOME' echo "$output" [[ $status -eq 0 ]] [[ $output = "/" ]]