mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-14 09:39:17 -04:00
remove port testing
This commit is contained in:
@@ -8,8 +8,8 @@ import (
|
||||
"github.com/v2ray/v2ray-core/app/dispatcher"
|
||||
dispatchers "github.com/v2ray/v2ray-core/app/dispatcher/impl"
|
||||
"github.com/v2ray/v2ray-core/app/proxyman"
|
||||
"github.com/v2ray/v2ray-core/common/dice"
|
||||
v2net "github.com/v2ray/v2ray-core/common/net"
|
||||
v2nettesting "github.com/v2ray/v2ray-core/common/net/testing"
|
||||
"github.com/v2ray/v2ray-core/proxy"
|
||||
. "github.com/v2ray/v2ray-core/proxy/dokodemo"
|
||||
"github.com/v2ray/v2ray-core/proxy/freedom"
|
||||
@@ -23,7 +23,6 @@ func TestDokodemoTCP(t *testing.T) {
|
||||
assert := assert.On(t)
|
||||
|
||||
tcpServer := &tcp.Server{
|
||||
Port: v2nettesting.PickPort(),
|
||||
MsgProcessor: func(data []byte) []byte {
|
||||
buffer := make([]byte, 0, 2048)
|
||||
buffer = append(buffer, []byte("Processed: ")...)
|
||||
@@ -53,7 +52,7 @@ func TestDokodemoTCP(t *testing.T) {
|
||||
|
||||
data2Send := "Data to be sent to remote."
|
||||
|
||||
port := v2nettesting.PickPort()
|
||||
port := v2net.Port(dice.Roll(20000) + 10000)
|
||||
dokodemo := NewDokodemoDoor(&Config{
|
||||
Address: v2net.LocalHostIP,
|
||||
Port: tcpServer.Port,
|
||||
@@ -95,7 +94,6 @@ func TestDokodemoUDP(t *testing.T) {
|
||||
assert := assert.On(t)
|
||||
|
||||
udpServer := &udp.Server{
|
||||
Port: v2nettesting.PickPort(),
|
||||
MsgProcessor: func(data []byte) []byte {
|
||||
buffer := make([]byte, 0, 2048)
|
||||
buffer = append(buffer, []byte("Processed: ")...)
|
||||
@@ -124,7 +122,7 @@ func TestDokodemoUDP(t *testing.T) {
|
||||
|
||||
data2Send := "Data to be sent to remote."
|
||||
|
||||
port := v2nettesting.PickPort()
|
||||
port := v2net.Port(dice.Roll(20000) + 10000)
|
||||
dokodemo := NewDokodemoDoor(&Config{
|
||||
Address: v2net.LocalHostIP,
|
||||
Port: udpServer.Port,
|
||||
|
||||
@@ -13,7 +13,6 @@ import (
|
||||
"github.com/v2ray/v2ray-core/app/router/rules"
|
||||
"github.com/v2ray/v2ray-core/common/alloc"
|
||||
v2net "github.com/v2ray/v2ray-core/common/net"
|
||||
v2nettesting "github.com/v2ray/v2ray-core/common/net/testing"
|
||||
"github.com/v2ray/v2ray-core/proxy"
|
||||
. "github.com/v2ray/v2ray-core/proxy/freedom"
|
||||
"github.com/v2ray/v2ray-core/testing/assert"
|
||||
@@ -24,10 +23,8 @@ import (
|
||||
|
||||
func TestSinglePacket(t *testing.T) {
|
||||
assert := assert.On(t)
|
||||
port := v2nettesting.PickPort()
|
||||
|
||||
tcpServer := &tcp.Server{
|
||||
Port: port,
|
||||
MsgProcessor: func(data []byte) []byte {
|
||||
buffer := make([]byte, 0, 2048)
|
||||
buffer = append(buffer, []byte("Processed: ")...)
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"testing"
|
||||
|
||||
testdispatcher "github.com/v2ray/v2ray-core/app/dispatcher/testing"
|
||||
"github.com/v2ray/v2ray-core/common/dice"
|
||||
v2net "github.com/v2ray/v2ray-core/common/net"
|
||||
v2nettesting "github.com/v2ray/v2ray-core/common/net/testing"
|
||||
"github.com/v2ray/v2ray-core/proxy"
|
||||
. "github.com/v2ray/v2ray-core/proxy/http"
|
||||
"github.com/v2ray/v2ray-core/testing/assert"
|
||||
@@ -56,7 +56,7 @@ func TestNormalGetRequest(t *testing.T) {
|
||||
|
||||
testPacketDispatcher := testdispatcher.NewTestPacketDispatcher(nil)
|
||||
|
||||
port := v2nettesting.PickPort()
|
||||
port := v2net.Port(dice.Roll(20000) + 10000)
|
||||
httpProxy := NewServer(
|
||||
&Config{},
|
||||
testPacketDispatcher,
|
||||
|
||||
Reference in New Issue
Block a user