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

56 lines
1.1 KiB
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 = `
2023-09-13 16:32:39 +08:00
bindPort = {{ .%s }}
log.level = "trace"
`
DefaultClientConfig = `
serverAddr = "127.0.0.1"
serverPort = {{ .%s }}
loginFailExit = false
2023-09-13 16:32:39 +08:00
log.level = "trace"
`
LegacyDefaultServerConfig = `
2020-09-07 14:57:23 +08:00
[common]
2021-03-31 16:57:39 +08:00
bind_port = {{ .%s }}
log_level = trace
2020-09-07 14:57:23 +08:00
`
2023-09-13 16:32:39 +08:00
LegacyDefaultClientConfig = `
2020-09-07 14:57:23 +08:00
[common]
server_addr = 127.0.0.1
2021-03-31 16:57:39 +08:00
server_port = {{ .%s }}
login_fail_exit = false
2021-03-31 16:57:39 +08:00
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")
2023-09-13 16:32:39 +08:00
LegacyDefaultServerConfig = fmt.Sprintf(LegacyDefaultServerConfig, port.GenName("Server"))
LegacyDefaultClientConfig = fmt.Sprintf(LegacyDefaultClientConfig, port.GenName("Server"))
2021-03-31 16:57:39 +08:00
DefaultServerConfig = fmt.Sprintf(DefaultServerConfig, port.GenName("Server"))
DefaultClientConfig = fmt.Sprintf(DefaultClientConfig, port.GenName("Server"))
}