spiegel_podman/test/system
Brent Baude 80bf6e6a10
Merge pull request #29227 from ashley-cui/dnsnames
Add dnsnames field & fix alias field
2026-08-04 08:49:33 -05: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 Remove duplicate memAvailable sanity check 2026-07-22 13:30:50 +02: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 Move to deterministic network setup order 2026-04-17 10:00:32 -04: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 test/system: drop the conmon pid debugging 2026-07-28 23:34:09 +05:30
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-01-05 19:25:13 +01:00
037-runlabel.bats Also substitute $HOME in runlabel with user's homedir 2024-05-03 14:00:20 +02:00
040-ps.bats ps: format labels as comma separated key=value for Docker compatibility 2026-04-30 18:04:49 +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 Fix stop timing flake by widening upper bound 2026-06-09 14:57:28 +02:00
055-rm.bats test/system: fix "podman rm running container, w/o and w/ force" flake 2026-07-14 14:16:00 +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 Use tmp context dir when building with process substitution 2026-05-08 10:39:38 -04: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-05-27 12:44:40 +02:00
085-top.bats Fix output of podman --remote top 2023-10-16 17:25:10 -04:00
090-events.bats events: include labels in pod and volume attributes 2026-06-09 20:36:04 +09:00
110-history.bats CI: make 110-history parallel-safe 2024-09-03 14:41:46 -06:00
120-load.bats Add --format to image scp 2026-03-19 17:42:33 +01:00
125-import.bats test/system: remove distro-integration bats tag 2025-09-02 12:10:08 +02:00
126-commit.bats cmd, commit: change --pause default to true 2026-06-03 07:28:22 +02:00
130-kill.bats test/system: fix "podman kill - concurrent stop" 2026-05-28 13:37:42 +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 volume ls: format labels as comma-separated key=value strings 2026-04-30 18:05:06 +02:00
161-volume-quotas.bats test/system: skip podman volumes with XFS quotas on fedora 2025-12-12 14:16:39 +01:00
170-run-userns.bats test/system: delete CgV1 skips and skipped CgV2 tests 2025-11-12 15:15:34 -05: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-03-21 21:43:37 +01:00
200-pod.bats ps: format labels as comma separated key=value for Docker compatibility 2026-04-30 18:04:49 +02:00
220-healthcheck.bats Fix healthcheck flake by capturing time before systemctl checks 2026-06-09 14:57:27 +02:00
221-healthcheck-corrupt.bats fix: Handle healthcheck log corruption gracefully 2026-06-29 13:03:47 +02:00
221-healthcheck-transient.bats Fix healthcheck failing silently with --transient-store 2026-04-14 14:13:20 +02:00
250-systemd.bats test/system: use DISABLE_HC_SYSTEMD for 2 tests 2026-05-28 13:37:42 +02:00
251-system-service.bats Add a no-op GRPC responder service to the podman system service 2025-11-03 11:14:32 -05:00
252-quadlet.bats test/system: fix "quadlet kube - start error" flake 2026-06-01 21:02:30 +02:00
253-podman-quadlet.bats Merge pull request #28860 from l0rd/refactor/quadlet-applications-with-fix 2026-06-25 13:45:29 -04:00
254-podman-quadlet-multi.bats Quadlet installation code refactoring 2026-06-16 12:28:58 +00: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: Fix 260-sdnotify being silently skipped 2026-04-05 16:43:40 +02:00
270-socket-activation.bats rootless: use nsfs file handles to persist namespaces 2026-01-20 18:41:59 +01:00
271-tcp-cors-server.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
272-system-connection.bats test/system: Fix "command not found" with wait builtin 2026-06-16 10:39:16 +02:00
273-remote-spot-check.bats Implement TLS API Support 2025-09-26 09:09:54 -06:00
280-update.bats test system: increase nproc ulimit to avoid flake 2026-07-17 03:44:48 +00: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: delete CgV1 skips and skipped CgV2 tests 2025-11-12 15:15:34 -05:00
410-selinux.bats test/system: delete CgV1 skips and skipped CgV2 tests 2025-11-12 15:15:34 -05:00
420-cgroups.bats test/system: delete CgV1 skips and skipped CgV2 tests 2025-11-12 15:15:34 -05:00
450-interactive.bats exec: honor ConsoleSize so the terminal is sized at creation 2026-06-22 10:36:10 +08:00
500-networking.bats Add dnsnames field & fix alias field 2026-08-03 16:19:14 -04:00
505-networking-pasta.bats test/system: skip "IPv6 default address assignment" 2026-05-27 12:44:39 +02:00
520-checkpoint.bats test/system: skip podman checkpoint --export, with volumes on aarch64 2026-04-23 20:48:55 +02:00
550-pause-process.bats rootless: detect and remove stale pause.pid with recycled PIDs 2026-03-19 14:46:29 +01:00
600-completion.bats Autocomplete machine fixes 2026-02-02 15:19:37 -06:00
610-format.bats Vendor latest mono repo for libartifact changes 2025-12-10 14:44:50 -06:00
620-option-conflicts.bats fix: improve userns validation when joining pods 2025-11-25 08:45:19 +00:00
700-play.bats test: Remove slirp4netns-specific test cases 2026-04-13 08:22:35 -04:00
702-artifact.bats libpod: validate artifact volume on create 2026-02-12 18:24:16 +01:00
710-kube.bats test: Use yq for yaml2json when available 2026-02-22 11:29:27 +01:00
750-trust.bats trust: switch policy.json lookup to configfile 2026-04-20 15:11:22 +02:00
760-system-renumber.bats sqlite_state: Fix RewriteVolumeConfig 2024-06-20 11:39:44 +02:00
800-config.bats test/system: re-enable module command line completion test 2026-04-27 12:54:05 +02: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
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/system: drop the metacopy instrumentation 2026-07-28 23:34:09 +05:30
helpers.network.bash test/system: fix random_rfc1918_subnet operator precedence 2026-07-27 14:42:50 +05:30
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 test/system: fix random_rfc1918_subnet operator precedence 2026-07-27 14:42:50 +05:30
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.