diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-06-05 13:57:13 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-06-05 13:57:13 +0200 |
commit | 3457331386f2e38fda69cd3cff93a2e13984df57 (patch) | |
tree | f1d7d24714718b98509604f70726b56650eea243 /test/functional/net.py | |
parent | a7e3c2814c8e49197889a4679461be42254e5c51 (diff) | |
download | bitcoin-3457331386f2e38fda69cd3cff93a2e13984df57.tar.xz |
test: Add test for `getpeerinfo` `bindaddr` field
Diffstat (limited to 'test/functional/net.py')
-rwxr-xr-x | test/functional/net.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/net.py b/test/functional/net.py index fb46064441..3ba3764cf9 100755 --- a/test/functional/net.py +++ b/test/functional/net.py @@ -29,6 +29,7 @@ class NetTest(BitcoinTestFramework): self._test_getnettotals() self._test_getnetworkinginfo() self._test_getaddednodeinfo() + self._test_getpeerinfo() def _test_connection_count(self): # connect_nodes_bi connects each node to the other @@ -88,6 +89,12 @@ class NetTest(BitcoinTestFramework): assert_raises_jsonrpc(-24, "Node has not been added", self.nodes[0].getaddednodeinfo, '1.1.1.1') + def _test_getpeerinfo(self): + peer_info = [x.getpeerinfo() for x in self.nodes] + # check both sides of bidirectional connection between nodes + # the address bound to on one side will be the source address for the other node + assert_equal(peer_info[0][0]['addrbind'], peer_info[1][0]['addr']) + assert_equal(peer_info[1][0]['addrbind'], peer_info[0][0]['addr']) if __name__ == '__main__': NetTest().main() |