mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-28 13:05:28 -05:00
more test cases
This commit is contained in:
@@ -24,10 +24,30 @@ import (
|
||||
_ "github.com/v2ray/v2ray-core/proxy/vmess/config/json"
|
||||
)
|
||||
|
||||
var (
|
||||
serverup = make(map[string]bool)
|
||||
)
|
||||
|
||||
func TestFile(filename string) string {
|
||||
return filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "v2ray", "v2ray-core", "testing", "scenarios", "data", filename)
|
||||
}
|
||||
|
||||
func InitializeServerSetOnce(testcase string) error {
|
||||
if up, found := serverup[testcase]; found && up {
|
||||
return nil
|
||||
}
|
||||
err := InitializeServer(TestFile(testcase + "_server.json"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = InitializeServer(TestFile(testcase + "_client.json"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
serverup[testcase] = true
|
||||
return nil
|
||||
}
|
||||
|
||||
func InitializeServer(configFile string) error {
|
||||
config, err := jsonconf.LoadConfig(configFile)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user