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