mirror of
https://github.com/fatedier/frp.git
synced 2025-08-03 12:24:43 +00:00
add e2e tests (#2334)
This commit is contained in:
@@ -2,16 +2,14 @@ package e2e
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/fatedier/frp/test/e2e/framework"
|
||||
"github.com/fatedier/frp/test/e2e/framework/consts"
|
||||
"github.com/fatedier/frp/test/e2e/pkg/port"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
)
|
||||
|
||||
var connTimeout = 2 * time.Second
|
||||
|
||||
var _ = Describe("[Feature: Example]", func() {
|
||||
f := framework.NewDefaultFramework()
|
||||
|
||||
@@ -20,16 +18,17 @@ var _ = Describe("[Feature: Example]", func() {
|
||||
serverConf := consts.DefaultServerConfig
|
||||
clientConf := consts.DefaultClientConfig
|
||||
|
||||
portName := port.GenName("TCP")
|
||||
clientConf += fmt.Sprintf(`
|
||||
[tcp]
|
||||
type = tcp
|
||||
local_port = {{ .%s }}
|
||||
remote_port = {{ .%s }}
|
||||
`, framework.TCPEchoServerPort, framework.GenPortName("TCP"))
|
||||
`, framework.TCPEchoServerPort, portName)
|
||||
|
||||
f.RunProcesses([]string{serverConf}, []string{clientConf})
|
||||
|
||||
framework.ExpectTCPRequest(f.UsedPorts[framework.GenPortName("TCP")], []byte(consts.TestString), []byte(consts.TestString), connTimeout)
|
||||
framework.NewRequestExpect(f).PortName(portName).Ensure()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user