Skip to content

Commit

Permalink
Merge pull request #18845 from m-dati/validate_init_fix_2
Browse files Browse the repository at this point in the history
Container run --init verification fixed
  • Loading branch information
grisu48 authored Mar 11, 2024
2 parents 11b189c + a41cf53 commit 21b4a94
Showing 1 changed file with 3 additions and 3 deletions.
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 .*/ });

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

0 comments on commit 21b4a94

Please sign in to comment.