1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-10 12:36:01 +01:00
nix/tests/dump-db.sh
regnat c434a11a04 Allow running all the tests with the daemon
When `NIX_DAEMON_PACKAGE` is set, make all the tests use the Nix daemon.
That way we can test every piece of Nix functionality both with and
without the daemon.

Tests for which using the daemon isn’t possible or doesn’t make sens can
selectively be disabled with `needLocalStore`

(cherry picked from commit addacfce4a)
2025-02-13 11:36:30 -05:00

22 lines
430 B
Bash

source common.sh
needLocalStore "--dump-db requires a local store"
clearStore
path=$(nix-build dependencies.nix -o $TEST_ROOT/result)
deps="$(nix-store -qR $TEST_ROOT/result)"
nix-store --dump-db > $TEST_ROOT/dump
rm -rf $NIX_STATE_DIR/db
nix-store --load-db < $TEST_ROOT/dump
deps2="$(nix-store -qR $TEST_ROOT/result)"
[ "$deps" = "$deps2" ];
nix-store --dump-db > $TEST_ROOT/dump2
cmp $TEST_ROOT/dump $TEST_ROOT/dump2