Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#31343: test: avoid internet traffic in rpc_net.py
Browse files Browse the repository at this point in the history
988721d test: avoid internet traffic in rpc_net.py (Sebastian Falbesoner)

Pull request description:

  In order to avoid connecting to the internet in the functional test `rpc_net.py`, specify a non-working proxy (parameter `-proxy=127.0.0.1:1`, same approach as in #31142) for the nodes.  There is at least one known instance where this is currently happening on master where a connection attempt to a public IP is made (see also the discussion in #31339):

  https://github.com/bitcoin/bitcoin/blob/17834bd1976df7a2ff6c2f5f05a59ae3fd3f6875/test/functional/rpc_net.py#L253

  Can be tested by running
  ```
  $ sudo tcpdump -i eth0 host 11.22.33.44
  ```
  both on master and the PR branch and verifying that no packets appear in the tcpdump in the latter anymore.

ACKs for top commit:
  achow101:
    ACK 988721d
  tdb3:
    ACK 988721d
  vasild:
    ACK 988721d

Tree-SHA512: 0f51fedccbfac0f80a7e6f9c5ba9193d0c20b5a788553c7cd7e583225df7b1151b86cd848d6ccf61f7b2de848f0ac98d73d7b5db100aa54fe8cbeeb4c0549106
  • Loading branch information
achow101 committed Dec 11, 2024
2 parents a582ee6 + 988721d commit 8ad2c90
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/functional/rpc_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class NetTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.extra_args = [["-minrelaytxfee=0.00001000"], ["-minrelaytxfee=0.00000500"]]
# Specify a non-working proxy to make sure no actual connections to public IPs are attempted
for args in self.extra_args:
args.append("-proxy=127.0.0.1:1")
self.supports_cli = False

def run_test(self):
Expand Down

0 comments on commit 8ad2c90

Please sign in to comment.