summaryrefslogtreecommitdiff
path: root/tests/guix-daemon.sh
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2018-01-11 14:22:50 -0800
committerLeo Famulari <leo@famulari.name>2018-01-11 14:22:50 -0800
commit4adb40bffc0dda8871878283887a0e0cd88d9578 (patch)
tree74d5fb686116002da72de4a1075d0ed8f307cec1 /tests/guix-daemon.sh
parent4610ab7c9a5327df0d475262817bc081a5891aa8 (diff)
parent138c08899ba73049de8afd2b74a8cf6845a1d9e1 (diff)
downloadguix-patches-4adb40bffc0dda8871878283887a0e0cd88d9578.tar
guix-patches-4adb40bffc0dda8871878283887a0e0cd88d9578.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/guix-daemon.sh')
-rw-r--r--tests/guix-daemon.sh38
1 files changed, 37 insertions, 1 deletions
diff --git a/tests/guix-daemon.sh b/tests/guix-daemon.sh
index 7212e3eb68..6f91eb58bf 100644
--- a/tests/guix-daemon.sh
+++ b/tests/guix-daemon.sh
@@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2012, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
@@ -193,3 +193,39 @@ do
GUIX_DAEMON_SOCKET="$socket" guile -c "$client_code"
kill "$daemon_pid"
done
+
+# Log compression.
+
+guix-daemon --listen="$socket" --disable-chroot --debug --log-compression=gzip &
+daemon_pid=$!
+
+stamp="compressed-build-log-test-$$-`date +%H%M%S`"
+client_code="
+ (use-modules (guix) (gnu packages bootstrap))
+
+ (with-store store
+ (run-with-store store
+ (mlet %store-monad ((drv (lower-object
+ (computed-file \"compressed-log-test\"
+ #~(begin
+ (display \"$stamp\")
+ (newline)
+ (mkdir #\$output))
+ #:guile %bootstrap-guile))))
+ (display (derivation-file-name drv))
+ (newline)
+ (return #t))))
+"
+
+GUIX_DAEMON_SOCKET="$socket"
+export GUIX_DAEMON_SOCKET
+
+drv=`guile -c "$client_code"`
+guix build "$drv"
+
+log=`guix build "$drv" --log-file`
+test -f "$log"
+case "$log" in
+ *.gz) test "`gunzip -c < "$log"`" = "$stamp" ;;
+ *) false ;;
+esac