#!/bin/sh 

g_cmd_sha=`grep "cmd1:" id.py |sed "s/cmd1://g" `
g_cmd_cn=`grep "cmd2:" id.py |sed "s/cmd2://g" `

echo '---setup principals'
./setup.py 1>id.log 2>&1

echo '---run with sha'
eval $g_cmd_sha 2>/dev/null 1 > id.sha

echo '---run with cn'
eval $g_cmd_cn 1>id.cn 2>&1
result=`diff id.cn id.save 2>/dev/null`
if [ $? -eq 0 ]; then
    if [ "$result" = "" ]; then
       echo "   PASSED"
    else
       echo "   ERROR:id test result differs!!!"
    fi
else
    echo "   ERROR:id test result differs!!!"
fi




