@@ -38,7 +38,7 @@ test_expect_success "enable filestore config setting" '
38
38
'
39
39
40
40
test_expect_success ' start p2p listener' '
41
- ipfsi 0 p2p forward p2p-test /ipfs /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log
41
+ ipfsi 0 p2p forward /p2p/ p2p-test /ipfs /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log
42
42
'
43
43
44
44
# Server to client communications
@@ -69,7 +69,7 @@ test_server_to_client() {
69
69
spawn_sending_server
70
70
71
71
test_expect_success ' S->C Setup client side' '
72
- ipfsi 1 p2p forward p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/${PEERID_0} 2>&1 > dialer-stdouterr.log
72
+ ipfsi 1 p2p forward /p2p/ p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/${PEERID_0} 2>&1 > dialer-stdouterr.log
73
73
'
74
74
75
75
test_server_to_client
@@ -87,7 +87,7 @@ spawn_sending_server
87
87
test_server_to_client
88
88
89
89
test_expect_success ' S->C Close local listener' '
90
- ipfsi 1 p2p close -p p2p-test
90
+ ipfsi 1 p2p close -p /p2p/ p2p-test
91
91
'
92
92
93
93
check_test_ports
@@ -102,7 +102,7 @@ test_expect_success 'C->S Spawn receiving server' '
102
102
'
103
103
104
104
test_expect_success ' C->S Setup client side' '
105
- ipfsi 1 p2p forward p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/${PEERID_0} 2>&1 > dialer-stdouterr.log
105
+ ipfsi 1 p2p forward /p2p/ p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/${PEERID_0} 2>&1 > dialer-stdouterr.log
106
106
'
107
107
108
108
test_expect_success ' C->S Connect and receive data' '
@@ -119,7 +119,7 @@ test_expect_success 'C->S Output looks good' '
119
119
'
120
120
121
121
test_expect_success ' C->S Close local listener' '
122
- ipfsi 1 p2p close -p p2p-test
122
+ ipfsi 1 p2p close -p /p2p/ p2p-test
123
123
'
124
124
125
125
check_test_ports
@@ -136,7 +136,7 @@ test_expect_success "'ipfs p2p ls' output looks good" '
136
136
'
137
137
138
138
test_expect_success " Cannot re-register app handler" '
139
- test_must_fail ipfsi 0 p2p forward p2p-test /ipfs /ip4/127.0.0.1/tcp/10101
139
+ test_must_fail ipfsi 0 p2p forward /p2p/ p2p-test /ipfs /ip4/127.0.0.1/tcp/10101
140
140
'
141
141
142
142
test_expect_success " 'ipfs p2p stream ls' output is empty" '
@@ -147,7 +147,7 @@ test_expect_success "'ipfs p2p stream ls' output is empty" '
147
147
test_expect_success " Setup: Idle stream" '
148
148
ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 &
149
149
150
- ipfsi 1 p2p forward p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/$PEERID_0 2>&1 > dialer-stdouterr.log &&
150
+ ipfsi 1 p2p forward /p2p/ p2p-test /ip4/127.0.0.1/tcp/10102 /ipfs/$PEERID_0 2>&1 > dialer-stdouterr.log &&
151
151
ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 &
152
152
153
153
test_wait_for_file 30 100ms listener.pid &&
@@ -172,13 +172,13 @@ test_expect_success "'ipfs p2p stream close' closes stream" '
172
172
'
173
173
174
174
test_expect_success " 'ipfs p2p close' closes remote handler" '
175
- ipfsi 0 p2p close -p p2p-test &&
175
+ ipfsi 0 p2p close -p /p2p/ p2p-test &&
176
176
ipfsi 0 p2p ls > actual &&
177
177
test_must_be_empty actual
178
178
'
179
179
180
180
test_expect_success " 'ipfs p2p close' closes local handler" '
181
- ipfsi 1 p2p close -p p2p-test &&
181
+ ipfsi 1 p2p close -p /p2p/ p2p-test &&
182
182
ipfsi 1 p2p ls > actual &&
183
183
test_must_be_empty actual
184
184
'
@@ -188,8 +188,8 @@ check_test_ports
188
188
test_expect_success " Setup: Idle stream(2)" '
189
189
ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 &
190
190
191
- ipfsi 0 p2p forward p2p-test2 /ipfs /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log &&
192
- ipfsi 1 p2p forward p2p-test2 /ip4/127.0.0.1/tcp/10102 /ipfs/$PEERID_0 2>&1 > dialer-stdouterr.log &&
191
+ ipfsi 0 p2p forward /p2p/ p2p-test2 /ipfs /ip4/127.0.0.1/tcp/10101 2>&1 > listener-stdouterr.log &&
192
+ ipfsi 1 p2p forward /p2p/ p2p-test2 /ip4/127.0.0.1/tcp/10102 /ipfs/$PEERID_0 2>&1 > dialer-stdouterr.log &&
193
193
ma-pipe-unidir --pidFile=client.pid recv /ip4/127.0.0.1/tcp/10102 &
194
194
195
195
test_wait_for_file 30 100ms listener.pid &&
@@ -225,12 +225,18 @@ test_expect_success "'ipfs p2p stream close -a' closes streams" '
225
225
check_test_ports
226
226
227
227
test_expect_success " 'ipfs p2p close' closes app numeric handlers" '
228
- ipfsi 0 p2p forward 1234 /ipfs /ip4/127.0.0.1/tcp/10101 &&
229
- ipfsi 0 p2p close -p 1234 &&
228
+ ipfsi 0 p2p forward /p2p/ 1234 /ipfs /ip4/127.0.0.1/tcp/10101 &&
229
+ ipfsi 0 p2p close -p /p2p/ 1234 &&
230
230
ipfsi 0 p2p ls > actual &&
231
231
test_must_be_empty actual
232
232
'
233
233
234
+ test_expect_success " non /p2p/ scoped protocols are not allowed" '
235
+ test_must_fail ipfsi 0 p2p forward /its/not/a/p2p/path /ipfs /ip4/127.0.0.1/tcp/10101 2> actual &&
236
+ echo "Error: protocol name must be within ' " '" ' /p2p/' " '" ' namespace" > expected
237
+ test_cmp expected actual
238
+ '
239
+
234
240
check_test_ports
235
241
236
242
test_expect_success ' stop iptb' '
0 commit comments