Fix process stability checks in containers

This commit is contained in:
ushan0v
2026-07-14 01:04:37 +03:00
parent 40848660fa
commit c60ce8179b
2 changed files with 42 additions and 14 deletions
+10
View File
@@ -126,6 +126,16 @@ assert_eq "0" \
"$(state_ucode sing-box-reload-previous-pid-fixture missing old new)" \
"missing sing-box PID replacement constraint"
assert_eq "8" \
"$(state_ucode process-age-seconds-fixture 786161359 786162159)" \
"process age on a shared kernel tick scale"
if state_ucode process-age-seconds-fixture 786162159 786161359 >/dev/null 2>&1; then
fail "process age must reject a current tick value older than the process"
fi
if sed -n '/^function process_age_seconds(pid) {$/,/^}$/p' "$STATE_UC" | grep -Fq '/proc/uptime'; then
fail "process age must not mix process start ticks with virtualized /proc/uptime"
fi
mkdir -p "$WORK_DIR/stable-start-bin"
cp "$(command -v sleep)" "$WORK_DIR/stable-start-bin/sing-box"
cat >"$WORK_DIR/stable-start-bin/ubus" <<'SH'