@@ -23,18 +23,7 @@ def set_test_params(self):
23
23
# This is just a minimum
24
24
self .num_nodes = 10
25
25
26
- def add_options (self , parser ):
27
- parser .add_argument (
28
- "--network_name" ,
29
- dest = "network_name" ,
30
- default = "warnet" ,
31
- help = "" ,
32
- )
33
-
34
26
def run_test (self ):
35
- while not self .warnet .network_connected ():
36
- sleep (1 )
37
-
38
27
# All permutations of a directed acyclic graph with zero, one, or two inputs/outputs
39
28
#
40
29
# │ Node │ In │ Out │ Con In │ Con Out │
@@ -66,12 +55,6 @@ def run_test(self):
66
55
self .connect_nodes (5 , 4 )
67
56
self .connect_nodes (5 , 6 )
68
57
self .connect_nodes (6 , 7 )
69
-
70
- # Nodes 8 & 9 shall come pre-connected. Attempt to connect them anyway to test the handling
71
- # of dns node addresses
72
- self .connect_nodes (8 , 9 )
73
- self .connect_nodes (9 , 8 )
74
-
75
58
self .sync_all ()
76
59
77
60
zero_peers = self .nodes [0 ].getpeerinfo ()
@@ -85,31 +68,29 @@ def run_test(self):
85
68
eight_peers = self .nodes [8 ].getpeerinfo ()
86
69
nine_peers = self .nodes [9 ].getpeerinfo ()
87
70
88
- for tank in self .warnet .tanks :
89
- self .log .info (
90
- f"Tank { tank .index } : { tank .warnet .tanks [tank .index ].get_dns_addr ()} pod:"
91
- f" { tank .warnet .tanks [tank .index ].get_ip_addr ()} "
92
- )
71
+ for node in self .nodes :
72
+ self .log .info (f"Node { node .index } : tank={ node .tank } ip={ node .rpchost } " )
93
73
94
- self .assert_connection (zero_peers , 2 , ConnectionType .DNS )
95
- self .assert_connection (one_peers , 2 , ConnectionType .DNS )
96
- self .assert_connection (one_peers , 3 , ConnectionType .DNS )
74
+ self .assert_connection (zero_peers , 2 , ConnectionType .IP )
75
+ self .assert_connection (one_peers , 2 , ConnectionType .IP )
76
+ self .assert_connection (one_peers , 3 , ConnectionType .IP )
97
77
self .assert_connection (two_peers , 0 , ConnectionType .IP )
98
78
self .assert_connection (two_peers , 1 , ConnectionType .IP )
99
- self .assert_connection (two_peers , 3 , ConnectionType .DNS )
100
- self .assert_connection (two_peers , 4 , ConnectionType .DNS )
79
+ self .assert_connection (two_peers , 3 , ConnectionType .IP )
80
+ self .assert_connection (two_peers , 4 , ConnectionType .IP )
101
81
self .assert_connection (three_peers , 1 , ConnectionType .IP )
102
82
self .assert_connection (three_peers , 2 , ConnectionType .IP )
103
- self .assert_connection (three_peers , 5 , ConnectionType .DNS )
83
+ self .assert_connection (three_peers , 5 , ConnectionType .IP )
104
84
self .assert_connection (four_peers , 2 , ConnectionType .IP )
105
85
self .assert_connection (four_peers , 5 , ConnectionType .IP )
106
86
self .assert_connection (five_peers , 3 , ConnectionType .IP )
107
- self .assert_connection (five_peers , 4 , ConnectionType .DNS )
108
- self .assert_connection (five_peers , 6 , ConnectionType .DNS )
87
+ self .assert_connection (five_peers , 4 , ConnectionType .IP )
88
+ self .assert_connection (five_peers , 6 , ConnectionType .IP )
109
89
self .assert_connection (six_peers , 5 , ConnectionType .IP )
110
- self .assert_connection (six_peers , 7 , ConnectionType .DNS )
90
+ self .assert_connection (six_peers , 7 , ConnectionType .IP )
111
91
self .assert_connection (seven_peers , 6 , ConnectionType .IP )
112
92
# Check the pre-connected nodes
93
+ # The only connection made by DNS name would be from the initial graph edges
113
94
self .assert_connection (eight_peers , 9 , ConnectionType .DNS )
114
95
self .assert_connection (nine_peers , 8 , ConnectionType .IP )
115
96
@@ -121,14 +102,15 @@ def run_test(self):
121
102
def assert_connection (self , connector , connectee_index , connection_type : ConnectionType ):
122
103
if connection_type == ConnectionType .DNS :
123
104
assert any (
124
- d .get ("addr" ) == self .warnet .tanks [connectee_index ].get_dns_addr ()
105
+ # ignore the ...-service suffix
106
+ self .nodes [connectee_index ].tank in d .get ("addr" )
125
107
for d in connector
126
- ), f"Could not find { self . options . network_name } -tank-00000 { connectee_index } -service "
108
+ ), f"Could not find conectee hostname "
127
109
elif connection_type == ConnectionType .IP :
128
110
assert any (
129
- d .get ("addr" ).split (":" )[0 ] == self .warnet . tanks [connectee_index ].get_ip_addr ()
111
+ d .get ("addr" ).split (":" )[0 ] == self .nodes [connectee_index ].rpchost
130
112
for d in connector
131
- ), f"Could not find Tank { connectee_index } 's ip addr"
113
+ ), f"Could not find connectee ip addr"
132
114
else :
133
115
raise ValueError ("ConnectionType must be of type DNS or IP" )
134
116
0 commit comments