Skip to content

[1.5] tests/int: make "run runc" work, add assert helpers - #5590

Merged
kolyshkin merged 2 commits into
opencontainers:release-1.5from
kolyshkin:1.5-new-style-tests
Nov 2, 2026
Merged

kolyshkin merged 2 commits into
opencontainers:release-1.5from
kolyshkin:1.5-new-style-tests

Conversation

@kolyshkin

@kolyshkin kolyshkin commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Since we've changed the way we call runc in main branch integration tests (see #5429), the backports from the main branch to 1.5 will have issues with tests. One such example is recently merged #5590, which has this:

run -0 runc run test_host_mntns

Looks fine but in fact runc exit code is actually ignored (because in release-1.5 runc is a wrapper which uses run, which returns 0).

One solution would be to backport #5429 but it's a massive change. This is an alternative, doing two things:

  1. adding a kludge to runc wrapper to fix the issue described above;
  2. backporting assert* helpers from main.

This is quite minimal (I would even say elegant) and allows for worry-free test backporting.

When a test fails on a string comparison, all we see is the failed
expression, which usually means adding some debug output and rerunning
the test to find out what the actual value was.

The bats-assert library solves this, but it (together with its
bats-support dependency) has to be installed separately on every distro
we test on, which is more trouble than it's worth for a few functions.

Add assert_output, refute_output, and assert_line, implementing a subset
of the bats-assert API (so that the tests read the same way, and this
code can be dropped should bats-assert ever be added as a dependency),
and use them for the comparisons against an exact value. Now, when such
a check fails, the test log shows what was expected and what was there:

	-- output does not match (exact) --
	expected: '/override'
	  actual: $'\0/override'
	--

[This is a partial backport: only the helpers are added, the existing
tests are not converted to use them.]

(cherry picked from commit 2c7405b)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
In main branch, runc is no longer a bash function wrapping bats' run,
and tests call it as

	run -0 runc ...

In this branch, the same code results in a nested run, and the outer
run checks the exit status of the inner one (always 0), not of runc.
So, a test backported from main as is checks nothing, and a failure
like "run ! runc ..." is reported for a runc call that actually failed.

Make runc wrapper call runc directly when called via run, so that the
tests written in either style work as expected.

Assisted-by: Claude Opus 5.5
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin

Copy link
Copy Markdown
Contributor Author

To clarify: with this, both old style (runc ...) and new style (run -N runc ... etc.) tests work as expected, as well as new assert helpers.

@kolyshkin kolyshkin added this to the 1.5.3 milestone Oct 29, 2026
@kolyshkin
kolyshkin requested review from AkihiroSuda, cyphar, lifubang, rata and thaJeztah and removed request for thaJeztah October 29, 2026 09:01

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable to me (agreed back porting the whole would be rather large)

LGTM

@kolyshkin

Copy link
Copy Markdown
Contributor Author

This needs a second LGTM and will unblock porting #5588 to release-1.5; PTAL @opencontainers/runc-maintainers 🙏

@kolyshkin
kolyshkin added this pull request to the merge queue Nov 2, 2026
Merged via the queue into opencontainers:release-1.5 with commit eeb30e2 Nov 2, 2026
58 checks passed
Maks1mS pushed a commit to stplr-dev/stplr that referenced this pull request Nov 14, 2026
This PR contains the following updates:

| Package | Type | Update | Change | OpenSSF |
|---|---|---|---|---|
| [github.com/opencontainers/runc](https://github.com/opencontainers/runc) | require | patch | `v1.5.2` → `v1.5.3` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/opencontainers/runc/badge)](https://securityscorecards.dev/viewer/?uri=github.com/opencontainers/runc) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/23) for more information.

---

### Release Notes

<details>
<summary>opencontainers/runc (github.com/opencontainers/runc)</summary>

### [`v1.5.3`](https://github.com/opencontainers/runc/releases/tag/v1.5.3): runc v1.5.3 -- "Let me hear you make decisions without your television."

[Compare Source](opencontainers/runc@v1.5.2...v1.5.3)

This is the third patch release in the 1.5.z release series of runc. It
includes a fix for a high-severity vulnerability (CVE-2026-119101)
affecting users who checkpoint and restore containers, as well as a few
other fixes. Users are encouraged to update.

##### Security

This release includes a fix for the following high-severity security issue:

- [CVE-2026-119101][] allowed a malicious image, using crafted symlinks in
  its rootfs, to confuse the way runc names external mounts for CRIU, and so
  make `runc restore` bind-mount an arbitrary host directory into the restored
  container, read-write. Only users who both checkpoint and later restore
  containers running untrusted images are affected (checkpoint/restore
  requires root, so rootless runc is not affected). The same issue was found
  in crun ([CVE-2026-115520][]); CRIU itself is fixed in [CVE-2026-119614][].

  In addition, `runc restore` no longer makes read-only bind mounts writable,
  even temporarily, while preparing the container mounts.

[CVE-2026-119101]: GHSA-g2c3-j8g3-7gpw

[CVE-2026-115520]: GHSA-2mxx-58qc-p466

[CVE-2026-119614]: GHSA-7ww7-53q2-wrwx

##### Fixed

- Running a container which does not have its own mount namespace no longer
  changes the propagation of host's `/` and of the parent mount of the
  container rootfs (they were made private or slave). ([#&#8203;5537](opencontainers/runc#5537), [#&#8203;5581](opencontainers/runc#5581))
- When making the container rootfs read-only (`root.readonly`), runc no longer
  clears the `nosuid`, `nodev`, `noexec` and `nosymfollow` flags of the rootfs
  mount (this only happened when not using a user namespace). ([#&#8203;5588](opencontainers/runc#5588), [#&#8203;5601](opencontainers/runc#5601))
- The `defaults` mount option is no longer passed to the kernel as
  filesystem-specific mount data, which made mounting filesystems that do not
  accept it (such as `tmpfs`) fail. ([#&#8203;5500](opencontainers/runc#5500), [#&#8203;5520](opencontainers/runc#5520), [#&#8203;5602](opencontainers/runc#5602))

##### Changed

- Updated github.com/moby/sys/capability to v0.5.0. ([#&#8203;5598](opencontainers/runc#5598), [#&#8203;5600](opencontainers/runc#5600))
- Various CI improvements. ([#&#8203;5481](opencontainers/runc#5481), [#&#8203;5482](opencontainers/runc#5482), [#&#8203;5488](opencontainers/runc#5488), [#&#8203;5574](opencontainers/runc#5574), [#&#8203;5586](opencontainers/runc#5586), [#&#8203;5590](opencontainers/runc#5590), [#&#8203;5609](opencontainers/runc#5609),
  [#&#8203;5615](opencontainers/runc#5615))

##### Static Linking Notices

The `runc` binaries distributed with this release are *statically linked* with
the following [GNU LGPL-2.1][lgpl-2.1] licensed libraries, with `runc` acting
as a "work that uses the Library":

[lgpl-2.1]: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html

- [libseccomp](https://github.com/seccomp/libseccomp)

Similarly, the `runc` binaries distributed with this release are also
*statically linked* with the following [MPLv2][mpl-2.0] licensed libraries,
with `runc` acting as a "Larger Work":

- [libpathrs](https://github.com/cyphar/libpathrs)

[mpl-2.0]: https://www.mozilla.org/en-US/MPL/2.0/

The versions of these libraries were not modified from their upstream versions,
but in order to comply with their corresponding licenses, we have attached the
complete source code for those libraries which (when combined with the attached
runc source code) may be used to exercise your rights under their respective
licenses.

However, we strongly suggest that you make use of your distribution's packages
or download them from the authoritative upstream sources, especially since
these libraries are related to the security of your containers.

***

Thanks to the following contributors who made this release possible:

- Kir Kolyshkin <kolyshkin@gmail.com>
- Li Fu Bang <lifubang@acmcoder.com>
- Lucas Sotomayor <sotomayorlucas@pm.me>

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At 12:00 AM through 04:59 AM and 10:00 PM through 11:59 PM, Monday through Friday (`* 0-4,22-23 * * 1-5`)
  - Only on Sunday and Saturday (`* * * * 0,6`)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjMuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjIyMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJLaW5kL0RlcGVuZGVuY2llcyJdfQ==-->

Reviewed-on: https://altlinux.space/stapler/stplr/pulls/522
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants