#!/bin/sh 

rm -rf *.pem *.xml *.log *.out

echo '---setup principals'
./setup.py 1>/dev/null 2>& 1

echo '---setup attributes'
./attr.py 1>experiment.log 2>& 1

echo '---run queries'
env keystore=`pwd` ./query.py 1>experiment.out 2>& 1

good=`grep success experiment.out |wc -l`
bad=`grep failure experiment.out |wc -l`
if [ $good -eq 2 -a $bad -eq 1 ]; then
    echo "   PASSED"
else
    echo "   ERROR:experiment_create_rt0 test result differs!!!"
fi

