]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Skip daemon-conf test if dir exceeds UNIX_PATH_MAX
authorCole Robinson <crobinso@redhat.com>
Mon, 17 May 2010 16:32:45 +0000 (12:32 -0400)
committerCole Robinson <crobinso@redhat.com>
Mon, 17 May 2010 19:01:59 +0000 (15:01 -0400)
The max path length for unix sockets is pretty small (108, see man 7 unix).
If 'make check' is run from a directory that exceeds this, one of the tests
will fail, and in such a way that requires manually editting the test to
determine why.

There are certainly other ways to handle this, but I've chosen just to skip
the offending test if we will exceed the length limitation.

v2: Drop bashism, use test infrastructure to warn and skip

tests/daemon-conf

index 10c16284bffc517f90eba8a6b2101610a61c4d4b..14d4cede68e44869692d93f3879f508e3cd25b88 100755 (executable)
@@ -76,6 +76,13 @@ sed 's,^log_outputs.*,log_outputs="3:file:'"$(pwd)/log"'",' tmp.conf > k \
     || fail=1
 mv k tmp.conf || fail=1
 
+# Unix socket max path size is 108 on linux. If the generated sock path
+# exceeds this, the test will fail, so skip it if CWD is too long
+SOCKPATH=`pwd`/libvirt-sock
+if test 108 -lt `echo $SOCKPATH | wc -c`; then
+    skip_test_ "CWD too long"
+fi
+
 $abs_top_builddir/daemon/libvirtd --pid-file=pid-file --config=tmp.conf > log 2>&1 & pid=$!
 sleep $sleep_secs
 kill $pid