Commit Graph

24 Commits

Author SHA1 Message Date
MarcoFalke
fa5f297748 scripted-diff: [doc] Unify stale copyright headers
-BEGIN VERIFY SCRIPT-

 sed --in-place --regexp-extended \
   's;( 20[0-2][0-9])(-20[0-2][0-9])? The Bitcoin Core developers;\1-present The Bitcoin Core developers;g' \
   $( git grep -l 'The Bitcoin Core developers' -- ':(exclude)COPYING' ':(exclude)src/ipc/libmultiprocess' ':(exclude)src/minisketch' )

-END VERIFY SCRIPT-
2025-12-16 22:21:15 +01:00
merge-script
f4903dddc9 Merge bitcoin/bitcoin#33433: Bugfix: QA: rpc_bind: Skip nonloopback test if no such address is found
79b4c276e7 Bugfix: QA: rpc_bind: Skip nonloopback test if no such address is found (Luke Dashjr)

Pull request description:

  Without this, I get:

  ```
  2025-09-19T03:14:05.157000Z TestFramework (INFO): PRNG seed is: 3218602557639511064
  2025-09-19T03:14:05.158000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin-test/a
  2025-09-19T03:14:05.158000Z TestFramework (INFO): Check for ipv6
  2025-09-19T03:14:05.158000Z TestFramework (INFO): Check for non-loopback interface
  2025-09-19T03:14:05.158000Z TestFramework (INFO): Bind test for []
  2025-09-19T03:14:05.516000Z TestFramework (INFO): Bind test for []
  2025-09-19T03:14:05.871000Z TestFramework (INFO): Bind test for ['[::1]']
  2025-09-19T03:14:06.227000Z TestFramework (INFO): Bind test for ['127.0.0.1', '[::1]']
  2025-09-19T03:14:06.583000Z TestFramework (INFO): Using interface None for testing
  2025-09-19T03:14:06.583000Z TestFramework (INFO): Bind test for [None]
  2025-09-19T03:14:06.583000Z TestFramework (ERROR): Unexpected exception
  Traceback (most recent call last):
    File "/Bitcoin/bitcoin/workingtree/test/functional/test_framework/test_framework.py", line 135, in main
      self.run_test()
      ~~~~~~~~~~~~~^^
    File "/Bitcoin/bitcoin/workingtree/test/functional/rpc_bind.py", line 126, in run_test
      self._run_nonloopback_tests()
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
    File "/Bitcoin/bitcoin/workingtree/test/functional/rpc_bind.py", line 157, in _run_nonloopback_tests
      self.run_bind_test([self.non_loopback_ip], self.non_loopback_ip, [self.non_loopback_ip],
      ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          [(self.non_loopback_ip, self.defaultport)])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Bitcoin/bitcoin/workingtree/test/functional/rpc_bind.py", line 38, in run_bind_test
      expected = [(addr_to_hex(addr), port) for (addr, port) in expected]
                   ~~~~~~~~~~~^^^^^^
    File "/Bitcoin/bitcoin/workingtree/test/functional/test_framework/netutil.py", line 132, in addr_to_hex
      if '.' in addr: # IPv4
         ^^^^^^^^^^^
  TypeError: argument of type 'NoneType' is not iterable
  ```

ACKs for top commit:
  maflcko:
    review ACK 79b4c276e7 🏑
  theStack:
    Tested ACK 79b4c276e7

Tree-SHA512: 2a723d9bc5d1d50a8321a4f8a8cac3da3125d373ea71e6cc9d03de07307008f58970e361490d4c34530a6a976cb078b62d0ef09b7fb321ca1cfb9249a70d99a5
2025-11-10 14:52:19 +00:00
Luke Dashjr
79b4c276e7 Bugfix: QA: rpc_bind: Skip nonloopback test if no such address is found 2025-09-19 03:12:05 +00:00
Matthew Zipkin
12ff4be9c7 test: ensure -rpcallowip is compatible with RFC4193 2025-05-16 15:25:30 -04:00
tdb3
d38e3aed89 fix: handle invalid rpcbind port earlier
Previously, when an invalid port was specified
in `-rpcbind`, the `SplitHostPort()` return value
in `HTTPBindAddresses()` was ignored and attempt
would be made to bind to the default rpcbind port
(with the host/port treated as a host).

This rearranges port checking code in
`AppInitMain()` to handle the invalid
port before reaching `HTTPBindAddresses()`.

Also adjusts associated functional tests.
2024-09-17 21:47:29 -04:00
tdb3
73c243965a test: add tests for invalid rpcbind ports 2024-09-17 20:03:00 -04:00
Hennadii Stepanov
a0473442d1 scripted-diff: Add __file__ argument to BitcoinTestFramework.init()
-BEGIN VERIFY SCRIPT-
sed -i -e 's/\s*().main\s*()/(__file__).main()/' $(git ls-files test/functional/*.py)
sed -i -e 's/def __init__(self)/def __init__(self, test_file)/' test/functional/test_framework/test_framework.py
-END VERIFY SCRIPT-
2024-07-16 22:06:47 +01:00
Sebastian Falbesoner
37324ae3df test: use skip_if_platform_not_linux helper where possible
Rather than re-implementing these checks, we can use this test
framework's helper (introduced in commit
c934087b62, PR #24358) called in a test's
`skip_test_if_missing_module` method instead.
2023-12-08 18:15:34 +01:00
ns-xvrn
bfa0bd632a test: Use pathlib over os.path #28362
revert netutil chgs py3.8 compliant

fixes based on PR review
2023-10-10 09:26:56 -04:00
practicalswift
993e38a4e2 tests: Mark functional tests not supporting bitcoin-cli (--usecli) as such 2019-12-06 14:40:28 +00:00
MarcoFalke
fa8a1d7ba3 test: Adapt test framework for chains other than "regtest"
Co-Authored-By: Jorge Timón <jtimon@jtimon.cc>
2019-07-31 17:00:25 -04:00
MarcoFalke
faa7cdf764 scripted-diff: Update copyright in ./test
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./test/
-END VERIFY SCRIPT-
2019-03-02 10:58:35 -05:00
Wladimir J. van der Laan
c3bb936a0f Merge #14790: Tests: Allow running rpc_bind.py --nonloopback test without IPv6
c9066f07c9 Allow running rpc_bind.py --nonloopback test without IPv6 (Kristaps Kaupe)

Pull request description:

  Don't see a reason why this can't be tested with IPv4 only.

Tree-SHA512: 515bdf700fad420e4b1798fd4978b53e2da3ddb26e43b16d68b43071bc912c325f1ceb10046ba3d0494dab289a53c45ddc2de9064117d8c1d6bf11e88323f490
2019-01-02 14:16:12 +01:00
Carl Dong
f3cf95ffdf tests: Modify rpc_bind to conform to #14532 behaviour.
- Even when rpcallowip is specified, only bind localhost
- Explicitly bind in run_allowip_test
2018-12-03 10:30:50 -08:00
Kristaps Kaupe
c9066f07c9 Allow running rpc_bind.py --nonloopback test without IPv6 2018-11-22 23:57:07 +02:00
practicalswift
68400d8b96 tests: Use explicit imports 2018-08-13 14:13:39 +02:00
Kvaciral
5654efb187 Ported usage of deprecated optparse module to argparse module 2018-08-12 00:23:53 +02:00
DrahtBot
eb7daf4d60 Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
Wladimir J. van der Laan
e87fefc60f test: Add rpc_bind test to default-run tests
Skip the parts that cannot be run on the host due to lack
of IPv6 support or a second interface to bind on, and warn
appropriately.

Without no strong requirements (besides being Linux only, in which case
the test is skipped) left, just add this test to the default in
test_runner.

Includes suggested changes by John Newbery.
2018-04-13 14:40:05 +02:00
Wladimir J. van der Laan
6d36f599f8 Merge #12076: qa: Use node.datadir instead of tmpdir in test framework
c8330d4 qa: Use node.datadir instead of tmpdir in test framework (MarcoFalke)

Pull request description:

  Commit c53c9831ee introduced the utility function `get_datadir_path`, however not all places in the code use this util function. Using the util function everywhere makes it easier to review pull requests related to the datadir.

  This commit replaces datadir path creation with the `datadir` member of `TestNode`, which itself uses `get_datadir_path`.

Tree-SHA512: c75707ab7149d732a6d56152a5813138a33459d3d07577b60b89f2a207c83b7663fac5f203593677c9892d1c23a5eba4bd45c5c4ababf040d720b437240fcddf
2018-03-22 11:10:56 +01:00
Dimitris Apostolou
4d9b4256d8 Fix typos 2018-03-21 08:34:44 +02:00
MarcoFalke
c8330d4216 qa: Use node.datadir instead of tmpdir in test framework 2018-03-19 12:26:00 -04:00
Sjors Provoost
b156ff7c30 [tests] bind functional test nodes to 127.0.0.1
Prevents OSX firewall allow-this-application-to-accept-inbound-connections
permission popups and is generally safer.

To prevent binding to 127.0.0.1, set self.bind_to_localhost_only = False.
2018-03-06 16:48:15 -05:00
Anthony Towns
81b79f2c39 [tests] Rename rpc_* functional tests. 2018-01-25 09:44:29 +10:00