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

  1. Start a background container:
    podman run -d --name conmon-exec registry.fedoraproject.org/fedora:latest sleep 300
    
  2. Execute a command inside it:
    podman exec conmon-exec sh -c 'echo EXEC_OK; exit 23'
    
  3. Check the command's exit status immediately afterward:
    echo $?
    
  4. Stop the container:
    podman stop -t 2 conmon-exec
    
  5. Check its state:
    podman inspect --format '{{.State.Status}}' conmon-exec
    
  6. Clean up:
    podman rm conmon-exec
    

Expected Results

  1. The background container starts successfully.
  2. The executed command prints EXEC_OK.
  3. Its exit status is 23.
  4. Stopping completes without hanging. A warning about using SIGKILL after the two-second timeout is acceptable.
  5. 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.