about summary refs log tree commit diff
path: root/tests/install-package.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/install-package.sh')
-rw-r--r--tests/install-package.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/install-package.sh b/tests/install-package.sh
new file mode 100644
index 000000000000..653dfee4c8d1
--- /dev/null
+++ b/tests/install-package.sh
@@ -0,0 +1,21 @@
+source common.sh
+
+# Note: this test expects to be run *after* nix-push.sh.
+
+drvPath=$(nix-instantiate ./dependencies.nix)
+outPath=$(nix-store -q $drvPath)
+
+clearStore
+clearProfiles
+
+cat > $TEST_ROOT/foo.nixpkg <<EOF
+NIXPKG1 file://$TEST_ROOT/cache/MANIFEST simple $system $drvPath $outPath
+EOF
+
+nix-install-package --non-interactive -p $profiles/test $TEST_ROOT/foo.nixpkg
+test "$(nix-env -p $profiles/test -q '*' | wc -l)" -eq 1
+
+clearProfiles
+
+nix-install-package --non-interactive -p $profiles/test --url file://$TEST_ROOT/foo.nixpkg
+test "$(nix-env -p $profiles/test -q '*' | wc -l)" -eq 1