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 29, 2020
1 parent 5d8504b commit d2b7ecf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
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 d2b7ecf

Please sign in to comment.