Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
make test that works?
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaudill committed Oct 17, 2023
1 parent 915c53a commit b9149ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions examples/chtest/Build
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 4 additions & 6 deletions test/run/ch-run_misc.bats
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,23 @@ EOF
}

@test "\$HOME" {
LC_ALL=C

scope quick
echo "host: $HOME"
[[ $HOME ]]
[[ $USER ]]

# 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 = "/" ]]
Expand Down

0 comments on commit b9149ce

Please sign in to comment.