Commit Graph

36 Commits

Author SHA1 Message Date
Matthew Zipkin
bfe5192891
test: cover UNIX sockets in feature_proxy.py 2024-03-01 14:47:29 -05:00
Hennadii Stepanov
306ccd4927
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-

Commits of previous years:
- 2021: f47dda2c58
- 2020: fa0074e2d8
- 2019: aaaaad6ac9
2022-12-24 23:49:50 +00:00
amadeuszpawlik
04526787b5 Validate port options
Check `port` options for invalid values (ports are parsed as uint16, so
in practice values >65535 are invalid; port 0 is undefined and therefore
considered invalid too). This allows for an early rejection of faulty
values and an supplying an informative message to the user.

Splits tests in `feature_proxy.py` to cover both invalid `hostname`
and `port` values.

Adds a release-note as previously valid `-port` and `-rpcport` values
can now result in errors.
2022-10-05 19:30:15 +02:00
Martin Zumsande
a8a9ed67cc init: Abort if i2p/cjdns are chosen via -onlynet but unreachable
...because -i2psam or -cjdnsreachable are not provided.
This mimics existing behavior for -onlynet=onion and non-specified proxy.
2022-09-19 11:06:43 -04:00
Vasil Dimov
2d0b4e4ff6
init: allow startup with -onlynet=onion -listenonion=1
It does not make sense to specify `-onlynet=onion` without providing a
Tor proxy (even if other `-onlynet=...` are given). This is checked
during startup. However, it was forgotten that a Tor proxy can also be
retrieved from "Tor control" to which we connect if `-listenonion=1`.

So, the full Tor proxy retrieval logic is:
1. get it from `-onion`
2. get it from `-proxy`
3. if `-listenonion=1`, then connect to "Tor control" and get the proxy
   from there (was forgotten before this change)

Fixes https://github.com/bitcoin/bitcoin/issues/24980
2022-09-05 17:52:08 +02:00
MacroFake
fa7a711a30
test: Fix out-of-range port collisions 2022-06-10 15:56:07 +02:00
brunoerg
055d94d1ab test: add coverage for unknown network in -onlynet 2022-05-19 18:39:23 -03:00
MarcoFalke
161dd7e864
Merge bitcoin/bitcoin#24687: test: Check an invalid -i2psam will raise an init error
45e67b2695 test: invalid -i2psam will raise an init error (brunoerg)

Pull request description:

  This PR adds test coverage (at `feature_proxy.py`) for the following init error:

  2f0f056e08/src/init.cpp (L1791)

  It starts the node with an invalid -i2psam (`-i2psam=invalidhere`) and test if it raises an error when initializing.

ACKs for top commit:
  dunxen:
    Code review ACK 45e67b2

Tree-SHA512: b24e3f6e7a9316b9ebc0b6c8bcf1315faff60a9e258d7bb3dbeb9f6695a728bb3083aea2f81114072fe13822bfca34d4a0f44f229825f7c97a81619d810010c0
2022-03-28 09:07:22 +02:00
MarcoFalke
88709e9dc5
Merge bitcoin/bitcoin#24258: test: check localaddresses in getnetworkinfo for nodes with proxy
89bb25d22a test: check localaddresses in getnetworkinfo for nodes with proxy (brunoerg)

Pull request description:

  This PR adds test coverage for the field `localaddresses` for `getnetworkinfo`. In this case, it verifies if this field is empty for all nodes since they are using proxy.

  Reference:
  515200298b/src/init.cpp (L449)

ACKs for top commit:
  jonatack:
    ACK 89bb25d22a

Tree-SHA512: 3c765c7060b6972c1ae5a1104734cd7669b650b5f6aa4f623f4299567732260da5083fef306a7c1e71c931f5d1396f24abad251d95c3d82b1f3ee0efee7fcd1f
2022-03-28 09:00:11 +02:00
brunoerg
45e67b2695 test: invalid -i2psam will raise an init error 2022-03-26 21:50:34 -03:00
brunoerg
89bb25d22a test: check localaddresses in getnetworkinfo for nodes with proxy 2022-03-22 16:07:01 -03:00
Jon Atack
58a14795b8
test: passing -onlynet=onion with -onion=0/-noonion raises expected init error 2022-03-03 15:31:44 +01:00
Jon Atack
7000f66d36
test: passing -onlynet=onion without -proxy/-onion raises expected init error 2022-03-03 15:31:37 +01:00
Jon Atack
8332e6e4cf
test: passing invalid -onion raises expected init error 2022-03-03 15:31:30 +01:00
Jon Atack
d5edb08708
test: passing invalid -proxy raises expected init error 2022-03-03 15:31:15 +01:00
Jon Atack
bd57dcbaf2
test: hoist proxy out of 2 network loops in feature_proxy.py 2022-03-01 21:04:58 +01:00
Vasil Dimov
e53a8505db
net: respect -onlynet= when making outbound connections
Do not make outbound connections to hosts which belong to a network
which is restricted by `-onlynet`.

This applies to hosts that are automatically chosen to connect to and to
anchors.

This does not apply to hosts given to `-connect`, `-addnode`,
`addnode` RPC, dns seeds, `-seednodes`.

Fixes https://github.com/bitcoin/bitcoin/issues/13378
Fixes https://github.com/bitcoin/bitcoin/issues/22647
Supersedes https://github.com/bitcoin/bitcoin/pull/22651
2021-11-24 12:44:05 +01:00
MarcoFalke
fac23c2114
scripted-diff: Bump copyright headers
The previous diff touched most files in ./test/, so bump the headers to
avoid having to touch them again for a bump later.

-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./test/
-END VERIFY SCRIPT-
2021-11-10 11:10:24 +01:00
Vasil Dimov
9b43b3b257
test: extend feature_proxy.py to test CJDNS 2021-11-03 14:58:51 +01:00
Vasil Dimov
508eb258fd
test: remove default argument of feature_proxy.py:node_test()
The default bool argument makes it harder to read because the last but
one argument is also bool. Pass all of them as named arguments to
increase readability.

Another bool argument will be added to indicate whether to test CJDNS.

Co-authored-by: Jon Atack <jon@atack.com>
2021-11-03 14:58:50 +01:00
Vasil Dimov
e6890fcb44
net: don't skip CJDNS from GetNetworksInfo() 2021-11-03 14:58:49 +01:00
fanquake
86d958262d
test: use f-strings in feature_proxy.py 2021-08-18 12:39:20 +08:00
Jon Atack
0f1c58ae87
test: update feature_proxy to torv3 2021-05-27 19:47:52 +02:00
Vasil Dimov
76c35c60f3
init: introduce I2P connectivity options
Introduce two new options to reach the I2P network:

* `-i2psam=<ip:port>` point to the I2P SAM proxy. If this is set then
  the I2P network is considered reachable and we can make outgoing
  connections to I2P peers via that proxy. We listen for and accept
  incoming connections from I2P peers if the below is set in addition to
  `-i2psam=<ip:port>`

* `-i2pacceptincoming` if this is set together with `-i2psam=<ip:port>`
  then we accept incoming I2P connections via the I2P SAM proxy.
2021-03-01 18:19:46 +01:00
Jon Atack
b45eae4d53
net: update NET_UNROUTABLE to not_publicly_routable in GetNetworkName() 2021-02-02 00:00:39 +01:00
MarcoFalke
fa0074e2d8
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2020-12-31 09:45:41 +01:00
Jon Atack
7b5bd3102e
test: add getnetworkinfo network name regression tests 2020-10-15 19:21:43 +02:00
Jon Atack
4938a109ad
rpc, test: expose CNodeStats network in RPC getpeerinfo 2020-10-14 14:56:03 +02: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
MarcoFalke
fa0e65b772
scripted-diff: test: Remove brackets after assert
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test)
-END VERIFY SCRIPT-
2019-03-02 10:51:35 -05:00
MarcoFalke
fa25210d62
qa: Fix wallet_txn_doublespend issue 2019-02-19 14:22:15 -05:00
MarcoFalke
1111aecbb5
qa: Always refresh stale cache to be out of ibd 2019-02-19 14:22:13 -05:00
DrahtBot
eb7daf4d60 Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
John Bampton
0d31ef4762 Enable W191 and W291 flake8 checks.
Remove trailing whitespace from Python files.
Convert tabs to spaces.
2018-05-11 07:59:05 +10:00
practicalswift
f020aca297 Minor Python cleanups to make flake8 pass with the new rules enabled 2018-04-16 17:25:11 +02:00
Anthony Towns
ca6523d0c8 [tests] Rename feature_* functional tests. 2018-01-25 09:44:29 +10:00