dash-docs/en/doxygen/html/proxy__test_8py_source.html

132 lines
57 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Dash Core: qa/rpc-tests/proxy_test.py Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="bitcoin_logo_doxygen.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Dash Core
&#160;<span id="projectnumber">0.12.2.1</span>
</div>
<div id="projectbrief">P2P Digital Currency</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('proxy__test_8py_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">proxy_test.py</div> </div>
</div><!--header-->
<div class="contents">
<a href="proxy__test_8py.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"><a class="line" href="namespaceproxy__test.html"> 1</a></span>&#160;<span class="comment">#!/usr/bin/env python2</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"># Copyright (c) 2015 The Bitcoin Core developers</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"># Distributed under the MIT software license, see the accompanying</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"># file COPYING or http://www.opensource.org/licenses/mit-license.php.</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="keyword">import</span> socket</div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;</div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="keyword">from</span> <a class="code" href="namespacetest__framework_1_1socks5.html">test_framework.socks5</a> <span class="keyword">import</span> Socks5Configuration, Socks5Command, Socks5Server, AddressType</div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="keyword">from</span> <a class="code" href="namespacetest__framework_1_1test__framework.html">test_framework.test_framework</a> <span class="keyword">import</span> BitcoinTestFramework</div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="keyword">from</span> <a class="code" href="namespacetest__framework_1_1util.html">test_framework.util</a> <span class="keyword">import</span> *</div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="keyword">from</span> <a class="code" href="namespacetest__framework_1_1netutil.html">test_framework.netutil</a> <span class="keyword">import</span> test_ipv6_local</div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="stringliteral">&#39;&#39;&#39;</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="stringliteral">Test plan:</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="stringliteral">- Start bitcoind&#39;s with different proxy configurations</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="stringliteral">- Use addnode to initiate connections</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="stringliteral">- Verify that proxies are connected to, and the right connection command is given</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="stringliteral">- Proxy configurations to test on bitcoind side:</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="stringliteral"> - `-proxy` (proxy everything)</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="stringliteral"> - `-onion` (proxy just onions)</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="stringliteral"> - `-proxyrandomize` Circuit randomization</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="stringliteral">- Proxy configurations to test on proxy side,</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="stringliteral"> - support no authentication (other proxy)</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="stringliteral"> - support no authentication + user/pass authentication (Tor)</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="stringliteral"> - proxy on IPv6</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="stringliteral"></span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="stringliteral">- Create various proxies (as threads)</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="stringliteral">- Create bitcoinds that connect to them</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="stringliteral">- Manipulate the bitcoinds using addnode (onetry) an observe effects</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="stringliteral"></span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="stringliteral">addnode connect to IPv4</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="stringliteral">addnode connect to IPv6</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="stringliteral">addnode connect to onion</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="stringliteral">addnode connect to generic DNS name</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="stringliteral">&#39;&#39;&#39;</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html"> 36</a></span>&#160;<span class="keyword">class </span><a class="code" href="classproxy__test_1_1ProxyTest.html">ProxyTest</a>(<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html">BitcoinTestFramework</a>):</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html#a9df05c69a01dd153ac25523de1035f7a"> 37</a></span>&#160; <span class="keyword">def </span><a class="code" href="classproxy__test_1_1ProxyTest.html#a9df05c69a01dd153ac25523de1035f7a">__init__</a>(self):</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html#a257cb169b8602142c040b2d11ba0e8e2"> 38</a></span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a257cb169b8602142c040b2d11ba0e8e2">have_ipv6</a> = <a class="code" href="namespacetest__framework_1_1netutil.html#a424bed103bfdd9990d154cd5e8776445">test_ipv6_local</a>()</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="comment"># Create two proxies on different ports</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="comment"># ... one unauthenticated</span></div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html#a5a8e353ea4cf4c66539d35b67123e90c"> 41</a></span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a5a8e353ea4cf4c66539d35b67123e90c">conf1</a> = <a class="code" href="classtest__framework_1_1socks5_1_1Socks5Configuration.html">Socks5Configuration</a>()</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a5a8e353ea4cf4c66539d35b67123e90c">conf1</a>.addr = (<span class="stringliteral">&#39;127.0.0.1&#39;</span>, 13000 + (os.getpid() % 1000))</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a5a8e353ea4cf4c66539d35b67123e90c">conf1</a>.unauth = <span class="keyword">True</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a5a8e353ea4cf4c66539d35b67123e90c">conf1</a>.auth = <span class="keyword">False</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="comment"># ... one supporting authenticated and unauthenticated (Tor)</span></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html#ab71eee430a9bcdab2722c30221ed255e"> 46</a></span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ab71eee430a9bcdab2722c30221ed255e">conf2</a> = <a class="code" href="classtest__framework_1_1socks5_1_1Socks5Configuration.html">Socks5Configuration</a>()</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ab71eee430a9bcdab2722c30221ed255e">conf2</a>.addr = (<span class="stringliteral">&#39;127.0.0.1&#39;</span>, 14000 + (os.getpid() % 1000))</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ab71eee430a9bcdab2722c30221ed255e">conf2</a>.unauth = <span class="keyword">True</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ab71eee430a9bcdab2722c30221ed255e">conf2</a>.auth = <span class="keyword">True</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="keywordflow">if</span> self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a257cb169b8602142c040b2d11ba0e8e2">have_ipv6</a>:</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="comment"># ... one on IPv6 with similar configuration</span></div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html#a424d17c5a035b2d055fd8c90a10ce57e"> 52</a></span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a424d17c5a035b2d055fd8c90a10ce57e">conf3</a> = <a class="code" href="classtest__framework_1_1socks5_1_1Socks5Configuration.html">Socks5Configuration</a>()</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a424d17c5a035b2d055fd8c90a10ce57e">conf3</a>.af = socket.AF_INET6</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a424d17c5a035b2d055fd8c90a10ce57e">conf3</a>.addr = (<span class="stringliteral">&#39;::1&#39;</span>, 15000 + (os.getpid() % 1000))</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a424d17c5a035b2d055fd8c90a10ce57e">conf3</a>.unauth = <span class="keyword">True</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a424d17c5a035b2d055fd8c90a10ce57e">conf3</a>.auth = <span class="keyword">True</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keywordflow">else</span>:</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keywordflow">print</span> <span class="stringliteral">&quot;Warning: testing without local IPv6 support&quot;</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html#a3e483d77e6a1e6177eb8a1c4c11016da"> 60</a></span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a3e483d77e6a1e6177eb8a1c4c11016da">serv1</a> = <a class="code" href="classtest__framework_1_1socks5_1_1Socks5Server.html">Socks5Server</a>(self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a5a8e353ea4cf4c66539d35b67123e90c">conf1</a>)</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a3e483d77e6a1e6177eb8a1c4c11016da">serv1</a>.start()</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html#ad5af9d8d429251c9e346c3fceae357d7"> 62</a></span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ad5af9d8d429251c9e346c3fceae357d7">serv2</a> = <a class="code" href="classtest__framework_1_1socks5_1_1Socks5Server.html">Socks5Server</a>(self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ab71eee430a9bcdab2722c30221ed255e">conf2</a>)</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ad5af9d8d429251c9e346c3fceae357d7">serv2</a>.start()</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">if</span> self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a257cb169b8602142c040b2d11ba0e8e2">have_ipv6</a>:</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html#a2c58b9ef1f4024c682ae26791ab8302d"> 65</a></span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a2c58b9ef1f4024c682ae26791ab8302d">serv3</a> = <a class="code" href="classtest__framework_1_1socks5_1_1Socks5Server.html">Socks5Server</a>(self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a424d17c5a035b2d055fd8c90a10ce57e">conf3</a>)</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a2c58b9ef1f4024c682ae26791ab8302d">serv3</a>.start()</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html#afbdbd60e7aef567aa777098b00155aef"> 68</a></span>&#160; <span class="keyword">def </span><a class="code" href="classproxy__test_1_1ProxyTest.html#afbdbd60e7aef567aa777098b00155aef">setup_nodes</a>(self):</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="comment"># Note: proxies are not used to connect to local nodes</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="comment"># this is because the proxy to use is based on CService.GetNetwork(), which return NET_UNROUTABLE for localhost</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; args = [</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; [<span class="stringliteral">&#39;-listen&#39;</span>, <span class="stringliteral">&#39;-debug=net&#39;</span>, <span class="stringliteral">&#39;-debug=proxy&#39;</span>, <span class="stringliteral">&#39;-proxy=%s:%i&#39;</span> % (self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a5a8e353ea4cf4c66539d35b67123e90c">conf1</a>.addr),<span class="stringliteral">&#39;-proxyrandomize=1&#39;</span>], </div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; [<span class="stringliteral">&#39;-listen&#39;</span>, <span class="stringliteral">&#39;-debug=net&#39;</span>, <span class="stringliteral">&#39;-debug=proxy&#39;</span>, <span class="stringliteral">&#39;-proxy=%s:%i&#39;</span> % (self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a5a8e353ea4cf4c66539d35b67123e90c">conf1</a>.addr),<span class="stringliteral">&#39;-onion=%s:%i&#39;</span> % (self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ab71eee430a9bcdab2722c30221ed255e">conf2</a>.addr),<span class="stringliteral">&#39;-proxyrandomize=0&#39;</span>], </div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; [<span class="stringliteral">&#39;-listen&#39;</span>, <span class="stringliteral">&#39;-debug=net&#39;</span>, <span class="stringliteral">&#39;-debug=proxy&#39;</span>, <span class="stringliteral">&#39;-proxy=%s:%i&#39;</span> % (self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ab71eee430a9bcdab2722c30221ed255e">conf2</a>.addr),<span class="stringliteral">&#39;-proxyrandomize=1&#39;</span>], </div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; []</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; ]</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">if</span> self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a257cb169b8602142c040b2d11ba0e8e2">have_ipv6</a>:</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; args[3] = [<span class="stringliteral">&#39;-listen&#39;</span>, <span class="stringliteral">&#39;-debug=net&#39;</span>, <span class="stringliteral">&#39;-debug=proxy&#39;</span>, <span class="stringliteral">&#39;-proxy=[%s]:%i&#39;</span> % (self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a424d17c5a035b2d055fd8c90a10ce57e">conf3</a>.addr),<span class="stringliteral">&#39;-proxyrandomize=0&#39;</span>, <span class="stringliteral">&#39;-noonion&#39;</span>]</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">return</span> <a class="code" href="namespacetest__framework_1_1util.html#aa6b84bae918a356af030860efab10362">start_nodes</a>(4, self.options.tmpdir, extra_args=args)</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html#ae4703fae8e71378638c99f4d7a171ec7"> 81</a></span>&#160; <span class="keyword">def </span><a class="code" href="classproxy__test_1_1ProxyTest.html#ae4703fae8e71378638c99f4d7a171ec7">node_test</a>(self, node, proxies, auth, test_onion=True):</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; rv = []</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="comment"># Test: outgoing IPv4 connection through node</span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; node.addnode(<span class="stringliteral">&quot;15.61.23.23:1234&quot;</span>, <span class="stringliteral">&quot;onetry&quot;</span>)</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; cmd = proxies[0].queue.get()</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; assert(isinstance(cmd, Socks5Command))</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="comment"># Note: bitcoind&#39;s SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.atyp, AddressType.DOMAINNAME)</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.addr, b<span class="stringliteral">&quot;15.61.23.23&quot;</span>)</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.port, 1234)</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">if</span> <span class="keywordflow">not</span> auth:</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.username, <span class="keywordtype">None</span>)</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.password, <span class="keywordtype">None</span>)</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; rv.append(cmd)</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">if</span> self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a257cb169b8602142c040b2d11ba0e8e2">have_ipv6</a>:</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="comment"># Test: outgoing IPv6 connection through node</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; node.addnode(<span class="stringliteral">&quot;[1233:3432:2434:2343:3234:2345:6546:4534]:5443&quot;</span>, <span class="stringliteral">&quot;onetry&quot;</span>)</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; cmd = proxies[1].queue.get()</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; assert(isinstance(cmd, Socks5Command))</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="comment"># Note: bitcoind&#39;s SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.atyp, AddressType.DOMAINNAME)</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.addr, b<span class="stringliteral">&quot;1233:3432:2434:2343:3234:2345:6546:4534&quot;</span>)</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.port, 5443)</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="keywordflow">if</span> <span class="keywordflow">not</span> auth:</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.username, <span class="keywordtype">None</span>)</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.password, <span class="keywordtype">None</span>)</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; rv.append(cmd)</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keywordflow">if</span> test_onion:</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="comment"># Test: outgoing onion connection through node</span></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; node.addnode(<span class="stringliteral">&quot;bitcoinostk4e4re.onion:8333&quot;</span>, <span class="stringliteral">&quot;onetry&quot;</span>)</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; cmd = proxies[2].queue.get()</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; assert(isinstance(cmd, Socks5Command))</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.atyp, AddressType.DOMAINNAME)</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.addr, b<span class="stringliteral">&quot;bitcoinostk4e4re.onion&quot;</span>)</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.port, 8333)</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keywordflow">if</span> <span class="keywordflow">not</span> auth:</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.username, <span class="keywordtype">None</span>)</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.password, <span class="keywordtype">None</span>)</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; rv.append(cmd)</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="comment"># Test: outgoing DNS name connection through node</span></div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; node.addnode(<span class="stringliteral">&quot;node.noumenon:8333&quot;</span>, <span class="stringliteral">&quot;onetry&quot;</span>)</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; cmd = proxies[3].queue.get()</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; assert(isinstance(cmd, Socks5Command))</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.atyp, AddressType.DOMAINNAME)</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.addr, b<span class="stringliteral">&quot;node.noumenon&quot;</span>)</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.port, 8333)</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordflow">if</span> <span class="keywordflow">not</span> auth:</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.username, <span class="keywordtype">None</span>)</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(cmd.password, <span class="keywordtype">None</span>)</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; rv.append(cmd)</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">return</span> rv</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="classproxy__test_1_1ProxyTest.html#a12a7e26615207c7b76c6d80bc9c71f03"> 137</a></span>&#160; <span class="keyword">def </span><a class="code" href="classproxy__test_1_1ProxyTest.html#a12a7e26615207c7b76c6d80bc9c71f03">run_test</a>(self):</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="comment"># basic -proxy</span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ae4703fae8e71378638c99f4d7a171ec7">node_test</a>(self.<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a1c8a2aab0f11f2370c48060835f23f76">nodes</a>[0], [self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a3e483d77e6a1e6177eb8a1c4c11016da">serv1</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a3e483d77e6a1e6177eb8a1c4c11016da">serv1</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a3e483d77e6a1e6177eb8a1c4c11016da">serv1</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a3e483d77e6a1e6177eb8a1c4c11016da">serv1</a>], <span class="keyword">False</span>)</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="comment"># -proxy plus -onion</span></div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ae4703fae8e71378638c99f4d7a171ec7">node_test</a>(self.<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a1c8a2aab0f11f2370c48060835f23f76">nodes</a>[1], [self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a3e483d77e6a1e6177eb8a1c4c11016da">serv1</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a3e483d77e6a1e6177eb8a1c4c11016da">serv1</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ad5af9d8d429251c9e346c3fceae357d7">serv2</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a3e483d77e6a1e6177eb8a1c4c11016da">serv1</a>], <span class="keyword">False</span>)</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="comment"># -proxy plus -onion, -proxyrandomize</span></div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; rv = self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ae4703fae8e71378638c99f4d7a171ec7">node_test</a>(self.<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a1c8a2aab0f11f2370c48060835f23f76">nodes</a>[2], [self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ad5af9d8d429251c9e346c3fceae357d7">serv2</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ad5af9d8d429251c9e346c3fceae357d7">serv2</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ad5af9d8d429251c9e346c3fceae357d7">serv2</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ad5af9d8d429251c9e346c3fceae357d7">serv2</a>], <span class="keyword">True</span>)</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="comment"># Check that credentials as used for -proxyrandomize connections are unique</span></div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; credentials = set((x.username,x.password) <span class="keywordflow">for</span> x <span class="keywordflow">in</span> rv)</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(len(credentials), len(rv))</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="keywordflow">if</span> self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a257cb169b8602142c040b2d11ba0e8e2">have_ipv6</a>:</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="comment"># proxy on IPv6 localhost</span></div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ae4703fae8e71378638c99f4d7a171ec7">node_test</a>(self.<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a1c8a2aab0f11f2370c48060835f23f76">nodes</a>[3], [self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a2c58b9ef1f4024c682ae26791ab8302d">serv3</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a2c58b9ef1f4024c682ae26791ab8302d">serv3</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a2c58b9ef1f4024c682ae26791ab8302d">serv3</a>, self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a2c58b9ef1f4024c682ae26791ab8302d">serv3</a>], <span class="keyword">False</span>, <span class="keyword">False</span>)</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keyword">def </span>networks_dict(d):</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; r = {}</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordflow">for</span> x <span class="keywordflow">in</span> d[<span class="stringliteral">&#39;networks&#39;</span>]:</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; r[x[<span class="stringliteral">&#39;name&#39;</span>]] = x</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="keywordflow">return</span> r</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="comment"># test RPC getnetworkinfo</span></div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; n0 = networks_dict(self.<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a1c8a2aab0f11f2370c48060835f23f76">nodes</a>[0].<a class="code" href="rpc_2net_8cpp.html#a46fc244635dd8fafde0e76960822c6cd">getnetworkinfo</a>())</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="keywordflow">for</span> net <span class="keywordflow">in</span> [<span class="stringliteral">&#39;ipv4&#39;</span>,<span class="stringliteral">&#39;ipv6&#39;</span>,<span class="stringliteral">&#39;onion&#39;</span>]:</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n0[net][<span class="stringliteral">&#39;proxy&#39;</span>], <span class="stringliteral">&#39;%s:%i&#39;</span> % (self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a5a8e353ea4cf4c66539d35b67123e90c">conf1</a>.addr))</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n0[net][<span class="stringliteral">&#39;proxy_randomize_credentials&#39;</span>], <span class="keyword">True</span>)</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n0[<span class="stringliteral">&#39;onion&#39;</span>][<span class="stringliteral">&#39;reachable&#39;</span>], <span class="keyword">True</span>)</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; n1 = networks_dict(self.<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a1c8a2aab0f11f2370c48060835f23f76">nodes</a>[1].<a class="code" href="rpc_2net_8cpp.html#a46fc244635dd8fafde0e76960822c6cd">getnetworkinfo</a>())</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordflow">for</span> net <span class="keywordflow">in</span> [<span class="stringliteral">&#39;ipv4&#39;</span>,<span class="stringliteral">&#39;ipv6&#39;</span>]:</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n1[net][<span class="stringliteral">&#39;proxy&#39;</span>], <span class="stringliteral">&#39;%s:%i&#39;</span> % (self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a5a8e353ea4cf4c66539d35b67123e90c">conf1</a>.addr))</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n1[net][<span class="stringliteral">&#39;proxy_randomize_credentials&#39;</span>], <span class="keyword">False</span>)</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n1[<span class="stringliteral">&#39;onion&#39;</span>][<span class="stringliteral">&#39;proxy&#39;</span>], <span class="stringliteral">&#39;%s:%i&#39;</span> % (self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ab71eee430a9bcdab2722c30221ed255e">conf2</a>.addr))</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n1[<span class="stringliteral">&#39;onion&#39;</span>][<span class="stringliteral">&#39;proxy_randomize_credentials&#39;</span>], <span class="keyword">False</span>)</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n1[<span class="stringliteral">&#39;onion&#39;</span>][<span class="stringliteral">&#39;reachable&#39;</span>], <span class="keyword">True</span>)</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; </div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; n2 = networks_dict(self.<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a1c8a2aab0f11f2370c48060835f23f76">nodes</a>[2].<a class="code" href="rpc_2net_8cpp.html#a46fc244635dd8fafde0e76960822c6cd">getnetworkinfo</a>())</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordflow">for</span> net <span class="keywordflow">in</span> [<span class="stringliteral">&#39;ipv4&#39;</span>,<span class="stringliteral">&#39;ipv6&#39;</span>,<span class="stringliteral">&#39;onion&#39;</span>]:</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n2[net][<span class="stringliteral">&#39;proxy&#39;</span>], <span class="stringliteral">&#39;%s:%i&#39;</span> % (self.<a class="code" href="classproxy__test_1_1ProxyTest.html#ab71eee430a9bcdab2722c30221ed255e">conf2</a>.addr))</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n2[net][<span class="stringliteral">&#39;proxy_randomize_credentials&#39;</span>], <span class="keyword">True</span>)</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n2[<span class="stringliteral">&#39;onion&#39;</span>][<span class="stringliteral">&#39;reachable&#39;</span>], <span class="keyword">True</span>)</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordflow">if</span> self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a257cb169b8602142c040b2d11ba0e8e2">have_ipv6</a>:</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; n3 = networks_dict(self.<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a1c8a2aab0f11f2370c48060835f23f76">nodes</a>[3].<a class="code" href="rpc_2net_8cpp.html#a46fc244635dd8fafde0e76960822c6cd">getnetworkinfo</a>())</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">for</span> net <span class="keywordflow">in</span> [<span class="stringliteral">&#39;ipv4&#39;</span>,<span class="stringliteral">&#39;ipv6&#39;</span>]:</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n3[net][<span class="stringliteral">&#39;proxy&#39;</span>], <span class="stringliteral">&#39;[%s]:%i&#39;</span> % (self.<a class="code" href="classproxy__test_1_1ProxyTest.html#a424d17c5a035b2d055fd8c90a10ce57e">conf3</a>.addr))</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n3[net][<span class="stringliteral">&#39;proxy_randomize_credentials&#39;</span>], <span class="keyword">False</span>)</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <a class="code" href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">assert_equal</a>(n3[<span class="stringliteral">&#39;onion&#39;</span>][<span class="stringliteral">&#39;reachable&#39;</span>], <span class="keyword">False</span>)</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;<span class="keywordflow">if</span> __name__ == <span class="stringliteral">&#39;__main__&#39;</span>:</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="classproxy__test_1_1ProxyTest.html">ProxyTest</a>().<a class="code" href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a076857f5499c37bacf64a8ccb6ba5197">main</a>()</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;</div><div class="ttc" id="classproxy__test_1_1ProxyTest_html_a2c58b9ef1f4024c682ae26791ab8302d"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html#a2c58b9ef1f4024c682ae26791ab8302d">proxy_test.ProxyTest.serv3</a></div><div class="ttdeci">serv3</div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00065">proxy_test.py:65</a></div></div>
<div class="ttc" id="classtest__framework_1_1socks5_1_1Socks5Server_html"><div class="ttname"><a href="classtest__framework_1_1socks5_1_1Socks5Server.html">test_framework.socks5.Socks5Server</a></div><div class="ttdef"><b>Definition:</b> <a href="socks5_8py_source.html#l00126">socks5.py:126</a></div></div>
<div class="ttc" id="classproxy__test_1_1ProxyTest_html_a257cb169b8602142c040b2d11ba0e8e2"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html#a257cb169b8602142c040b2d11ba0e8e2">proxy_test.ProxyTest.have_ipv6</a></div><div class="ttdeci">have_ipv6</div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00038">proxy_test.py:38</a></div></div>
<div class="ttc" id="namespacetest__framework_1_1util_html_aa6b84bae918a356af030860efab10362"><div class="ttname"><a href="namespacetest__framework_1_1util.html#aa6b84bae918a356af030860efab10362">test_framework.util.start_nodes</a></div><div class="ttdeci">def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, binary=None)</div><div class="ttdef"><b>Definition:</b> <a href="util_8py_source.html#l00305">util.py:305</a></div></div>
<div class="ttc" id="classproxy__test_1_1ProxyTest_html_a12a7e26615207c7b76c6d80bc9c71f03"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html#a12a7e26615207c7b76c6d80bc9c71f03">proxy_test.ProxyTest.run_test</a></div><div class="ttdeci">def run_test(self)</div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00137">proxy_test.py:137</a></div></div>
<div class="ttc" id="classproxy__test_1_1ProxyTest_html_ad5af9d8d429251c9e346c3fceae357d7"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html#ad5af9d8d429251c9e346c3fceae357d7">proxy_test.ProxyTest.serv2</a></div><div class="ttdeci">serv2</div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00062">proxy_test.py:62</a></div></div>
<div class="ttc" id="classtest__framework_1_1test__framework_1_1BitcoinTestFramework_html_a1c8a2aab0f11f2370c48060835f23f76"><div class="ttname"><a href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a1c8a2aab0f11f2370c48060835f23f76">test_framework.test_framework.BitcoinTestFramework.nodes</a></div><div class="ttdeci">nodes</div><div class="ttdef"><b>Definition:</b> <a href="test__framework_8py_source.html#l00051">test_framework.py:51</a></div></div>
<div class="ttc" id="namespacetest__framework_1_1test__framework_html"><div class="ttname"><a href="namespacetest__framework_1_1test__framework.html">test_framework.test_framework</a></div><div class="ttdef"><b>Definition:</b> <a href="test__framework_8py_source.html#l00001">test_framework.py:1</a></div></div>
<div class="ttc" id="classtest__framework_1_1test__framework_1_1BitcoinTestFramework_html"><div class="ttname"><a href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html">test_framework.test_framework.BitcoinTestFramework</a></div><div class="ttdef"><b>Definition:</b> <a href="test__framework_8py_source.html#l00032">test_framework.py:32</a></div></div>
<div class="ttc" id="classproxy__test_1_1ProxyTest_html_a5a8e353ea4cf4c66539d35b67123e90c"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html#a5a8e353ea4cf4c66539d35b67123e90c">proxy_test.ProxyTest.conf1</a></div><div class="ttdeci">conf1</div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00041">proxy_test.py:41</a></div></div>
<div class="ttc" id="classproxy__test_1_1ProxyTest_html_afbdbd60e7aef567aa777098b00155aef"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html#afbdbd60e7aef567aa777098b00155aef">proxy_test.ProxyTest.setup_nodes</a></div><div class="ttdeci">def setup_nodes(self)</div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00068">proxy_test.py:68</a></div></div>
<div class="ttc" id="classproxy__test_1_1ProxyTest_html_a3e483d77e6a1e6177eb8a1c4c11016da"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html#a3e483d77e6a1e6177eb8a1c4c11016da">proxy_test.ProxyTest.serv1</a></div><div class="ttdeci">serv1</div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00060">proxy_test.py:60</a></div></div>
<div class="ttc" id="namespacetest__framework_1_1socks5_html"><div class="ttname"><a href="namespacetest__framework_1_1socks5.html">test_framework.socks5</a></div><div class="ttdef"><b>Definition:</b> <a href="socks5_8py_source.html#l00001">socks5.py:1</a></div></div>
<div class="ttc" id="namespacetest__framework_1_1netutil_html_a424bed103bfdd9990d154cd5e8776445"><div class="ttname"><a href="namespacetest__framework_1_1netutil.html#a424bed103bfdd9990d154cd5e8776445">test_framework.netutil.test_ipv6_local</a></div><div class="ttdeci">def test_ipv6_local()</div><div class="ttdef"><b>Definition:</b> <a href="netutil_8py_source.html#l00142">netutil.py:142</a></div></div>
<div class="ttc" id="classtest__framework_1_1test__framework_1_1BitcoinTestFramework_html_a076857f5499c37bacf64a8ccb6ba5197"><div class="ttname"><a href="classtest__framework_1_1test__framework_1_1BitcoinTestFramework.html#a076857f5499c37bacf64a8ccb6ba5197">test_framework.test_framework.BitcoinTestFramework.main</a></div><div class="ttdeci">def main(self)</div><div class="ttdef"><b>Definition:</b> <a href="test__framework_8py_source.html#l00097">test_framework.py:97</a></div></div>
<div class="ttc" id="classproxy__test_1_1ProxyTest_html_ae4703fae8e71378638c99f4d7a171ec7"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html#ae4703fae8e71378638c99f4d7a171ec7">proxy_test.ProxyTest.node_test</a></div><div class="ttdeci">def node_test(self, node, proxies, auth, test_onion=True)</div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00081">proxy_test.py:81</a></div></div>
<div class="ttc" id="classproxy__test_1_1ProxyTest_html"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html">proxy_test.ProxyTest</a></div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00036">proxy_test.py:36</a></div></div>
<div class="ttc" id="rpc_2net_8cpp_html_a46fc244635dd8fafde0e76960822c6cd"><div class="ttname"><a href="rpc_2net_8cpp.html#a46fc244635dd8fafde0e76960822c6cd">getnetworkinfo</a></div><div class="ttdeci">UniValue getnetworkinfo(const UniValue &amp;params, bool fHelp)</div><div class="ttdef"><b>Definition:</b> <a href="rpc_2net_8cpp_source.html#l00392">net.cpp:392</a></div></div>
<div class="ttc" id="classproxy__test_1_1ProxyTest_html_a9df05c69a01dd153ac25523de1035f7a"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html#a9df05c69a01dd153ac25523de1035f7a">proxy_test.ProxyTest.__init__</a></div><div class="ttdeci">def __init__(self)</div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00037">proxy_test.py:37</a></div></div>
<div class="ttc" id="classproxy__test_1_1ProxyTest_html_ab71eee430a9bcdab2722c30221ed255e"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html#ab71eee430a9bcdab2722c30221ed255e">proxy_test.ProxyTest.conf2</a></div><div class="ttdeci">conf2</div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00046">proxy_test.py:46</a></div></div>
<div class="ttc" id="classtest__framework_1_1socks5_1_1Socks5Configuration_html"><div class="ttname"><a href="classtest__framework_1_1socks5_1_1Socks5Configuration.html">test_framework.socks5.Socks5Configuration</a></div><div class="ttdoc">Implementation classes. </div><div class="ttdef"><b>Definition:</b> <a href="socks5_8py_source.html#l00033">socks5.py:33</a></div></div>
<div class="ttc" id="namespacetest__framework_1_1util_html"><div class="ttname"><a href="namespacetest__framework_1_1util.html">test_framework.util</a></div><div class="ttdef"><b>Definition:</b> <a href="util_8py_source.html#l00001">util.py:1</a></div></div>
<div class="ttc" id="namespacetest__framework_1_1util_html_ad3df488aacbcdc741bbb9eb66caddd6b"><div class="ttname"><a href="namespacetest__framework_1_1util.html#ad3df488aacbcdc741bbb9eb66caddd6b">test_framework.util.assert_equal</a></div><div class="ttdeci">def assert_equal(thing1, thing2)</div><div class="ttdef"><b>Definition:</b> <a href="util_8py_source.html#l00461">util.py:461</a></div></div>
<div class="ttc" id="classproxy__test_1_1ProxyTest_html_a424d17c5a035b2d055fd8c90a10ce57e"><div class="ttname"><a href="classproxy__test_1_1ProxyTest.html#a424d17c5a035b2d055fd8c90a10ce57e">proxy_test.ProxyTest.conf3</a></div><div class="ttdeci">conf3</div><div class="ttdef"><b>Definition:</b> <a href="proxy__test_8py_source.html#l00052">proxy_test.py:52</a></div></div>
<div class="ttc" id="namespacetest__framework_1_1netutil_html"><div class="ttname"><a href="namespacetest__framework_1_1netutil.html">test_framework.netutil</a></div><div class="ttdef"><b>Definition:</b> <a href="netutil_8py_source.html#l00001">netutil.py:1</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_62ba24d7ce8eecc59962fe5b590c1065.html">qa</a></li><li class="navelem"><a class="el" href="dir_dbddb259b29a77ea11562b7a380aa303.html">rpc-tests</a></li><li class="navelem"><a class="el" href="proxy__test_8py.html">proxy_test.py</a></li>
<li class="footer">Generated on Thu Dec 14 2017 13:15:02 for Dash Core by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
</ul>
</div>
</body>
</html>