mirror of
https://github.com/fatedier/frp.git
synced 2025-07-27 07:35:07 +00:00
support range ports mapping by go template (#4073)
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
package framework
|
||||
|
||||
type FRPClient struct {
|
||||
port int
|
||||
}
|
||||
import (
|
||||
clientsdk "github.com/fatedier/frp/pkg/sdk/client"
|
||||
)
|
||||
|
||||
func (f *Framework) FRPClient(port int) *FRPClient {
|
||||
return &FRPClient{
|
||||
port: port,
|
||||
}
|
||||
func (f *Framework) APIClientForFrpc(port int) *clientsdk.Client {
|
||||
return clientsdk.New("127.0.0.1", port)
|
||||
}
|
||||
|
@@ -43,6 +43,10 @@ func ExpectNoErrorWithOffset(offset int, err error, explain ...interface{}) {
|
||||
gomega.ExpectWithOffset(1+offset, err).NotTo(gomega.HaveOccurred(), explain...)
|
||||
}
|
||||
|
||||
func ExpectContainSubstring(actual, substr string, explain ...interface{}) {
|
||||
gomega.ExpectWithOffset(1, actual).To(gomega.ContainSubstring(substr), explain...)
|
||||
}
|
||||
|
||||
// ExpectConsistOf expects actual contains precisely the extra elements. The ordering of the elements does not matter.
|
||||
func ExpectConsistOf(actual interface{}, extra interface{}, explain ...interface{}) {
|
||||
gomega.ExpectWithOffset(1, actual).To(gomega.ConsistOf(extra), explain...)
|
||||
|
@@ -217,7 +217,7 @@ func (f *Framework) RenderTemplates(templates []string) (outs []string, ports ma
|
||||
}
|
||||
|
||||
for _, t := range templates {
|
||||
tmpl, err := template.New("").Parse(t)
|
||||
tmpl, err := template.New("frp-e2e").Parse(t)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user