mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-09-30 13:05:43 +00:00
autoSystemWFP becomes autoSystemWfpBlockLeak, saying that the WFP filters block leaks, and autoSystemDNS becomes autoSystemDnsToGateway, saying where it points the system DNS, so that pointing the system DNS at the gateway on Windows later would fit the same name. Their config fields keep their numbers; neither was released. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
802 B
Go
33 lines
802 B
Go
package conf_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
. "github.com/xtls/xray-core/infra/conf"
|
|
"github.com/xtls/xray-core/proxy/tun"
|
|
)
|
|
|
|
func TestTunConfigAutoSystem(t *testing.T) {
|
|
creator := func() Buildable {
|
|
return new(TunConfig)
|
|
}
|
|
|
|
runMultiTestCase(t, []TestCase{
|
|
{
|
|
Input: `{"name": "xray0"}`,
|
|
Parser: loadJSON(creator),
|
|
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500},
|
|
},
|
|
{
|
|
Input: `{"name": "xray0", "autoSystemDnsToGateway": true}`,
|
|
Parser: loadJSON(creator),
|
|
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500, AutoSystemDnsToGateway: true},
|
|
},
|
|
{
|
|
Input: `{"name": "xray0", "autoSystemWfpBlockLeak": true}`,
|
|
Parser: loadJSON(creator),
|
|
Output: &tun.Config{Name: "xray0", Desc: "Wintun", MTU: 1500, AutoSystemWfpBlockLeak: true},
|
|
},
|
|
})
|
|
}
|