mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-07 05:47:36 +03:00
Fix tests
This commit is contained in:
parent
06a487393d
commit
594f9085e2
29 changed files with 522 additions and 441 deletions
|
@ -6,19 +6,21 @@ import (
|
|||
|
||||
C "github.com/sagernet/sing-box/constant"
|
||||
"github.com/sagernet/sing-box/option"
|
||||
"github.com/sagernet/sing/common"
|
||||
"github.com/sagernet/sing/common/auth"
|
||||
"github.com/sagernet/sing/common/json/badoption"
|
||||
"github.com/sagernet/sing/common/network"
|
||||
)
|
||||
|
||||
func TestNaiveInboundWithNginx(t *testing.T) {
|
||||
caPem, certPem, keyPem := createSelfSignedCertificate(t, "example.org")
|
||||
startInstance(t, option.Options{
|
||||
Inbounds: []option.LegacyInbound{
|
||||
Inbounds: []option.Inbound{
|
||||
{
|
||||
Type: C.TypeNaive,
|
||||
NaiveOptions: option.NaiveInboundOptions{
|
||||
Options: &option.NaiveInboundOptions{
|
||||
ListenOptions: option.ListenOptions{
|
||||
Listen: option.NewListenAddress(netip.IPv4Unspecified()),
|
||||
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
|
||||
ListenPort: otherPort,
|
||||
},
|
||||
Users: []auth.User{
|
||||
|
@ -59,12 +61,12 @@ func TestNaiveInboundWithNginx(t *testing.T) {
|
|||
func TestNaiveInbound(t *testing.T) {
|
||||
caPem, certPem, keyPem := createSelfSignedCertificate(t, "example.org")
|
||||
startInstance(t, option.Options{
|
||||
Inbounds: []option.LegacyInbound{
|
||||
Inbounds: []option.Inbound{
|
||||
{
|
||||
Type: C.TypeNaive,
|
||||
NaiveOptions: option.NaiveInboundOptions{
|
||||
Options: &option.NaiveInboundOptions{
|
||||
ListenOptions: option.ListenOptions{
|
||||
Listen: option.NewListenAddress(netip.IPv4Unspecified()),
|
||||
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
|
||||
ListenPort: serverPort,
|
||||
},
|
||||
Users: []auth.User{
|
||||
|
@ -103,12 +105,12 @@ func TestNaiveInbound(t *testing.T) {
|
|||
func TestNaiveHTTP3Inbound(t *testing.T) {
|
||||
caPem, certPem, keyPem := createSelfSignedCertificate(t, "example.org")
|
||||
startInstance(t, option.Options{
|
||||
Inbounds: []option.LegacyInbound{
|
||||
Inbounds: []option.Inbound{
|
||||
{
|
||||
Type: C.TypeNaive,
|
||||
NaiveOptions: option.NaiveInboundOptions{
|
||||
Options: &option.NaiveInboundOptions{
|
||||
ListenOptions: option.ListenOptions{
|
||||
Listen: option.NewListenAddress(netip.IPv4Unspecified()),
|
||||
Listen: common.Ptr(badoption.Addr(netip.IPv4Unspecified())),
|
||||
ListenPort: serverPort,
|
||||
},
|
||||
Users: []auth.User{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue