frp/test/e2e/framework/consts/consts.go

40 lines
765 B
Go
Raw Normal View History

2020-06-02 22:48:55 +08:00
package consts
2021-03-31 16:57:39 +08:00
import (
"fmt"
"time"
"github.com/fatedier/frp/test/e2e/pkg/port"
2020-06-02 22:48:55 +08:00
)
2020-09-07 14:57:23 +08:00
const (
2021-03-31 16:57:39 +08:00
TestString = "frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet."
DefaultTimeout = 2 * time.Second
2020-09-07 14:57:23 +08:00
)
2021-03-31 16:57:39 +08:00
var (
PortServerName string
PortClientAdmin string
2020-09-07 14:57:23 +08:00
DefaultServerConfig = `
[common]
2021-03-31 16:57:39 +08:00
bind_port = {{ .%s }}
log_level = trace
2020-09-07 14:57:23 +08:00
`
DefaultClientConfig = `
[common]
server_addr = 127.0.0.1
2021-03-31 16:57:39 +08:00
server_port = {{ .%s }}
log_level = trace
2020-09-07 14:57:23 +08:00
`
)
2021-03-31 16:57:39 +08:00
func init() {
PortServerName = port.GenName("Server")
PortClientAdmin = port.GenName("ClientAdmin")
DefaultServerConfig = fmt.Sprintf(DefaultServerConfig, port.GenName("Server"))
DefaultClientConfig = fmt.Sprintf(DefaultClientConfig, port.GenName("Server"))
}