#!/bin/sh 


noise=$1

rm -rf fruit_$noise
mkdir fruit_$noise
sed "s/#VAL#/$noise/" base/README > fruit_$noise/README
cp base/RESULT fruit_$noise/fruit.save
cp base/QUERY fruit_$noise/run_query
cd fruit_$noise
chmod +x README run_query
./README
time env ABAC_CN=1 ./run_query 1>fruit.tmp 2> fruit.time
result=`diff fruit.tmp fruit.save 2>/dev/null`
if [ "$result" = "" ]; then
   echo "   PASSED"
else   
   echo "   ERROR"
fi


