diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-01-03 14:53:03 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-01-03 14:53:03 +0100 |
commit | 53334dd6e9e296e17110ebcd2b1f93f117ffe36a (patch) | |
tree | 2653db2eab9a204dab892ea8b6812cadf7209e84 /tests/guix-system.sh | |
parent | 1575dcd134f4fae7255787293f4988bbd043de95 (diff) | |
parent | 51385362f76e2f823ac8d8cf720d06c386504069 (diff) | |
download | guix-53334dd6e9e296e17110ebcd2b1f93f117ffe36a.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/guix-system.sh')
-rw-r--r-- | tests/guix-system.sh | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/tests/guix-system.sh b/tests/guix-system.sh index e20bc98713..02e2524d9e 100644 --- a/tests/guix-system.sh +++ b/tests/guix-system.sh @@ -17,7 +17,7 @@ # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. # -# Test the daemon and its interaction with 'guix substitute'. +# Test 'guix system', mostly error reporting. # set -e @@ -26,7 +26,15 @@ guix system --version tmpfile="t-guix-system-$$" errorfile="t-guix-system-error-$$" -trap 'rm -f "$tmpfile" "$errorfile"' EXIT + +# Note: This directory is chosen outside $builddir so that relative file name +# canonicalization doesn't mess up with 'current-source-directory', used by +# 'local-file' ('load' forces 'relative' for +# %FILE-PORT-NAME-CANONICALIZATION.) +tmpdir="${TMPDIR:-/tmp}/t-guix-system-$$" +mkdir "$tmpdir" + +trap 'rm -f "$tmpfile" "$errorfile" "$tmpdir"/*; rmdir "$tmpdir"' EXIT # Reporting of syntax errors. @@ -180,3 +188,23 @@ make_user_config "users" "group-that-does-not-exist" if guix system build "$tmpfile" -n 2> "$errorfile" then false else grep "supplementary group.*group-that-does-not-exist.*undeclared" "$errorfile"; fi + +# Try 'local-file' and relative file name resolution. + +cat > "$tmpdir/config.scm"<<EOF +(use-modules (gnu)) +(use-service-modules networking) + +(operating-system + $OS_BASE + (services (cons (tor-service (local-file "my-torrc")) + %base-services))) +EOF + +cat > "$tmpdir/my-torrc"<<EOF +# This is an example file. +EOF + +# In both cases 'my-torrc' should be properly resolved. +guix system build "$tmpdir/config.scm" -n +(cd "$tmpdir"; guix system build "config.scm" -n) |