examples.go 718 B

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