mirror of
https://github.com/fatedier/frp.git
synced 2025-07-27 07:35:07 +00:00
add more e2e test (#2505)
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
"text/template"
|
||||
@@ -256,3 +257,10 @@ func (f *Framework) RunServer(portName string, s server.Server) {
|
||||
func (f *Framework) SetEnvs(envs []string) {
|
||||
f.osEnvs = envs
|
||||
}
|
||||
|
||||
func (f *Framework) WriteTempFile(name string, content string) string {
|
||||
filePath := filepath.Join(f.TempDirectory, name)
|
||||
err := ioutil.WriteFile(filePath, []byte(content), 0766)
|
||||
ExpectNoError(err)
|
||||
return filePath
|
||||
}
|
||||
|
@@ -55,6 +55,11 @@ func NewRequestExpect(f *Framework) *RequestExpect {
|
||||
}
|
||||
}
|
||||
|
||||
func (e *RequestExpect) Request(req *request.Request) *RequestExpect {
|
||||
e.req = req
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *RequestExpect) RequestModify(f func(r *request.Request)) *RequestExpect {
|
||||
f(e.req)
|
||||
return e
|
||||
|
Reference in New Issue
Block a user