Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some tests to use udp.PickPort() #1302

Merged
merged 1 commit into from Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion testing/scenarios/dokodemo_test.go
Expand Up @@ -156,7 +156,7 @@ func TestDokodemoUDP(t *testing.T) {
},
}

clientPort := uint32(tcp.PickPort())
clientPort := uint32(udp.PickPort())
clientPortRange := uint32(5)
clientConfig := &core.Config{
Inbound: []*core.InboundHandlerConfig{
Expand Down
2 changes: 1 addition & 1 deletion testing/scenarios/feature_test.go
Expand Up @@ -512,7 +512,7 @@ func TestUDPConnection(t *testing.T) {
common.Must(err)
defer udpServer.Close()

clientPort := tcp.PickPort()
clientPort := udp.PickPort()
clientConfig := &core.Config{
Inbound: []*core.InboundHandlerConfig{
{
Expand Down
6 changes: 3 additions & 3 deletions testing/scenarios/shadowsocks_test.go
Expand Up @@ -215,7 +215,7 @@ func TestShadowsocksAES128GCMUDP(t *testing.T) {
CipherType: shadowsocks.CipherType_AES_128_GCM,
})

serverPort := tcp.PickPort()
serverPort := udp.PickPort()
serverConfig := &core.Config{
App: []*serial.TypedMessage{
serial.ToTypedMessage(&log.Config{
Expand Down Expand Up @@ -245,7 +245,7 @@ func TestShadowsocksAES128GCMUDP(t *testing.T) {
},
}

clientPort := tcp.PickPort()
clientPort := udp.PickPort()
clientConfig := &core.Config{
App: []*serial.TypedMessage{
serial.ToTypedMessage(&log.Config{
Expand Down Expand Up @@ -341,7 +341,7 @@ func TestShadowsocksAES128GCMUDPMux(t *testing.T) {
},
}

clientPort := tcp.PickPort()
clientPort := udp.PickPort()
clientConfig := &core.Config{
App: []*serial.TypedMessage{
serial.ToTypedMessage(&log.Config{
Expand Down
3 changes: 2 additions & 1 deletion testing/scenarios/transport_test.go
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/v2fly/v2ray-core/v4/proxy/vmess/inbound"
"github.com/v2fly/v2ray-core/v4/proxy/vmess/outbound"
"github.com/v2fly/v2ray-core/v4/testing/servers/tcp"
"github.com/v2fly/v2ray-core/v4/testing/servers/udp"
"github.com/v2fly/v2ray-core/v4/transport/internet"
"github.com/v2fly/v2ray-core/v4/transport/internet/domainsocket"
"github.com/v2fly/v2ray-core/v4/transport/internet/headers/http"
Expand Down Expand Up @@ -257,7 +258,7 @@ func TestVMessQuic(t *testing.T) {
defer tcpServer.Close()

userID := protocol.NewID(uuid.New())
serverPort := tcp.PickPort()
serverPort := udp.PickPort()
serverConfig := &core.Config{
App: []*serial.TypedMessage{
serial.ToTypedMessage(&log.Config{
Expand Down
2 changes: 1 addition & 1 deletion testing/scenarios/vmess_test.go
Expand Up @@ -403,7 +403,7 @@ func TestVMessGCMUDP(t *testing.T) {
},
}

clientPort := tcp.PickPort()
clientPort := udp.PickPort()
clientConfig := &core.Config{
App: []*serial.TypedMessage{
serial.ToTypedMessage(&log.Config{
Expand Down