From Fedora Project Wiki

Description

This test verifies that conmon-v3 monitors a detached container and reports its exit status.

How to test

  1. Start a container that exits with code 42:
    podman run -d --name conmon-exit registry.fedoraproject.org/fedora:latest sh -c 'sleep 20; exit 42'
    
  2. Wait for the container to exit (this will hang for 20 seconds - matching the previous sleep):
    podman wait conmon-exit
    
  3. Check its state and exit code:
    podman inspect --format '{{.State.Status}} {{.State.ExitCode}}' conmon-exit
    
  4. Clean up:
    podman rm conmon-exit
    

Expected Results

  1. The container starts in the background.
  2. podman wait prints 42.
  3. Inspect prints exited 42.
  4. All commands except the podman wait finish without hanging.

Optional

Repeat the test using exit 0. The reported exit code should be 0.