mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 06:42:28 +00:00
* A test for nix-store --import / --export.
This commit is contained in:
parent
f83f764218
commit
54ff6c02ec
@ -19,7 +19,7 @@ TESTS = init.sh hash.sh lang.sh add.sh simple.sh dependencies.sh \
|
||||
fallback.sh nix-push.sh gc.sh gc-concurrent.sh verify.sh nix-pull.sh \
|
||||
referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh fixed.sh \
|
||||
gc-runtime.sh install-package.sh check-refs.sh filter-source.sh \
|
||||
remote-store.sh
|
||||
remote-store.sh export.sh
|
||||
|
||||
XFAIL_TESTS =
|
||||
|
||||
|
31
tests/export.sh
Normal file
31
tests/export.sh
Normal file
@ -0,0 +1,31 @@
|
||||
source common.sh
|
||||
|
||||
clearStore
|
||||
|
||||
outPath=$($nixstore -r $($nixinstantiate dependencies.nix))
|
||||
|
||||
$nixstore --export $outPath > $TEST_ROOT/exp
|
||||
|
||||
$nixstore --export $($nixstore -qR $outPath) > $TEST_ROOT/exp_all
|
||||
|
||||
|
||||
clearStore
|
||||
|
||||
if $nixstore --import < $TEST_ROOT/exp; then
|
||||
echo "importing a non-closure should fail"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
clearStore
|
||||
|
||||
$nixstore --import < $TEST_ROOT/exp_all
|
||||
|
||||
$nixstore --export $($nixstore -qR $outPath) > $TEST_ROOT/exp_all2
|
||||
|
||||
|
||||
clearStore
|
||||
|
||||
# Regression test: the derivers in exp_all2 are empty, which shouldn't
|
||||
# cause a failure.
|
||||
$nixstore --import < $TEST_ROOT/exp_all2
|
Loading…
Reference in New Issue
Block a user