Skip to content

Commit

Permalink
Fix some tests to use udp.PickPort()
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhan6665 committed Sep 27, 2021
1 parent 490e360 commit 2cc592a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion testing/scenarios/dokodemo_test.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/xtls/xray-core/proxy/vmess/inbound"
"github.com/xtls/xray-core/proxy/vmess/outbound"
"github.com/xtls/xray-core/testing/servers/tcp"
"github.com/xtls/xray-core/testing/servers/udp"
"github.com/xtls/xray-core/transport/internet"
"github.com/xtls/xray-core/transport/internet/domainsocket"
"github.com/xtls/xray-core/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
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func TestVMessGCMUDP(t *testing.T) {
},
}

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

0 comments on commit 2cc592a

Please sign in to comment.