[tor-commits] [tor/master] test: Skip test scripts that require the relay module

nickm at torproject.org nickm at torproject.org
Mon Oct 21 16:43:35 UTC 2019


commit 012c44538ce15a3e45d6cdea0935062bdcaf5bf4
Author: teor <teor at torproject.org>
Date:   Fri Oct 18 18:00:00 2019 +1000

    test: Skip test scripts that require the relay module
    
    When tor is built without the relay module.
    
    Part of 32123.
---
 src/test/test_key_expiration.sh   | 5 +++++
 src/test/test_keygen.sh           | 5 ++++-
 src/test/test_zero_length_keys.sh | 5 +++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/test/test_key_expiration.sh b/src/test/test_key_expiration.sh
index 54abb4a2f..9d42c1cc4 100755
--- a/src/test/test_key_expiration.sh
+++ b/src/test/test_key_expiration.sh
@@ -28,6 +28,11 @@ else
   TOR_BINARY="${TESTING_TOR_BINARY}"
 fi
 
+if "$TOR_BINARY" --list-modules | grep -q "relay: no"; then
+  echo "This test requires the relay module. Skipping." >&2
+  exit 77
+fi
+
 if [ $# -ge 1 ]; then
   dflt=0
 else
diff --git a/src/test/test_keygen.sh b/src/test/test_keygen.sh
index cbdfd1909..57df88827 100755
--- a/src/test/test_keygen.sh
+++ b/src/test/test_keygen.sh
@@ -28,7 +28,10 @@ else
   TOR_BINARY="${TESTING_TOR_BINARY}"
 fi
 
-
+if "$TOR_BINARY" --list-modules | grep -q "relay: no"; then
+  echo "This test requires the relay module. Skipping." >&2
+  exit 77
+fi
 
   if [ $# -ge 1 ]; then
       dflt=0
diff --git a/src/test/test_zero_length_keys.sh b/src/test/test_zero_length_keys.sh
index 84ca513b0..eeabab352 100755
--- a/src/test/test_zero_length_keys.sh
+++ b/src/test/test_zero_length_keys.sh
@@ -1,6 +1,11 @@
 #!/bin/sh
 # Check that tor regenerates keys when key files are zero-length
 
+if "${builddir:-.}/src/app/tor" --list-modules | grep -q "relay: no"; then
+  echo "This test requires the relay module. Skipping." >&2
+  exit 77
+fi
+
 exitcode=0
 
 "${SHELL:-sh}" "${abs_top_srcdir:-.}/src/test/zero_length_keys.sh" "${builddir:-.}/src/app/tor" -z || exitcode=1





More information about the tor-commits mailing list