mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-01 16:44:23 +08:00
💐 Sync 2026-10-01 01:11:54
This commit is contained in:
1 parent
8f2ec5c4da
commit
2909cae209
44 files changed
+1092
-2287
No files matched your search
@@ -378,29 +378,5 @@ reset_samples
|
||||
hp_wait_instance "sing-box-c" "$CFG" 1
|
||||
expect "wait_instance (compat): times out when down" "$?" "1"
|
||||
|
||||
# A reload that regenerates identical bytes must not restart the instances:
|
||||
# service_triggers() reloads on every `interface.*.up` for wan, so a flapping
|
||||
# link used to interrupt every connection for a configuration that had not
|
||||
# changed. hp_config_changed() is the decision, and it is pure shell.
|
||||
printf 'configuration one\n' > "$WORK/live.json"
|
||||
DIGEST="$(hp_file_digest "$WORK/live.json")"
|
||||
expect "digest is stable" "$(hp_file_digest "$WORK/live.json")" "$DIGEST"
|
||||
|
||||
hp_config_changed "$WORK/live.json" "$DIGEST" && RC=1 || RC=0
|
||||
expect "an identical file is not a change" "$RC" "0"
|
||||
|
||||
printf 'configuration two\n' > "$WORK/live.json"
|
||||
hp_config_changed "$WORK/live.json" "$DIGEST" && RC=1 || RC=0
|
||||
expect "a rewritten file is a change" "$RC" "1"
|
||||
|
||||
hp_config_changed "$WORK/missing.json" "$DIGEST" && RC=1 || RC=0
|
||||
expect "a missing live file is a change" "$RC" "1"
|
||||
|
||||
hp_config_changed "$WORK/live.json" "" && RC=1 || RC=0
|
||||
expect "nothing to compare against is a change" "$RC" "1"
|
||||
|
||||
: > "$WORK/empty.json"
|
||||
expect "an empty file has no digest" "$(hp_file_digest "$WORK/empty.json")" ""
|
||||
|
||||
printf '%d checks, %d failures\n' "$CHECKS" "$FAILURES"
|
||||
exit $FAILED
|
||||
@@ -242,22 +242,6 @@ expect "an unusable dns_port does not restart dnsmasq" "$(restart_count)" "$GOOD
|
||||
expect "an unusable dns_port is reported in the log" \
|
||||
"$(grep -c 'dns_port' "$LOG")" "1"
|
||||
|
||||
echo
|
||||
echo "== proxy_mainland_china: every query goes to sing-box =="
|
||||
|
||||
# This mode used to expand china_list.txt (111353 domains in the bundled list)
|
||||
# into one `server=` line each, which measured at about 25 MB of dnsmasq RSS on
|
||||
# a real device (1.0 MB empty, 27.2 MB with the list) for no behavioural
|
||||
# difference: the mode's dns.final is default-dns, the WAN resolver, so a
|
||||
# mainland domain resolves through the ISP either way.
|
||||
run "proxy_mainland_china"
|
||||
expect "proxy_mainland_china installs the global redirect snippet" \
|
||||
"$(exists "$DNS_DIR/redirect-dns.conf")" "yes"
|
||||
expect "proxy_mainland_china no longer expands china_list.txt" \
|
||||
"$(exists "$DNS_DIR/china_list.conf")" "no"
|
||||
expect "the redirect snippet points at sing-box" \
|
||||
"$(grep -c "server=127.0.0.1#" "$DNS_DIR/redirect-dns.conf")" "1"
|
||||
|
||||
echo
|
||||
printf '%s checks, %s failures\n' "$CHECKS" "$FAILURES"
|
||||
if [ "$FAILED" != 0 ]; then
|
||||
|
||||
Reference in new issue
Block a user