mirror of
https://github.com/alireza0/s-ui.git
synced 2026-10-21 19:32:45 +00:00
core: cover the new 1.14 protocols with config tests
Starts snell v5 and v6 inbounds, a snell outbound and an oom-killer service; bridge gets construct-only coverage since creating its tun needs privileges. Also bumps the frontend submodule to the UI for these protocols.
This commit is contained in:
parent
2a0a240ecd
commit
a5c6102359
4 changed files with 71 additions and 7 deletions
|
|
@ -125,13 +125,15 @@ func TestConfigCompat(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TestConfigCompatClean asserts that the post-migration shapes produced by
|
||||
// database.migrateSingBox114 start without any deprecation warning, so the
|
||||
// migration is known to actually resolve what it claims to.
|
||||
// TestConfigCompatClean builds each config in testdata/clean and asserts it
|
||||
// raises no deprecation warning. It covers the post-migration shapes produced
|
||||
// by database.migrateSingBox114, so the migration is known to actually resolve
|
||||
// what it claims to.
|
||||
//
|
||||
// These configs are only constructed, not started: an ACME provider would try
|
||||
// to reach Let's Encrypt on start. Every deprecation these shapes could raise
|
||||
// is reported while the box is being built.
|
||||
// These configs are built but not started, which is what lets them cover cases
|
||||
// TestConfigCompat cannot: an ACME provider would reach out to Let's Encrypt on
|
||||
// start, and a bridge outbound needs privileges to create its tun. Every
|
||||
// deprecation these shapes could raise is reported while the box is built.
|
||||
func TestConfigCompatClean(t *testing.T) {
|
||||
acmeDir := t.TempDir()
|
||||
cacheDir := t.TempDir()
|
||||
|
|
|
|||
16
core/testdata/clean/bridge.json
vendored
Normal file
16
core/testdata/clean/bridge.json
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"log": {
|
||||
"level": "error"
|
||||
},
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "direct",
|
||||
"tag": "direct"
|
||||
},
|
||||
{
|
||||
"type": "bridge",
|
||||
"tag": "bridge-out",
|
||||
"bridge_name": "sing-bridge"
|
||||
}
|
||||
]
|
||||
}
|
||||
46
core/testdata/configs/11-new-protocols.json
vendored
Normal file
46
core/testdata/configs/11-new-protocols.json
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"log": {
|
||||
"level": "error"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"type": "snell",
|
||||
"tag": "snell-v6-in",
|
||||
"listen": "127.0.0.1",
|
||||
"listen_port": 42101,
|
||||
"version": 6,
|
||||
"psk": "snell-pre-shared-key",
|
||||
"mode": "default"
|
||||
},
|
||||
{
|
||||
"type": "snell",
|
||||
"tag": "snell-v5-in",
|
||||
"listen": "127.0.0.1",
|
||||
"listen_port": 42102,
|
||||
"version": 5,
|
||||
"psk": "snell-pre-shared-key",
|
||||
"obfs_mode": "http"
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "direct",
|
||||
"tag": "direct"
|
||||
},
|
||||
{
|
||||
"type": "snell",
|
||||
"tag": "snell-out",
|
||||
"server": "127.0.0.1",
|
||||
"server_port": 42101,
|
||||
"version": 6,
|
||||
"psk": "snell-pre-shared-key"
|
||||
}
|
||||
],
|
||||
"services": [
|
||||
{
|
||||
"type": "oom-killer",
|
||||
"tag": "oom",
|
||||
"memory_limit": "1gb"
|
||||
}
|
||||
]
|
||||
}
|
||||
2
frontend
2
frontend
|
|
@ -1 +1 @@
|
|||
Subproject commit 5d44a115504f465b937e43b4c5a79445846a4e85
|
||||
Subproject commit 8a92bc920d501f73f6927eca6a1dd8ca73e895a9
|
||||
Loading…
Add table
Add a link
Reference in a new issue