mirror of
https://github.com/fatedier/frp.git
synced 2026-01-11 22:23:12 +00:00
add e2e tests for v1 config (#3608)
This commit is contained in:
47
test/e2e/v1/features/heartbeat.go
Normal file
47
test/e2e/v1/features/heartbeat.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package features
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/onsi/ginkgo/v2"
|
||||
|
||||
"github.com/fatedier/frp/test/e2e/framework"
|
||||
)
|
||||
|
||||
var _ = ginkgo.Describe("[Feature: Heartbeat]", func() {
|
||||
f := framework.NewDefaultFramework()
|
||||
|
||||
ginkgo.It("disable application layer heartbeat", func() {
|
||||
serverPort := f.AllocPort()
|
||||
serverConf := fmt.Sprintf(`
|
||||
bindAddr = "0.0.0.0"
|
||||
bindPort = %d
|
||||
transport.heartbeatTimeout = -1
|
||||
transport.tcpMuxKeepaliveInterval = 2
|
||||
`, serverPort)
|
||||
|
||||
remotePort := f.AllocPort()
|
||||
clientConf := fmt.Sprintf(`
|
||||
serverPort = %d
|
||||
log.level = "trace"
|
||||
transport.heartbeatInterval = -1
|
||||
transport.heartbeatTimeout = -1
|
||||
transport.tcpMuxKeepaliveInterval = 2
|
||||
|
||||
[[proxies]]
|
||||
name = "tcp"
|
||||
type = "tcp"
|
||||
localPort = %d
|
||||
remotePort = %d
|
||||
`, serverPort, f.PortByName(framework.TCPEchoServerPort), remotePort)
|
||||
|
||||
// run frps and frpc
|
||||
f.RunProcesses([]string{serverConf}, []string{clientConf})
|
||||
|
||||
framework.NewRequestExpect(f).Protocol("tcp").Port(remotePort).Ensure()
|
||||
|
||||
time.Sleep(5 * time.Second)
|
||||
framework.NewRequestExpect(f).Protocol("tcp").Port(remotePort).Ensure()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user