自动测试重启脚本Linux

#!/bin/sh
#set -x
APP_DIR="/usr/saftop/test"
APP_NAME="reboot_test"
APP_THREAD_COUNT=1
GUARD_LOG="${APP_NAME}_guard.log"
DMSG_DIR="/usr/saftop/test/dmsg"

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/saftop/lib
# declare -i count  
# count=0
export m=$(cat /usr/saftop/test/count.txt)

loop()
{
		time=`date +%Y%m%d%H%M%S`
		# count= `expr $count + 1`  
		# let "count++"
		
		let "m++"
		echo $m >/usr/saftop/test/count.txt
		echo  ${time} "reboot_test, so reboot it  $m times"  >> ${GUARD_LOG}
		dmesg > ${DMSG_DIR}/dmsg_${time}.log 2>&1
		
}

main()
{
       while [ 1 ];do
		sleep 180
               loop
		reboot
       done
		
	
}

main

 

你可能感兴趣的:(自动化/单元测试研究)