mirror of
https://github.com/fatedier/frp.git
synced 2025-07-27 07:35:07 +00:00
add e2e tests for v1 config (#3608)
This commit is contained in:
@@ -18,12 +18,23 @@ var (
|
||||
PortClientAdmin string
|
||||
|
||||
DefaultServerConfig = `
|
||||
bindPort = {{ .%s }}
|
||||
log.level = "trace"
|
||||
`
|
||||
|
||||
DefaultClientConfig = `
|
||||
serverAddr = "127.0.0.1"
|
||||
serverPort = {{ .%s }}
|
||||
log.level = "trace"
|
||||
`
|
||||
|
||||
LegacyDefaultServerConfig = `
|
||||
[common]
|
||||
bind_port = {{ .%s }}
|
||||
log_level = trace
|
||||
`
|
||||
|
||||
DefaultClientConfig = `
|
||||
LegacyDefaultClientConfig = `
|
||||
[common]
|
||||
server_addr = 127.0.0.1
|
||||
server_port = {{ .%s }}
|
||||
@@ -34,6 +45,9 @@ var (
|
||||
func init() {
|
||||
PortServerName = port.GenName("Server")
|
||||
PortClientAdmin = port.GenName("ClientAdmin")
|
||||
LegacyDefaultServerConfig = fmt.Sprintf(LegacyDefaultServerConfig, port.GenName("Server"))
|
||||
LegacyDefaultClientConfig = fmt.Sprintf(LegacyDefaultClientConfig, port.GenName("Server"))
|
||||
|
||||
DefaultServerConfig = fmt.Sprintf(DefaultServerConfig, port.GenName("Server"))
|
||||
DefaultClientConfig = fmt.Sprintf(DefaultClientConfig, port.GenName("Server"))
|
||||
}
|
||||
|
@@ -29,7 +29,10 @@ func (f *Framework) RunProcesses(serverTemplates []string, clientTemplates []str
|
||||
path := filepath.Join(f.TempDirectory, fmt.Sprintf("frp-e2e-server-%d", i))
|
||||
err = os.WriteFile(path, []byte(outs[i]), 0o666)
|
||||
ExpectNoError(err)
|
||||
flog.Trace("[%s] %s", path, outs[i])
|
||||
|
||||
if TestContext.Debug {
|
||||
flog.Debug("[%s] %s", path, outs[i])
|
||||
}
|
||||
|
||||
p := process.NewWithEnvs(TestContext.FRPServerPath, []string{"-c", path}, f.osEnvs)
|
||||
f.serverConfPaths = append(f.serverConfPaths, path)
|
||||
@@ -46,7 +49,10 @@ func (f *Framework) RunProcesses(serverTemplates []string, clientTemplates []str
|
||||
path := filepath.Join(f.TempDirectory, fmt.Sprintf("frp-e2e-client-%d", i))
|
||||
err = os.WriteFile(path, []byte(outs[index]), 0o666)
|
||||
ExpectNoError(err)
|
||||
flog.Trace("[%s] %s", path, outs[index])
|
||||
|
||||
if TestContext.Debug {
|
||||
flog.Debug("[%s] %s", path, outs[index])
|
||||
}
|
||||
|
||||
p := process.NewWithEnvs(TestContext.FRPClientPath, []string{"-c", path}, f.osEnvs)
|
||||
f.clientConfPaths = append(f.clientConfPaths, path)
|
||||
|
Reference in New Issue
Block a user