| 1 | package e2e |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | |
| 6 | "github.com/onsi/ginkgo/v2" |
| 7 | |
| 8 | "github.com/fatedier/frp/test/e2e/framework" |
| 9 | "github.com/fatedier/frp/test/e2e/framework/consts" |
| 10 | ) |
| 11 | |
| 12 | var _ = ginkgo.Describe("[Feature: Example]", func() { |
| 13 | f := framework.NewDefaultFramework() |
| 14 | |
| 15 | ginkgo.Describe("TCP", func() { |
| 16 | ginkgo.It("Expose a TCP echo server", func() { |
| 17 | serverConf := consts.DefaultServerConfig |
| 18 | clientConf := consts.DefaultClientConfig |
| 19 | |
| 20 | remotePort := f.AllocPort() |
| 21 | clientConf += fmt.Sprintf(` |
| 22 | [[proxies]] |
| 23 | name = "tcp" |
| 24 | type = "tcp" |
| 25 | localPort = {{ .%s }} |
| 26 | remotePort = %d |
| 27 | `, framework.TCPEchoServerPort, remotePort) |
| 28 | |
| 29 | f.RunProcesses(serverConf, []string{clientConf}) |
| 30 | |
| 31 | framework.NewRequestExpect(f).Port(remotePort).Ensure() |
| 32 | }) |
| 33 | }) |
| 34 | }) |