From Fedora Project Wiki
Description
This test verifies that commands executed inside a running container return output and exit status correctly, and that stopping the container completes successfully.
How to test
- Start a background container:
podman run -d --name conmon-exec registry.fedoraproject.org/fedora:latest sleep 300
- Execute a command inside it:
podman exec conmon-exec sh -c 'echo EXEC_OK; exit 23'
- Check the command's exit status immediately afterward:
echo $?
- Stop the container:
podman stop -t 2 conmon-exec
- Check its state:
podman inspect --format '{{.State.Status}}' conmon-exec - Clean up:
podman rm conmon-exec
Expected Results
- The background container starts successfully.
- The executed command prints
EXEC_OK. - Its exit status is
23. - Stopping completes without hanging. A warning about using SIGKILL after the two-second timeout is acceptable.
- Inspect prints
exited.
Optional
Before stopping the container, try an interactive exec session:
podman exec -it conmon-exec sh
Inside the container, run:
echo EXEC_TTY_OK exit
The shell should accept input, display the message, and return to the host terminal.
