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

@@ -13,11 +13,11 @@ import (
func TestHysteriaSelf(t *testing.T) {
_, certPem, keyPem := createSelfSignedCertificate(t, "example.org")
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,
@@ -26,7 +26,7 @@ func TestHysteriaSelf(t *testing.T) {
},
{
Type: C.TypeHysteria,
HysteriaOptions: option.HysteriaInboundOptions{
Options: &option.HysteriaInboundOptions{
ListenOptions: option.ListenOptions{
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: serverPort,
@@ -48,14 +48,14 @@ func TestHysteriaSelf(t *testing.T) {
},
},
},
LegacyOutbounds: []option.LegacyOutbound{
Outbounds: []option.Outbound{
{
Type: C.TypeDirect,
},
{
Type: C.TypeHysteria,
Tag: "hy-out",
HysteriaOptions: option.HysteriaOutboundOptions{
Options: &option.HysteriaOutboundOptions{
ServerOptions: option.ServerOptions{
Server: "127.0.0.1",
ServerPort: serverPort,
@@ -100,10 +100,10 @@ func TestHysteriaSelf(t *testing.T) {
func TestHysteriaInbound(t *testing.T) {
caPem, certPem, keyPem := createSelfSignedCertificate(t, "example.org")
startInstance(t, option.Options{
LegacyInbounds: []option.LegacyInbound{
Inbounds: []option.Inbound{
{
Type: C.TypeHysteria,
HysteriaOptions: option.HysteriaInboundOptions{
Options: &option.HysteriaInboundOptions{
ListenOptions: option.ListenOptions{
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
ListenPort: serverPort,
@@ -151,10 +151,10 @@ func TestHysteriaOutbound(t *testing.T) {
},
})
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,
@@ -162,10 +162,10 @@ func TestHysteriaOutbound(t *testing.T) {
},
},
},
LegacyOutbounds: []option.LegacyOutbound{
Outbounds: []option.Outbound{
{
Type: C.TypeHysteria,
HysteriaOptions: option.HysteriaOutboundOptions{
Options: &option.HysteriaOutboundOptions{
ServerOptions: option.ServerOptions{
Server: "127.0.0.1",
ServerPort: serverPort,