3

I am trying to run the functional tests. Everything is a pass but I have some tests skipped. Here are some:

260/288 - feature_unsupported_utxo_db.py skipped (previous releases not available or disabled) - "For this one I don't know what to do, and have about 5 of the same tests skipped"

241/288 - feature_bind_port_discover.py skipped (To run this test make sure that 1.1.1.1 and 2.2.2.2 (routable addresses) are assigned to the interfaces on this machine and rerun with --ihave1111and2222)

223/288 - feature_bind_port_externalip.py skipped (To run this test make sure that 1.1.1.1 (a routable address) is assigned to one of the interfaces on this machine and rerun with --ihave1111) - "For this one and the one above, I tried assigning the machine ip address to 1.1.1.1, tried running the test with --ihave1111 flag, nothing helped

I would like to know why these test are being skipped and how to run them.

Update

I tried the network issue, now the test fails. Here is the output:

sudo test/functional/feature_bind_port_externalip.py --ihave1111

--ihave1111and2222 doesn't work

2023-12-21T15:59:42.460000Z TestFramework (INFO): PRNG seed is: 9034826233842177560 2023-12-21T15:59:42.461000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_ryvl93pg 2023-12-21T16:00:43.190000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: '''' self.wait_until(lambda: sum(peer['version'] != 0 for peer in from_connection.getpeerinfo()) == from_num_peers) ''' 2023-12-21T16:00:43.190000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "/home/jack/bitcoin/test/functional/test_framework/test_framework.py", line 130, in main self.setup() File "/home/jack/bitcoin/test/functional/test_framework/test_framework.py", line 297, in setup self.setup_network() File "/home/jack/bitcoin/test/functional/test_framework/test_framework.py", line 407, in setup_network self.connect_nodes(i + 1, i) File "/home/jack/bitcoin/test/functional/test_framework/test_framework.py", line 620, in connect_nodes self.wait_until(lambda: sum(peer['version'] != 0 for peer in from_connection.getpeerinfo()) == from_num_peers) File "/home/jack/bitcoin/test/functional/test_framework/test_framework.py", line 765, in wait_until return wait_until_helper_internal(test_function, timeout=timeout, timeout_factor=self.options.timeout_factor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jack/bitcoin/test/functional/test_framework/util.py", line 276, in wait_until_helper_internal raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout)) AssertionError: Predicate '''' self.wait_until(lambda: sum(peer['version'] != 0 for peer in from_connection.getpeerinfo()) == from_num_peers) ''' not true after 60 seconds 2023-12-21T16:00:43.247000Z TestFramework (INFO): Stopping nodes 2023-12-21T16:00:43.505000Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_ryvl93pg 2023-12-21T16:00:43.505000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_ryvl93pg/test_framework.log 2023-12-21T16:00:43.506000Z TestFramework (ERROR): 2023-12-21T16:00:43.506000Z TestFramework (ERROR): Hint: Call /home/jack/bitcoin/test/functional/combine_logs.py '/tmp/bitcoin_func_test_ryvl93pg' to consolidate all logs 2023-12-21T16:00:43.506000Z TestFramework (ERROR): 2023-12-21T16:00:43.506000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log. 2023-12-21T16:00:43.506000Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues 2023-12-21T16:00:43.506000Z TestFramework (ERROR):

Maybe it is connected to this line "not true after 60 seconds" is it a timeout error?

Also, the command sudo test/functional/test_runner.py which runs all tests cannot be run with the --ihave1111 flag, spits an error.

note: I am running linux on virtual machine, maybe that is why the test fails

0

1 Answer 1

4

For the tests skipped with "previous releases not available", you need to have older versions of Bitcoin Core in a local directory. This directory has a folder for each version (named v25.0, v24.1, etc.). Within each version's folder is another folder named bin, and within that are the binaries for that version. The layout of that will look like:

|_ v25.0
   |_ bin
      |_ bitcoind
      |_ bitcoin-cli
      |_ bitcoin-tx
      |_ bitcoin-wallet
|_ v24.1
   |_ bin
      |_ bitcoind
      |_ bitcoin-cli
      |_ bitcoin-tx
      |_ bitcoin-wallet
|_ v23.0
   |_ bin
      |_ bitcoind
      |_ bitcoin-cli
      |_ bitcoin-tx
      |_ bitcoin-wallet
...

This directoy must either be named releases in your current working directory, or you can provide the full path to it as the environment variable PREVIOUS_RELEASES_DIR

For the tests that require 1.1.1.1 and/or 2.2.2.2, you need to create another network interface on your machine and set their IP's to 1.1.1.1 and 2.2.2.2. There are instructions for doing this in the tests themselves.

From feature_bind_port_discover.py:

# We need to bind to a routable address for this test to exercise the relevant code
# and also must have another routable address on another interface which must not
# be named "lo" or "lo0".
# To set these routable addresses on the machine, use:
# Linux:
# ifconfig lo:0 1.1.1.1/32 up && ifconfig lo:1 2.2.2.2/32 up  # to set up
# ifconfig lo:0 down && ifconfig lo:1 down  # to remove it, after the test
# FreeBSD:
# ifconfig em0 1.1.1.1/32 alias && ifconfig wlan0 2.2.2.2/32 alias  # to set up
# ifconfig em0 1.1.1.1 -alias && ifconfig wlan0 2.2.2.2 -alias  # to remove it, after the test

Then you can pass the --ihave1111and2222 and --ihave1111 options to the tests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.