#!/bin/sh 

echo '---setup principals'
env keystore=`pwd` ./setup.py 1>/dev/null 2>& 1

echo '---setup attributes'
env keystore=`pwd` ./attr.py 1>ball.log 2>& 1

echo '---run queries'

# Make prover queries
g_cmd_sha=`grep "cmd1:" query.py |sed "s/cmd1://g" `
g_cmd_cn=`grep "cmd2:" query.py |sed "s/cmd2://g" `

echo '...with sha'
eval $g_cmd_sha 2>/dev/null 1 > ball.sha

echo '...with cn'
eval $g_cmd_cn 1>ball.cn 2>&1

result=`diff ball.cn ball.save 2>/dev/null`
if [ $? -eq 0 ]; then
    if [ "$result" = "" ]; then
       echo "   PASSED"
    else
       echo "   ERROR:balltime_rt2 test result differs!!!"
    fi
else
    echo "   ERROR:balltime_rt2 test result differs!!!"
fi


