]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Fix broken tests
authorFrançois HORTA <fhorta@scaleway.com>
Tue, 23 Nov 2021 17:25:27 +0000 (18:25 +0100)
committerFrançois HORTA <fhorta@scaleway.com>
Tue, 23 Nov 2021 17:25:27 +0000 (18:25 +0100)
tests/functions
tests/list1

index b5526ce88ef0255e606ed384c97dc6fd8418e4e7..cafb5abf0276529cf32844c9c08e6a2e0c9d454d 100644 (file)
@@ -138,6 +138,8 @@ function run_cached {
         stop_cached
 
         local ADDR
+        [ -z "$RRDCACHED_SOCK" ] && RRDCACHED_SOCK="unix"
+
         if [ $RRDCACHED_SOCK == "unix" ]; then
             export BASEDIR="${BUILDDIR}/cached"
             export BUILDDIR="${BASEDIR}"
@@ -202,7 +204,13 @@ function run_cached {
             export RRDTOOL=RRDTOOLCOMPAT
 
             randport=$(python -S -c "import random; random.seed('$(basename $0)'); print(random.randrange(49152,65535))")
-            ADDR="localhost:$randport"
+            port=$(python -S << HERE
+import socketserver
+with socketserver.TCPServer(("localhost", 0), None) as s:
+  print(s.server_address[1])
+HERE
+)
+            ADDR="localhost:$port"
         fi
 
         CACHED_PID_FILE="$BASEDIR/$(basename $0)-rrdcached.pid"
index 0cb8c9d8f03317bcb9adbcec6173d54a48155ee4..15c2a9dc307910f484b0018b0dff4ad6a1d8514d 100755 (executable)
@@ -83,6 +83,9 @@ if [ -n "$TEMP_RRDCACHED_ADDRESS" ]; then
         export RRDCACHED_ADDRESS=$TEMP_RRDCACHED_ADDRESS
 else
         run_cached
+        BUILDDIR=$BUILDDIR
+        BUILD=$BUILDDIR/`basename $0`
+        LIST_DIR=$BUILDDIR/`basename $0`_dir
 fi
 
 if is_cached; then