#!/bin/sh
# regular end: return code of program 0
timeout 2 sleep 1
R=$?
if [ "${R}" != "0" ]; then
  echo "FAILED: regular end: expected 0 return code but got ${R}"
fi

# regular end: return code of program non-0
timeout 2 exit 27
R=$?
if [ "${R}" != "27" ]; then
  echo "FAILED: regular end: expected 27 return code but got ${R}"
fi

# timeout: return code
timeout 1 sleep 2
R=$?
if [ "${R}" != "137" ]; then
  echo "FAILED: timeout: expected 137 return code but got ${R}"
fi

