sukun
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
3 additions and
2 deletions
-
.github/workflows/go-test.yml
-
p2p/net/nat/nat_test.go
|
|
@ -17,6 +17,6 @@ jobs: |
|
|
|
go-test: |
|
|
|
uses: ./.github/workflows/go-test-template.yml |
|
|
|
with: |
|
|
|
go-versions: '["1.21.x", "1.22.x"]' |
|
|
|
go-versions: '["1.22.x", "1.23.x"]' |
|
|
|
secrets: |
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
|
|
|
|
|
@ -45,7 +45,8 @@ func TestAddMapping(t *testing.T) { |
|
|
|
require.False(t, found, "didn't expect a port mapping for unmapped protocol") |
|
|
|
mapped, found := nat.GetMapping("tcp", 10000) |
|
|
|
require.True(t, found, "expected port mapping") |
|
|
|
require.Equal(t, netip.AddrPortFrom(netip.AddrFrom4([4]byte{1, 2, 3, 4}), 1234), mapped) |
|
|
|
addr, _ := netip.AddrFromSlice(net.IPv4(1, 2, 3, 4)) |
|
|
|
require.Equal(t, netip.AddrPortFrom(addr, 1234), mapped) |
|
|
|
} |
|
|
|
|
|
|
|
func TestRemoveMapping(t *testing.T) { |
|
|
|