-
Notifications
You must be signed in to change notification settings - Fork 0
/
examples.go
35 lines (26 loc) · 846 Bytes
/
examples.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package e2e
import (
"fmt"
"time"
"github.com/HaidyCao/frp_0351/test/e2e/framework"
"github.com/HaidyCao/frp_0351/test/e2e/framework/consts"
. "github.com/onsi/ginkgo"
)
var connTimeout = 2 * time.Second
var _ = Describe("[Feature: Example]", func() {
f := framework.NewDefaultFramework()
Describe("TCP", func() {
It("Expose a TCP echo server", func() {
serverConf := consts.DefaultServerConfig
clientConf := consts.DefaultClientConfig
clientConf += fmt.Sprintf(`
[tcp]
type = tcp
local_port = {{ .%s }}
remote_port = {{ .%s }}
`, framework.TCPEchoServerPort, framework.GenPortName("TCP"))
f.RunProcesses([]string{serverConf}, []string{clientConf})
framework.ExpectTCPRequest(f.UsedPorts[framework.GenPortName("TCP")], []byte(consts.TestString), []byte(consts.TestString), connTimeout)
})
})
})