mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
35 lines
774 B
Go
35 lines
774 B
Go
package e2e
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"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 _ = Describe("[Feature: Example]", func() {
|
|
f := framework.NewDefaultFramework()
|
|
|
|
Describe("TCP", func() {
|
|
It("Expose a TCP echo server", 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, portName)
|
|
|
|
f.RunProcesses([]string{serverConf}, []string{clientConf})
|
|
|
|
framework.NewRequestExpect(f).PortName(portName).Ensure()
|
|
})
|
|
})
|
|
})
|