2 TS=`echo $0 | sed "s/\/tc//"`
11 if [ "$1" == "-a" ]; then
14 elif [ "$1" == "clean" ]; then
19 if [[ -z $USER ]]; then
21 elif [[ -n "$SUDO_USER" ]]; then
23 elif [[ -n "$USER" ]]; then
27 if [ "$1" == "" ]; then
28 DIRS=`find $TS -maxdepth 2 -type d -name "TC_*" | sed "s/^$TS\///" | sort`
29 if [ "$DIRS" == "" ] ; then
30 echo "Usage: tc <TestCase> [expected]"
31 echo " expected - create the expected response for future comparison"
39 if [ "$1" == "-a" ]; then
42 elif [ "$1" == "clean" ]; then
47 if [ -e tc.delay ]; then
48 OPTS=$OPTS" -delayAll "`cat tc.delay`
52 SUFFIX=`date "+%Y-%m-%d_%H:%M:%S"`
55 if [ "$CLEAN" = "TRUE" ]; then
56 cat $TS/$TC/00* $TS/$TC/99* | aafcli -i -a -t -n
58 ln -s runs/$TC.CLEAN.$SUFFIX last
59 elif [ "$1" = "expected" ]; then
61 cat $TS/$TC/[0-9]* | aafcli -i -t 2>&1 | sed -e "/$THE_USER/s//@[THE_USER]/g" | tee $TS/expected/$TC.$SUFFIX
62 elif [ -d "$TS/$TC" ]; then
63 if [ "$1" = "dryrun" ]; then
64 cat $TS/$TC/[0-9]* > temp
65 cat $TS/$TC/[0-9]* | aafcli -i -t
69 ln -s runs/$TC.$SUFFIX last
70 cat $TS/$TC/[0-9]* | aafcli -i -t $OPTS | sed -e "/$THE_USER/s//@[THE_USER]/g" -e "s/
\r//" 2>&1 > runs/$TC.$SUFFIX
72 diff --ignore-blank-lines -w runs/$TC.$SUFFIX $TS/expected/$TC.expected || failed "[$TC.$SUFFIX]"
73 echo "SUCCESS! [$TC.$SUFFIX]"
75 elif [ -f "$TS/$TC" ]; then
76 cat $TS/$TC | aafcli -i -t $OPTS