Skip to content

Commit

Permalink
rename run to shell in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mkenigs committed Apr 30, 2020
1 parent 5d8504b commit f459ca5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion tests/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ nix_tests = \
fetchGitSubmodules.sh \
fetchMercurial.sh \
signing.sh \
run.sh \
shell.sh \
brotli.sh \
pure-eval.sh \
check.sh \
Expand Down
28 changes: 0 additions & 28 deletions tests/run.sh

This file was deleted.

File renamed without changes.
28 changes: 28 additions & 0 deletions tests/shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
source common.sh

clearStore
clearCache

nix shell -f shell-hello.nix hello -c hello | grep 'Hello World'
nix shell -f shell-hello.nix hello -c hello NixOS | grep 'Hello NixOS'

if ! canUseSandbox; then exit; fi

chmod -R u+w $TEST_ROOT/store0 || true
rm -rf $TEST_ROOT/store0

clearStore

path=$(nix eval --raw -f shell-hello.nix hello)

# Note: we need the sandbox paths to ensure that the shell is
# visible in the sandbox.
nix shell --sandbox-build-dir /build-tmp \
--sandbox-paths '/nix? /bin? /lib? /lib64? /usr?' \
--store $TEST_ROOT/store0 -f shell-hello.nix hello -c hello | grep 'Hello World'

path2=$(nix shell --sandbox-paths '/nix? /bin? /lib? /lib64? /usr?' --store $TEST_ROOT/store0 -f shell-hello.nix hello -c $SHELL -c 'type -p hello')

[[ $path/bin/hello = $path2 ]]

[[ -e $TEST_ROOT/store0/nix/store/$(basename $path)/bin/hello ]]

0 comments on commit f459ca5

Please sign in to comment.