HH-609: fix packaged ACL4SSR providers (#2)
This commit was merged in pull request #2.
This commit is contained in:
@@ -282,16 +282,25 @@ func TestRunStopsServicesWhenRollbackReloadFails(t *testing.T) {
|
||||
}))
|
||||
defer server.Close()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
|
||||
runResult := make(chan error, 1)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
err := Run(ctx, RuntimeConfig{
|
||||
CoreBinary: binary,
|
||||
SSClashBinary: binary,
|
||||
ConfigSource: config,
|
||||
RuntimeDir: filepath.Join(tempDir, "runtime"),
|
||||
SubscriptionURL: server.URL,
|
||||
UpdateInterval: 20 * time.Millisecond,
|
||||
})
|
||||
go func() {
|
||||
runResult <- Run(ctx, RuntimeConfig{
|
||||
CoreBinary: binary,
|
||||
SSClashBinary: binary,
|
||||
ConfigSource: config,
|
||||
RuntimeDir: filepath.Join(tempDir, "runtime"),
|
||||
SubscriptionURL: server.URL,
|
||||
UpdateInterval: 20 * time.Millisecond,
|
||||
})
|
||||
}()
|
||||
var err error
|
||||
select {
|
||||
case err = <-runResult:
|
||||
case <-time.After(5 * time.Second):
|
||||
t.Fatal("Run() did not reach rollback failure")
|
||||
}
|
||||
if !errors.Is(err, errMihomoStateUncertain) {
|
||||
t.Fatalf("Run() error = %v, want uncertain Mihomo state", err)
|
||||
}
|
||||
|
||||
@@ -52,6 +52,12 @@ func TestSeededConfigUsesLocalACL4SSRRulesAndMemorySubscription(t *testing.T) {
|
||||
"RULE-SET,BanAD,🛑 广告拦截",
|
||||
"RULE-SET,ProxyGFWlist,🚀 节点选择",
|
||||
"MATCH,🐟 漏网之鱼",
|
||||
"GoogleCN: {type: file, behavior: classical, format: yaml, path: /usr/local/share/ssclash/rules/Ruleset/GoogleCN.yaml}",
|
||||
"Bing: {type: file, behavior: classical, format: yaml, path: /usr/local/share/ssclash/rules/Ruleset/Bing.yaml}",
|
||||
"OneDrive: {type: file, behavior: classical, format: yaml, path: /usr/local/share/ssclash/rules/Ruleset/OneDrive.yaml}",
|
||||
"Microsoft: {type: file, behavior: classical, format: yaml, path: /usr/local/share/ssclash/rules/Ruleset/Microsoft.yaml}",
|
||||
"Telegram: {type: file, behavior: classical, format: yaml, path: /usr/local/share/ssclash/rules/Ruleset/Telegram.yaml}",
|
||||
"ChinaCompanyIp: {type: file, behavior: ipcidr, format: yaml, path: /usr/local/share/ssclash/rules/ChinaCompanyIp.yaml}",
|
||||
} {
|
||||
if !strings.Contains(config, required) {
|
||||
t.Errorf("seeded config is missing %q", required)
|
||||
|
||||
Reference in New Issue
Block a user