aboutsummaryrefslogtreecommitdiff
path: root/test-env.in
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-02-24 23:05:45 +0100
committerLudovic Courtès <ludo@gnu.org>2015-02-24 23:43:03 +0100
commit2178ed66f7ae8f793078c7e392af4bf1fb472968 (patch)
tree91589714052eb7d3fb36ca61f538ca72a578143c /test-env.in
parent43da8f018d5835b62e8f5f1f4e2cc701f828a3db (diff)
downloadguix-2178ed66f7ae8f793078c7e392af4bf1fb472968.tar
guix-2178ed66f7ae8f793078c7e392af4bf1fb472968.tar.gz
build: Reject or warn against file name length limit overruns.
* m4/guix.m4 (GUIX_TEST_ROOT_DIRECTORY, LINUX_HASH_BANG_LIMIT, SOCKET_FILE_NAME_LIMIT, GUIX_SOCKET_FILE_NAME_LENGTH, GUIX_TEST_SOCKET_FILE_NAME_LENGTH, GUIX_HASH_BANG_LENGTH, GUIX_CHECK_FILE_NAME_LIMITS): New macros. * configure.ac: Use 'GUIX_CHECK_FILE_NAME_LIMITS'. * config-daemon.ac: Use 'GUIX_TEST_ROOT_DIRECTORY'. * test-env.in: Check socket name length and emit warning if it exceeds 107.
Diffstat (limited to 'test-env.in')
-rw-r--r--test-env.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/test-env.in b/test-env.in
index f66a0db555..a7f506ec19 100644
--- a/test-env.in
+++ b/test-env.in
@@ -1,7 +1,7 @@
#!/bin/sh
# GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
@@ -52,6 +52,13 @@ then
# Currently, in Nix builds, we're at ~106 chars...
NIX_STATE_DIR="@GUIX_TEST_ROOT@/var/$$"
+ # We can't exit when we reach the limit, because perhaps the test doesn't
+ # actually rely on the daemon, but at least warn.
+ if test "`echo -n "$NIX_STATE_DIR/daemon-socket/socket" | wc -c`" -ge 108
+ then
+ echo "warning: exceeding socket file name limit; test may fail!" >&2
+ fi
+
# The configuration directory, for import/export signing keys.
NIX_CONF_DIR="@GUIX_TEST_ROOT@/etc"
if [ ! -d "$NIX_CONF_DIR" ]