From d461e240fba4a8612e3840c83b8a40606a3c9125 Mon Sep 17 00:00:00 2001 From: phoenix Date: Mon, 11 Mar 2024 09:18:50 +0100 Subject: [PATCH] Re-introduce PID 1 test Re-introduce the check for ps not running as PID 1. --- tests/containers/container_engine.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/containers/container_engine.pm b/tests/containers/container_engine.pm index 29b441812ee4..902eb8ca4492 100644 --- a/tests/containers/container_engine.pm +++ b/tests/containers/container_engine.pm @@ -95,6 +95,8 @@ sub basic_container_tests { ## Test `--init` option, i.e. the container process won't be PID 1 (to avoid zombie processes) # Ensure PID 1 has either the $runtime-init (e.g. podman-init) OR /init (e.g. `/dev/init) suffix validate_script_output("$runtime run --rm --init $image ps --no-headers -xo 'pid args'", sub { $_ =~ m/\s*1 .*(${runtime}-|\/)init .*/ }); + # Ensure the `ps` command is not running as PID 1. either + validate_script_output("$runtime run --rm --init $image ps --no-headers -xo 'pid args'", sub { $_ =~ m/[02-9][0-9]* .*ps.*/ }); ## Test prune assert_script_run("$runtime container commit basic_test_container example.com/prune-test");