





















@@ -255,6 +255,95 @@ fi
255255}
256256});
257257258+it("cleans generated package mounts after harness Docker runs", () => {
259+const workDir = mkdtempSync(join(tmpdir(), "openclaw-docker-package-mount-cleanup-"));
260+261+try {
262+const rootDir = process.cwd();
263+const script = `
264+set -euo pipefail
265+ROOT_DIR=${shellQuote(rootDir)}
266+TMPDIR=${shellQuote(workDir)}
267+export ROOT_DIR TMPDIR
268+269+node() {
270+ local script="$1"
271+ shift
272+ if [[ "$script" != "$ROOT_DIR/scripts/package-openclaw-for-docker.mjs" ]]; then
273+ command node "$script" "$@"
274+ return
275+ fi
276+277+ local output_dir=""
278+ local output_name=""
279+ while [[ $# -gt 0 ]]; do
280+ case "$1" in
281+ --output-dir)
282+ output_dir="$2"
283+ shift 2
284+ ;;
285+ --output-name)
286+ output_name="$2"
287+ shift 2
288+ ;;
289+ *)
290+ shift
291+ ;;
292+ esac
293+ done
294+295+ mkdir -p "$output_dir"
296+ printf fixture >"$output_dir/$output_name"
297+ printf "%s\\n" "$output_dir/$output_name"
298+}
299+export -f node
300+301+source "$ROOT_DIR/scripts/lib/docker-e2e-package.sh"
302+303+docker() {
304+ local mount_path=""
305+ local expect_volume_path=0
306+ local arg
307+ for arg in "$@"; do
308+ if [[ "$expect_volume_path" == "1" ]]; then
309+ mount_path="\${arg%%:*}"
310+ expect_volume_path=0
311+ continue
312+ fi
313+ if [[ "$arg" == "-v" ]]; then
314+ expect_volume_path=1
315+ fi
316+ done
317+318+ test -n "$mount_path"
319+ test -f "$mount_path"
320+ printf "%s\\n" "$mount_path" >"$TMPDIR/package-mount-seen"
321+ return "\${DOCKER_STUB_STATUS:-0}"
322+}
323+export -f docker
324+325+package_tgz="$(docker_e2e_prepare_package_tgz mount-cleanup)"
326+pack_dir="$(dirname "$package_tgz")"
327+docker_e2e_package_mount_args "$package_tgz"
328+DOCKER_STUB_STATUS=7 docker_e2e_run_with_harness image-name bash -lc true || run_status="$?"
329+test "\${run_status:-0}" = "7"
330+test -f "$TMPDIR/package-mount-seen"
331+test ! -e "$pack_dir"
332+333+external_dir="$TMPDIR/external-package"
334+mkdir -p "$external_dir"
335+printf fixture >"$external_dir/openclaw-current.tgz"
336+docker_e2e_package_mount_args "$external_dir/openclaw-current.tgz"
337+docker_e2e_run_with_harness image-name bash -lc true
338+test -f "$external_dir/openclaw-current.tgz"
339+`;
340+341+execFileSync("bash", ["-lc", script], { encoding: "utf8" });
342+} finally {
343+rmSync(workDir, { recursive: true, force: true });
344+}
345+});
346+258347it("includes procps in the shared Docker E2E image for process watchdogs", () => {
259348const dockerfile = readFileSync("scripts/e2e/Dockerfile", "utf8");
260349此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。