summaryrefslogtreecommitdiff
path: root/tests/guix-pack-relocatable.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/guix-pack-relocatable.sh')
-rw-r--r--tests/guix-pack-relocatable.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/guix-pack-relocatable.sh b/tests/guix-pack-relocatable.sh
index e93610eedc..a3d9013133 100644
--- a/tests/guix-pack-relocatable.sh
+++ b/tests/guix-pack-relocatable.sh
@@ -1,5 +1,6 @@
# GNU Guix --- Functional package management for GNU
# Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2020 Eric Bavier <bavier@posteo.net>
#
# This file is part of GNU Guix.
#
@@ -84,3 +85,39 @@ chmod -Rf +w "$test_directory"; rm -rf "$test_directory"/*
tarball="`guix pack -R -S /share=share groff:doc`"
(cd "$test_directory"; tar xvf "$tarball")
test -d "$test_directory/share/doc/groff/html"
+chmod -Rf +w "$test_directory"; rm -rf "$test_directory"/*
+
+# Check that packages that mix executable and support files (e.g. git) in the
+# "binary" directories still work after wrapped.
+tarball="`guix pack $relocatable_option -S /opt= git-minimal`"
+(cd "$test_directory"; tar xvf "$tarball"
+ mkdir foo; cd foo; touch .gitignore bar.txt bif.txt)
+do_test='
+ export GUIX_PROFILE="$test_directory/opt"
+ . $GUIX_PROFILE/etc/profile
+ cd "$test_directory/foo"
+ git config --global user.email "gnu@example.com"
+ git config --global user.name "Gnu Hacker"
+ git --version >"$test_directory/output"
+ git init; git add .gitignore; git commit -m "Initial"
+ git branch a; git branch b
+ git checkout a
+ git add bar.txt; git commit -m "Add bar"
+ git checkout b
+ git add bif.txt; git commit -m "Add bif"
+ git checkout master
+ # Check merge-octopus script which sources libexec/git-core/git-sh-setup
+ git merge a b -m "merge" >>"$test_directory/output"
+'
+if unshare -r true # Are user namespaces supported?
+then
+ unshare -mrf \
+ sh -c 'mount -t tmpfs none "$HOME"; # Forbid git to read user configs
+ mount -t tmpfs none "$STORE_PARENT"; \
+ '"$do_test"
+ cd -
+else
+ ( $do_test )
+fi
+grep 'git version' "$test_directory/output"
+grep 'octopus' "$test_directory/output"