The following code
#!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
class NolistenTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.extra_args = [["-listen=0"]] # Comment out to pass.
def setup_network(self):
self.setup_nodes()
def run_test(self):
self.log.info("Starting test!")
if __name__ == '__main__':
NolistenTest().main()
returns
$ test/functional/feature_nolisten.py
2020-10-17T17:52:20.992000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_qiov8cs8
2020-10-17T17:52:21.252000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 498, in start_nodes
node.wait_for_rpc_connection()
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_node.py", line 220, in wait_for_rpc_connection
raise FailedToStartError(self._node_msg(
test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 125, in main
self.setup()
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 257, in setup
self.setup_network()
File "test/functional/feature_nolisten.py", line 15, in setup_network
self.setup_nodes()
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 376, in setup_nodes
self.start_nodes()
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 501, in start_nodes
self.stop_nodes()
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 517, in stop_nodes
node.stop_node(wait=wait)
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_node.py", line 319, in stop_node
self.stop(wait=wait)
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_node.py", line 179, in __getattr__
assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
AssertionError: [node 0] Error: no RPC connection
2020-10-17T17:52:21.303000Z TestFramework (INFO): Stopping nodes
Traceback (most recent call last):
File "test/functional/feature_nolisten.py", line 22, in <module>
NolistenTest().main()
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 149, in main
exit_code = self.shutdown()
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 273, in shutdown
self.stop_nodes()
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_framework.py", line 517, in stop_nodes
node.stop_node(wait=wait)
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_node.py", line 319, in stop_node
self.stop(wait=wait)
File "/home/hebasto/guix/GitHub/bitcoin/test/functional/test_framework/test_node.py", line 179, in __getattr__
assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
AssertionError: [node 0] Error: no RPC connection
[node 0] Cleaning up leftover process