1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 02:43:54 +02:00

* Merged the no-bdb branch (-r10900:HEAD

https://svn.nixos.org/repos/nix/nix/branches/no-bdb).
This commit is contained in:
Eelco Dolstra 2008-06-09 13:52:45 +00:00
parent 4ed01ed791
commit b0e92f6d47
24 changed files with 923 additions and 739 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 =

View file

@ -11,7 +11,7 @@ $nixstore -q --graph "$drvPath" > $TEST_ROOT/graph
if test -n "$dot"; then
# Does it parse?
$dot < $TEST_ROOT/graph
fi
fi
outPath=$($nixstore -rvv "$drvPath")

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

View file

@ -95,4 +95,5 @@ chmod +x $NIX_BIN_DIR/nix/download-using-manifests.pl
$nixstore --init
# Did anything happen?
test -e "$NIX_DB_DIR"/validpaths
test -e "$NIX_DB_DIR"/info
test -e "$NIX_DB_DIR"/referrer

View file

@ -9,12 +9,50 @@ reference=$NIX_STORE_DIR/abcdef
touch $reference
(echo $reference && echo && echo 0) | $nixstore --register-validity
echo "registering..."
time for ((n = 0; n < $max; n++)); do
echo "making registration..."
for ((n = 0; n < $max; n++)); do
storePath=$NIX_STORE_DIR/$n
touch $storePath
(echo $storePath && echo && echo 1 && echo $reference)
done | $nixstore --register-validity
ref2=$NIX_STORE_DIR/$((n+1))
if test $((n+1)) = $max; then
ref2=$reference
fi
(echo $storePath && echo && echo 2 && echo $reference && echo $ref2)
done > $TEST_ROOT/reg_info
echo "registering..."
time $nixstore --register-validity < $TEST_ROOT/reg_info
oldTime=$(cat test-tmp/db/info/1 | grep Registered-At)
echo "sleeping..."
sleep 2
echo "reregistering..."
time $nixstore --register-validity --reregister < $TEST_ROOT/reg_info
newTime=$(cat test-tmp/db/info/1 | grep Registered-At)
if test "$newTime" != "$oldTime"; then
echo "reregistration changed original registration time"
exit 1
fi
if test "$(cat test-tmp/db/referrer/1 | wc -w)" != 1; then
echo "reregistration duplicated referrers"
exit 1
fi
echo "collecting garbage..."
time $nixstore --gc 2> /dev/null
ln -sfn $reference "$NIX_STATE_DIR"/gcroots/ref
time $nixstore --gc
if test "$(cat test-tmp/db/referrer/abcdef | wc -w)" != 0; then
echo "referrers not cleaned up"
exit 1
fi