#!/bin/sh
#
# Smoking philosopher grading tests

t1=25   # kill off everything after t1 seconds
t2=5    # wait after everything has been started ok

# 1. See if the `papers' philosopher can save things

tstart $t1
phil P	> /dev/null &
vend -s 71 mmmttt
sleep $t2
tstop

# 2.  A simple test, starting the vendor first

tstart $t1
vend tmptmp &
phil T > /dev/null &
phil M > /dev/null &
phil P > /dev/null &
sleep $t2
tstop

# 3. A more interesting smokable sequence

tstart $t1
phil T > /dev/null &
phil M > /dev/null &
phil P > /dev/null &
vend -s 9 pttpmmpm
sleep $t2
tstop

# 4. A smokable sequence of length 10

tstart $t1
phil T > /dev/null &
phil M > /dev/null &
phil P > /dev/null &
vend -s 15 -r 10
sleep $t2
tstop


