Skip to content

Conversation

@kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Oct 18, 2025

This is the second part of tests/integration cleanup I wanted to do for quite some time.
For the first part, see #4945.

  1. Improve runc wrapper

    1. Add status check support (same as in bats' run helper).

    2. Add PRE_CMD support (so we can use commands like taskset or timeout).

    3. Drop sane_helper since the output of the command is shown in case of
      an error, and we show the command itself in runc wrapper (unless -N
      or ! is provided -- in this case the command is shown by bats,
      together with the error). This does not show the output of successful
      commands which IMO is a net positive since we are almost always
      interested in failed command output only.

    4. Use the new functionality in cpu_affinity.bats and start.bats as a
      showcase (the test of refactoring is in a separate commit).

  2. refactor to use runc status checks

  3. add missing runc status checks

@kolyshkin
Copy link
Contributor Author

CI failure in almalinux9 is a known flake #4437. Restarted.

@kolyshkin
Copy link
Contributor Author

Now we do:

runc start foo
[ $status -eq 0 ]

and runc hides a call to run.

With this PR, we now do

runc -0 start foo

I.e. we still hide run inside but allow runc to accept some of run options (-N and ! for now).

The alternative to that is use run explicitly:

run -0 runc start foo

I am open to any suggestions.

1. Add status check support (same as in bats' run helper).

2. Add RUNC_PRE_CMD support (so we can use commands like taskset or
   timeout).

3. Drop sane_helper since the output of the command is shown in case of
   an error, and we show the command itself in runc wrapper (unless -N
   or ! is provided -- in this case the command is shown by bats,
   together with the error). This does not show the output of successful
   commands which IMO is a net positive since we are almost always
   interested in failed command output only.

4. Use the new functionality in cpu_affinity.bats and start.bats as a
   showcase (the test of refactoring is in a separate commit).

Signed-off-by: Kir Kolyshkin <[email protected]>
These places should check runc exit code but they don't.

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin kolyshkin marked this pull request as ready for review October 26, 2025 22:21
@kolyshkin kolyshkin requested review from cyphar, lifubang and rata and removed request for rata October 26, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant