* A test for nix-store --import / --export.

This commit is contained in:
Eelco Dolstra 2008-04-22 08:16:01 +00:00
parent f83f764218
commit 54ff6c02ec
2 changed files with 32 additions and 1 deletions

View File

@ -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
View 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