-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9293 from Jorropo/webtransport
feat: add webtransport as an optin transport
- Loading branch information
Showing
8 changed files
with
85 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
test_description="Test ping over WebTransport command" | ||
|
||
. lib/test-lib.sh | ||
|
||
test_init_ipfs | ||
|
||
# start iptb + wait for peering | ||
test_expect_success 'init iptb' ' | ||
iptb testbed create -type localipfs -count 2 -init | ||
' | ||
|
||
addr1='"[\"/ip4/127.0.0.1/udp/0/quic/webtransport\"]"' | ||
addr2='"[\"/ip4/127.0.0.1/udp/0/quic/webtransport\"]"' | ||
test_expect_success "add WebTransport swarm addresses" ' | ||
ipfsi 0 config --json Addresses.Swarm '$addr1' && | ||
ipfsi 0 config --json Swarm.Transports.Network.WebTransport true && | ||
ipfsi 1 config --json Addresses.Swarm '$addr2' && | ||
ipfsi 1 config --json Swarm.Transports.Network.WebTransport true | ||
' | ||
|
||
startup_cluster 2 | ||
|
||
test_expect_success 'peer ids' ' | ||
PEERID_0=$(iptb attr get 0 id) && | ||
PEERID_1=$(iptb attr get 1 id) | ||
' | ||
|
||
test_expect_success "test ping other" ' | ||
ipfsi 0 ping -n2 -- "$PEERID_1" && | ||
ipfsi 1 ping -n2 -- "$PEERID_0" | ||
' | ||
|
||
test_expect_success "test ping self" ' | ||
test_must_fail ipfsi 0 ping -n2 -- "$PEERID_0" && | ||
test_must_fail ipfsi 1 ping -n2 -- "$PEERID_1" | ||
' | ||
|
||
test_expect_success "test ping 0" ' | ||
test_must_fail ipfsi 0 ping -n0 -- "$PEERID_1" && | ||
test_must_fail ipfsi 1 ping -n0 -- "$PEERID_0" | ||
' | ||
|
||
test_expect_success 'stop iptb' ' | ||
iptb stop | ||
' | ||
|
||
test_done |
File renamed without changes.