examples.go 762 B

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