aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-03-22 10:29:39 -0400
committerJohn Newbery <john@johnnewbery.com>2017-03-24 00:05:30 -0400
commit0c1ade6a4b3921da6f8f2b17c8fc23e15edef426 (patch)
treec6fd19903a96b6488b3c58289de64f65a0a0b4f4
parent232b6665bc3e5b134821dc7584968fb439fd5f44 (diff)
downloadbitcoin-0c1ade6a4b3921da6f8f2b17c8fc23e15edef426.tar.xz
Skip rpcbind_test if OS/network requirements are not met.
-rwxr-xr-xtest/functional/rpcbind_test.py18
-rwxr-xr-xtest/functional/test_runner.py2
2 files changed, 17 insertions, 3 deletions
diff --git a/test/functional/rpcbind_test.py b/test/functional/rpcbind_test.py
index 8720a345ce..efc36481d1 100755
--- a/test/functional/rpcbind_test.py
+++ b/test/functional/rpcbind_test.py
@@ -4,6 +4,9 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test running bitcoind with the -rpcbind and -rpcallowip options."""
+import socket
+import sys
+
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.netutil import *
@@ -52,7 +55,9 @@ class RPCBindTest(BitcoinTestFramework):
def run_test(self):
# due to OS-specific network stats queries, this test works only on Linux
- assert(sys.platform.startswith('linux'))
+ if not sys.platform.startswith('linux'):
+ self.log.warning("This test can only be run on linux. Skipping test.")
+ sys.exit(self.TEST_EXIT_SKIPPED)
# find the first non-loopback interface for testing
non_loopback_ip = None
for name,ip in all_interfaces():
@@ -60,7 +65,16 @@ class RPCBindTest(BitcoinTestFramework):
non_loopback_ip = ip
break
if non_loopback_ip is None:
- assert(not 'This test requires at least one non-loopback IPv4 interface')
+ self.log.warning("This test requires at least one non-loopback IPv4 interface. Skipping test.")
+ sys.exit(self.TEST_EXIT_SKIPPED)
+ try:
+ s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
+ s.connect(("::1",1))
+ s.close
+ except OSError:
+ self.log.warning("This test requires IPv6 support. Skipping test.")
+ sys.exit(self.TEST_EXIT_SKIPPED)
+
self.log.info("Using interface %s for testing" % non_loopback_ip)
defaultport = rpc_port(0)
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index 41885e5243..5bd71fe328 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -248,7 +248,7 @@ def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=Fal
job_queue = TestHandler(jobs, tests_dir, test_list, flags)
max_len_name = len(max(test_list, key=len))
- results = BOLD[1] + "%s | %s | %s\n\n" % ("TEST".ljust(max_len_name), "PASSED ", "DURATION") + BOLD[0]
+ results = BOLD[1] + "%s | %s | %s\n\n" % ("TEST".ljust(max_len_name), "STATUS ", "DURATION") + BOLD[0]
for _ in range(len(test_list)):
(name, stdout, stderr, status, duration) = job_queue.get_next()
all_passed = all_passed and status != "Failed"