Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container run --init verification fixed #18845

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/containers/container_engine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ sub basic_container_tests {
## Test connectivity inside the container
assert_script_run("$runtime container exec basic_test_container curl -sfI https://opensuse.org", fail_message => "cannot reach opensuse.org");

## Test `--init`, i.e. the container process won't be PID 1 (to avoid zombie processes)
# expected output: the `ps` command is not running as PID 1. The $runtime-init process shall be 1 instead.
validate_script_output("$runtime run --rm --init $image ps --no-headers -xo 'pid args'", sub { $_ =~ m/\s*1 .*${runtime}-init .*/ });
## 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 .*/ });
clanig marked this conversation as resolved.
Show resolved Hide resolved
m-dati marked this conversation as resolved.
Show resolved Hide resolved

## Test prune
assert_script_run("$runtime container commit basic_test_container example.com/prune-test");
Expand Down
Loading