2024-05-28 16:43:04 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2008-06-09 13:52:45 +00:00
|
|
|
source common.sh
|
|
|
|
|
|
|
|
clearStore
|
|
|
|
|
2012-09-11 23:14:15 +00:00
|
|
|
outPath=$(nix-build dependencies.nix --no-out-link)
|
2008-06-09 13:52:45 +00:00
|
|
|
|
2011-10-10 21:32:34 +00:00
|
|
|
nix-store --export $outPath > $TEST_ROOT/exp
|
2008-06-09 13:52:45 +00:00
|
|
|
|
2011-10-10 21:32:34 +00:00
|
|
|
nix-store --export $(nix-store -qR $outPath) > $TEST_ROOT/exp_all
|
2008-06-09 13:52:45 +00:00
|
|
|
|
2018-02-13 11:05:25 +00:00
|
|
|
if nix-store --export $outPath >/dev/full ; then
|
|
|
|
echo "exporting to a bad file descriptor should fail"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2008-06-09 13:52:45 +00:00
|
|
|
|
|
|
|
clearStore
|
|
|
|
|
2011-10-10 21:32:34 +00:00
|
|
|
if nix-store --import < $TEST_ROOT/exp; then
|
2008-06-09 13:52:45 +00:00
|
|
|
echo "importing a non-closure should fail"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
clearStore
|
|
|
|
|
2011-10-10 21:32:34 +00:00
|
|
|
nix-store --import < $TEST_ROOT/exp_all
|
2008-06-09 13:52:45 +00:00
|
|
|
|
2011-10-10 21:32:34 +00:00
|
|
|
nix-store --export $(nix-store -qR $outPath) > $TEST_ROOT/exp_all2
|
2008-06-09 13:52:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
clearStore
|
|
|
|
|
|
|
|
# Regression test: the derivers in exp_all2 are empty, which shouldn't
|
|
|
|
# cause a failure.
|
2011-10-10 21:32:34 +00:00
|
|
|
nix-store --import < $TEST_ROOT/exp_all2
|