about summary refs log tree commit diff
path: root/tests/dump-db.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-26T16·47+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-26T16·47+0100
commitfdff3a7eae8a4d2f0e6eae992d3c3cf64e1a3ad3 (patch)
tree547b195859e1a8bdd4de585c2a157c04cb76575d /tests/dump-db.sh
parent506d86394d463d862b212f2f203bdded98a8efab (diff)
Add a test for nix-store --dump-db / --load-db
Diffstat (limited to 'tests/dump-db.sh')
-rw-r--r--tests/dump-db.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/dump-db.sh b/tests/dump-db.sh
new file mode 100644
index 000000000000..234b7ac02680
--- /dev/null
+++ b/tests/dump-db.sh
@@ -0,0 +1,20 @@
+source common.sh
+
+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_DB_DIR
+
+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