#!/bin/sh

set -e

LOG=cpulimit.log
rm -f $LOG

cpulimit -l 25 -f -- perl -e '$z=time()+10; while (time()<$z) { $i++; }' >$LOG
grep -Eq '^Process [0-9]+ detected$' $LOG
grep -Eq '^Child process is finished, exiting\.\.\.$' $LOG
