#!/bin/bash

##
# @file verify
#
# Shell Script to start csmtool.
#

show_help()
{
	echo "Usage:"
	echo "  $0 -com"   for compliance testing
	echo "  $0 -end"   for endurance testing
	echo "  $0 -str"   for stress testing
	echo "  $0 -int"   for interactive mode
	echo ""
#	echo "export LD_LIBRARY_PATH=../lib"
}

compliant_test()
{
#	./csmtool -r ../.csm -b < test_script > test.log
	./csmtool -b < verify_script > test.log
}

endurance_test()
{
#	rm -f ../.csm/[0-4]
#	./csmtool -r ../.csm -s 1 -E 0x1000 & ./csmtool -r ../.csm -s 2 -E0x2000
	rm -f /tmp/csman/[0-4]
	./csmtool -s 1 -E 0x1000 & ./csmtool -s 2 -E0x2000
}

stress_test()
{
	rm -f /tmp/csman/[0-4]
	./csmtool -b < stress_script > test.log
}

export LD_LIBRARY_PATH=../lib

case $1 in
	"-com") compliant_test;;
	"-end") endurance_test;;
	"-str") stress_test;;
	"-int") ./csmtool;;
	*) show_help;;
esac
