Fix tests

This commit is contained in:
世界
2024-11-17 16:59:25 +08:00
parent 9f76087503
commit 697c81f097
29 changed files with 334 additions and 279 deletions

View File

@@ -101,10 +101,10 @@ func testShadowsocksInboundWithShadowsocksRust(t *testing.T, method string, pass
Cmd: []string{"-s", F.ToString("127.0.0.1:", serverPort), "-b", F.ToString("0.0.0.0:", clientPort), "-m", method, "-k", password, "-U"},
})
startInstance(t, option.Options{
LegacyInbounds: []option.LegacyInbound{
Inbounds: []option.Inbound{
{
Type: C.TypeShadowsocks,
ShadowsocksOptions: option.ShadowsocksInboundOptions{
Options: &option.ShadowsocksInboundOptions{
ListenOptions: option.ListenOptions{
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: serverPort,
@@ -126,10 +126,10 @@ func testShadowsocksOutboundWithShadowsocksRust(t *testing.T, method string, pas
Cmd: []string{"-s", F.ToString("0.0.0.0:", serverPort), "-m", method, "-k", password, "-U"},
})
startInstance(t, option.Options{
LegacyInbounds: []option.LegacyInbound{
Inbounds: []option.Inbound{
{
Type: C.TypeMixed,
MixedOptions: option.HTTPMixedInboundOptions{
Options: &option.HTTPMixedInboundOptions{
ListenOptions: option.ListenOptions{
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: clientPort,
@@ -137,10 +137,10 @@ func testShadowsocksOutboundWithShadowsocksRust(t *testing.T, method string, pas
},
},
},
LegacyOutbounds: []option.LegacyOutbound{
Outbounds: []option.Outbound{
{
Type: C.TypeShadowsocks,
ShadowsocksOptions: option.ShadowsocksOutboundOptions{
Options: &option.ShadowsocksOutboundOptions{
ServerOptions: option.ServerOptions{
Server: "127.0.0.1",
ServerPort: serverPort,
@@ -156,11 +156,11 @@ func testShadowsocksOutboundWithShadowsocksRust(t *testing.T, method string, pas
func testShadowsocksSelf(t *testing.T, method string, password string) {
startInstance(t, option.Options{
LegacyInbounds: []option.LegacyInbound{
Inbounds: []option.Inbound{
{
Type: C.TypeMixed,
Tag: "mixed-in",
MixedOptions: option.HTTPMixedInboundOptions{
Options: &option.HTTPMixedInboundOptions{
ListenOptions: option.ListenOptions{
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: clientPort,
@@ -169,7 +169,7 @@ func testShadowsocksSelf(t *testing.T, method string, password string) {
},
{
Type: C.TypeShadowsocks,
ShadowsocksOptions: option.ShadowsocksInboundOptions{
Options: &option.ShadowsocksInboundOptions{
ListenOptions: option.ListenOptions{
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: serverPort,
@@ -179,14 +179,14 @@ func testShadowsocksSelf(t *testing.T, method string, password string) {
},
},
},
LegacyOutbounds: []option.LegacyOutbound{
Outbounds: []option.Outbound{
{
Type: C.TypeDirect,
},
{
Type: C.TypeShadowsocks,
Tag: "ss-out",
ShadowsocksOptions: option.ShadowsocksOutboundOptions{
Options: &option.ShadowsocksOutboundOptions{
ServerOptions: option.ServerOptions{
Server: "127.0.0.1",
ServerPort: serverPort,
@@ -223,11 +223,11 @@ func TestShadowsocksUoT(t *testing.T) {
method := shadowaead_2022.List[0]
password := mkBase64(t, 16)
startInstance(t, option.Options{
LegacyInbounds: []option.LegacyInbound{
Inbounds: []option.Inbound{
{
Type: C.TypeMixed,
Tag: "mixed-in",
MixedOptions: option.HTTPMixedInboundOptions{
Options: &option.HTTPMixedInboundOptions{
ListenOptions: option.ListenOptions{
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: clientPort,
@@ -236,7 +236,7 @@ func TestShadowsocksUoT(t *testing.T) {
},
{
Type: C.TypeShadowsocks,
ShadowsocksOptions: option.ShadowsocksInboundOptions{
Options: &option.ShadowsocksInboundOptions{
ListenOptions: option.ListenOptions{
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: serverPort,
@@ -246,14 +246,14 @@ func TestShadowsocksUoT(t *testing.T) {
},
},
},
LegacyOutbounds: []option.LegacyOutbound{
Outbounds: []option.Outbound{
{
Type: C.TypeDirect,
},
{
Type: C.TypeShadowsocks,
Tag: "ss-out",
ShadowsocksOptions: option.ShadowsocksOutboundOptions{
Options: &option.ShadowsocksOutboundOptions{
ServerOptions: option.ServerOptions{
Server: "127.0.0.1",
ServerPort: serverPort,
@@ -291,11 +291,11 @@ func TestShadowsocksUoT(t *testing.T) {
func testShadowsocks2022EIH(t *testing.T, method string, password string) {
startInstance(t, option.Options{
LegacyInbounds: []option.LegacyInbound{
Inbounds: []option.Inbound{
{
Type: C.TypeMixed,
Tag: "mixed-in",
MixedOptions: option.HTTPMixedInboundOptions{
Options: &option.HTTPMixedInboundOptions{
ListenOptions: option.ListenOptions{
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: clientPort,
@@ -304,7 +304,7 @@ func testShadowsocks2022EIH(t *testing.T, method string, password string) {
},
{
Type: C.TypeShadowsocks,
ShadowsocksOptions: option.ShadowsocksInboundOptions{
Options: &option.ShadowsocksInboundOptions{
ListenOptions: option.ListenOptions{
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: serverPort,
@@ -319,14 +319,14 @@ func testShadowsocks2022EIH(t *testing.T, method string, password string) {
},
},
},
LegacyOutbounds: []option.LegacyOutbound{
Outbounds: []option.Outbound{
{
Type: C.TypeDirect,
},
{
Type: C.TypeShadowsocks,
Tag: "ss-out",
ShadowsocksOptions: option.ShadowsocksOutboundOptions{
Options: &option.ShadowsocksOutboundOptions{
ServerOptions: option.ServerOptions{
Server: "127.0.0.1",
ServerPort: serverPort,