spiegel_podman/test/system
Paul Holzinger 85832029d5
fix image host env leak
When parsing image envs we need to be strict about the format, only the
"key=value" format must be accepted. Just keys must be rejected as they
are not valid according to the image spec.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
(cherry picked from commit 6c431b73db)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-24 16:51:31 +02:00
..
000-TEMPLATE CI: system tests: minor documentation on parallel 2024-09-18 11:32:36 -06:00
001-basic.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
005-info.bats Warn on boltdb use 2025-10-22 09:24:43 -04:00
010-images.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
011-image.bats system tests: add and use _prefetch 2023-06-26 06:51:01 -06:00
012-manifest.bats Add podman manifest rm --ignore 2025-01-22 11:43:47 -05:00
015-help.bats CI: system tests: parallelize low-hanging fruit 2024-09-03 14:22:01 -06:00
020-tag.bats Replace podman pause image with rootfs. 2025-04-17 08:36:27 +02:00
030-run.bats fix image host env leak 2026-06-24 16:51:31 +02:00
032-sig-proxy.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
035-logs.bats test/system: fix log timestamp work around 2026-02-06 15:36:47 -05:00
037-runlabel.bats Also substitute $HOME in runlabel with user's homedir 2024-05-03 14:00:20 +02:00
040-ps.bats Replace podman pause image with rootfs. 2025-04-17 08:36:27 +02:00
045-start.bats remote: don't print bogus error when starting container attached 2025-04-24 14:31:22 +02:00
050-stop.bats test/system: fix can trap signal flake 2026-06-04 17:53:13 +02:00
055-rm.bats podman rm: handle case where conmon was killed 2025-07-15 17:15:19 +02:00
060-mount.bats test/system: skip noswap memory mounts correctly 2025-09-10 14:52:08 +02:00
065-cp.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
070-build.bats Add system test 2026-02-06 15:36:47 -05:00
075-exec.bats test/system: fix test race in exec leak check 2025-09-16 14:02:38 +02:00
080-pause.bats test/system: do not run "podman pause/unpause" in parallel 2026-06-04 17:53:12 +02:00
085-top.bats Fix output of podman --remote top 2023-10-16 17:25:10 -04:00
090-events.bats test/system: remove distro-integration bats tag 2025-09-02 12:10:08 +02:00
110-history.bats CI: make 110-history parallel-safe 2024-09-03 14:41:46 -06:00
120-load.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
125-import.bats test/system: remove distro-integration bats tag 2025-09-02 12:10:08 +02:00
130-kill.bats test/system: fix "podman kill - concurrent stop" 2026-06-04 17:53:13 +02:00
140-diff.bats Replace egrep/fgrep with grep -E/-F 2023-05-03 07:32:42 -06:00
150-login.bats Revert "Use the config digest to compare images loaded/pulled using different methods" 2025-01-23 00:11:24 +01:00
155-partial-pull.bats Clarify the reason for skip_if_remote 2024-11-27 21:26:11 +01:00
156-pull-policy.bats Podman pull - add policy flag 2025-06-23 11:28:39 -04:00
160-volumes.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
161-volume-quotas.bats test/system: skip podman volumes with XFS quotas on fedora 2026-02-06 15:36:47 -05:00
170-run-userns.bats Fix --userns=ns:<path> conflicting with runc 1.1.11+ 2025-10-07 15:45:45 +02:00
180-blkio.bats test/system: remove distro-integration bats tag 2025-09-02 12:10:08 +02:00
190-run-ipcns.bats test/system: remove distro-integration bats tag 2025-09-02 12:10:08 +02:00
195-run-namespaces.bats test: relax rootless runc pid namespace assertion 2026-04-09 14:23:50 +02:00
200-pod.bats Deterministically order pod inspect fields 2026-02-06 15:36:47 -05:00
220-healthcheck.bats test/system: use DISABLE_HC_SYSTEMD for 2 tests 2026-06-04 17:53:13 +02:00
250-systemd.bats test/system: use DISABLE_HC_SYSTEMD for 2 tests 2026-06-04 17:53:13 +02:00
251-system-service.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
252-quadlet.bats test/system: fix "quadlet kube - start error" flake 2026-06-04 17:54:31 +02:00
253-podman-quadlet.bats quadlet: add cat alias for print 2025-10-22 20:05:08 +02:00
254-podman-quadlet-multi.bats quadlet install: multiple quadlets from single file should share app 2026-02-06 15:36:47 -05:00
255-auto-update.bats podman auto-update: include container in invalid policy message 2025-07-14 14:34:22 +02:00
260-sdnotify.bats test/system: remove distro-integration bats tag 2025-09-02 12:10:08 +02:00
270-socket-activation.bats Vendor latest c/common and fix tests 2024-02-29 12:16:51 -05:00
271-tcp-cors-server.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
272-system-connection.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
273-remote-spot-check.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
280-update.bats Clamp rootless rlimits to host on format 2026-02-06 15:36:47 -05:00
300-cli-parsing.bats Run codespell on code 2024-01-28 07:30:52 -05:00
320-system-df.bats system df --verbose don't crash 2025-05-28 20:50:17 +02:00
330-corrupt-images.bats Fix 330-corrupt-images.bats in composefs test runs 2024-10-18 23:44:04 +02:00
331-system-check.bats System tests: add podman system check tests 2024-06-04 10:00:37 -04:00
400-unprivileged-access.bats test/system: add systemd df regression test 2025-03-17 13:38:06 +01:00
410-selinux.bats test/system: Update test to handle new error message from runc 1.3.3 2026-02-06 15:36:47 -05:00
420-cgroups.bats test/system: remove distro-integration bats tag 2025-09-02 12:10:08 +02:00
450-interactive.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
500-networking.bats test/system: skip one new pasta flake 2026-06-04 17:53:12 +02:00
505-networking-pasta.bats test/system: skip "IPv6 default address assignment" 2026-06-04 17:53:10 +02:00
520-checkpoint.bats test/system: fix broken podman_runtime 2025-11-10 15:14:48 +00:00
550-pause-process.bats SetupRootless handle case where conmon pid are not valid 2025-11-26 10:18:30 +00:00
555-migration.bats Add migration code for BoltDB to SQLite 2026-02-05 20:09:37 -05:00
600-completion.bats cmd: add auto completion for network create --interface-name 2025-09-30 13:50:57 +02:00
610-format.bats fix artifact inspect issues 2025-10-22 13:04:13 +02:00
620-option-conflicts.bats fix: improve userns validation when joining pods 2026-02-06 15:36:47 -05:00
700-play.bats fix: skip execution of probes when initialDelaySeconds is not elapsed 2026-02-06 13:46:36 -05:00
702-artifact.bats test/system: fix artifact test cleanup 2025-11-10 15:14:48 +00:00
710-kube.bats Kube volumes can not container _ 2024-12-18 09:07:57 -05:00
750-trust.bats system tests: add assert(), and start using it 2022-04-20 16:14:42 -06:00
760-system-renumber.bats sqlite_state: Fix RewriteVolumeConfig 2024-06-20 11:39:44 +02:00
800-config.bats vendor: update github.com/burntsushi/toml to v1.5.0 2025-03-18 15:34:42 +01:00
850-compose.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
900-ssh.bats ssh system test: skip until it becomes a test 2022-11-21 08:02:00 -07:00
950-preexec-hooks.bats Add file swith for pre-exec 2023-04-26 10:20:10 -04:00
999-final.bats systests: add a last-minute check for db backend 2023-11-06 14:15:28 -07:00
build-systemd-image new testimage and systemd-image 2024-02-09 05:26:07 -07:00
build-testimage pasta udp tests: new bytecheck helper 2024-10-16 10:15:19 -06:00
helpers.bash test: Fix PODMAN_BATS_LEAK_CHECK 2026-02-06 15:36:47 -05:00
helpers.network.bash tests: Get rid of netcat on the host and use Bash's /dev/tcp 2025-08-28 17:43:47 +02:00
helpers.registry.bash CI: system test registry: use --net=host 2024-09-19 05:17:15 -06:00
helpers.sig-proxy.bash pkg/rootless: correctly handle proxy signals on reexec 2023-05-25 16:48:15 +02:00
helpers.systemd.bash Merge pull request #26624 from Odilhao/artifact-quadlet-implementation 2025-10-13 14:41:25 +00:00
helpers.t CI: system tests: make random_free_port() parallel-safe 2024-08-15 10:04:51 -06:00
README.md tests: Replace ncat for socat 2025-08-28 15:38:12 +02:00
setup_suite.bash Implement TLS API Support 2025-09-26 09:09:54 -06:00

Quick overview of podman system tests. The idea is to use BATS, but with a framework for making it easy to add new tests and to debug failures.

Quick Start

Look at 000-TEMPLATE for a simple starting point. This introduces the basic set of helper functions:

  • setup (implicit) - establishes a test environment.

  • parse_table - you can define tables of inputs and expected results, then read those in a while loop. This makes it easy to add new tests. Because bash is not a programming language, the caller of parse_table sometimes needs to massage the returned values; 030-run.bats offers examples of how to deal with the more typical such issues.

  • run_podman - runs command defined in $PODMAN (default: 'podman' but could also be './bin/podman' or 'podman-remote'), with a timeout. Checks its exit status.

  • assert - compare actual vs expected output. Emits a useful diagnostic on failure.

  • die - output a properly-formatted message to stderr, and fail test

  • skip_if_rootless - if rootless, skip this test with a helpful message.

  • skip_if_remote - like the above, but skip if testing podman-remote

  • safename - generates a pseudorandom lower-case string suitable for use in names for containers, images, volumes, any object. String includes the BATS test number, making it possible to identify the source of leaks (failure to clean up) at the end of tests.

  • random_string - returns a pseudorandom alphanumeric string suitable for verifying I/O.

Test files are of the form NNN-name.bats where NNN is a three-digit number. Please preserve this convention, it simplifies viewing the directory and understanding test order. In particular, 00x tests should be reserved for a first-pass fail-fast subset of tests:

bats test/system/00*.bats || exit 1
bats test/system

...the goal being to provide quick feedback on catastrophic failures without having to wait for the entire test suite.

Running tests

To run the tests locally in your sandbox using hack/bats is recommend, check hack/bats --help for info about usage.

To run the entire suite use make localsystem or make remotesystem for podman-remote testing.

Analyzing test failures

The top priority for this scheme is to make it easy to diagnose what went wrong. To that end, podman_run always logs all invoked commands, their output and exit codes. In a normal run you will never see this, but BATS will display it on failure. The goal here is to give you everything you need to diagnose without having to rerun tests.

The assert comparison function is designed to emit useful diagnostics, in particular, the actual and expected strings. Please do not use the horrible BATS standard of [ x = y ]; that's nearly useless for tracking down failures.

If the above are not enough to help you track down a failure:

Debugging tests

Some functions have dprint statements. To see the output of these, set PODMAN_TEST_DEBUG="funcname" where funcname is the name of the function or perhaps just a substring.

Requirements

  • bats
  • jq
  • skopeo
  • httpd-tools
  • openssl
  • socat
  • buildah
  • gnupg
  • xfsprogs

Further Details

TBD. For now, look in helpers.bash; each helper function has (what are intended to be) helpful header comments. For even more examples, see and/or run helpers.t; that's a regression test and provides a thorough set of examples of how the helpers work.