1
0
mirror of https://github.com/containers/youki synced 2026-03-12 00:38:24 +01:00
youki/tests/contest
Kevin Kickartz-Grabowsky 76b913d4d6
fix: inherit config.json env vars in exec processes (#3439)
* fix: inherit spec env vars in exec process

Previously, youki exec only used env vars passed via --env on the CLI,
plus PATH from the container spec. All other spec env vars were silently
dropped. This differs from runc, crun, and runsc, which inherit the full
process.env from config.json.

Now the spec's env vars are used as a baseline, with CLI --env overriding
by variable name. This matches the behavior of other OCI runtimes.

Closes #3428

Signed-off-by: KevinKickass <k@ppload.eu>

* test: add e2e tests for exec --env and merge test modules

Add contest e2e tests for exec environment variable handling:
- spec env inheritance, CLI override, CLI addition, process.json

Merge duplicate test modules (mod test + mod tests) in
tenant_builder.rs into a single mod tests block and fix
rustfmt chain formatting.

Signed-off-by: KevinKickass <k@ppload.eu>

* fix: add check_container_created before start in exec_env tests

Matches the pattern used in other contest tests (e.g., mount_test.rs).
Without this check, start_container would fail silently if the
container creation step had issues.

Signed-off-by: KevinKickass <k@ppload.eu>

* fix: address review feedback and fix exec_env test PATH

- Shorten inline comment per review suggestion
- Update get_environment docstring to mention only runc
- Rename unit tests: cli_env_* -> builder_env_*
- Reduce sleep from 10000 to 1000 in exec_env tests
- Use full PATH in exec_env test specs so sleep is found
  in the busybox rootfs (/bin/sleep)
- Add env parameter to exec_container helper instead of
  duplicating the logic in a separate function

Signed-off-by: KevinKickass <k@ppload.eu>

* style: cargo fmt

Signed-off-by: KevinKickass <k@ppload.eu>

---------

Signed-off-by: KevinKickass <k@ppload.eu>
2026-03-12 03:35:38 +09:00
..
contest fix: inherit config.json env vars in exec processes (#3439) 2026-03-12 03:35:38 +09:00
runtimetest Added SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV (#3404) 2026-02-25 10:52:25 +05:30
test_framework chore(deps): bump the patch group across 1 directory with 2 updates 2026-02-23 00:45:20 +00:00