From 54ff6c02ec5804995841cbaea93ecaa49915dec2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 22 Apr 2008 08:16:01 +0000 Subject: [PATCH] * A test for nix-store --import / --export. --- tests/Makefile.am | 2 +- tests/export.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests/export.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index bab9e8ee4..c65f68584 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 = diff --git a/tests/export.sh b/tests/export.sh new file mode 100644 index 000000000..53c9ec3c6 --- /dev/null +++ b/tests/export.sh @@ -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