From cd3411088f6bb4393d79c50b5f7eef3f11a83435 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 10 Oct 2014 00:31:33 +0200 Subject: initial commit for Enea Linux 4.0-140929 Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea --- .../ddt-runner/files/scripts/bsc9132qds/watchdog | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 recipes-test/ddt-runner/files/scripts/bsc9132qds/watchdog (limited to 'recipes-test/ddt-runner/files/scripts/bsc9132qds/watchdog') diff --git a/recipes-test/ddt-runner/files/scripts/bsc9132qds/watchdog b/recipes-test/ddt-runner/files/scripts/bsc9132qds/watchdog new file mode 100755 index 0000000..2beb8a6 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/bsc9132qds/watchdog @@ -0,0 +1,64 @@ +#!/bin/sh +# +# This script is used to test watchdog functionality for bsc9132qds. + +WATCHDOG=`which watchdog` +if [ "x$WATCHDOG" != "x" ]; then + echo "PASS: watchdog found" +else + echo "FAIL: watchdog not found" + exit 1 +fi + +WATCHDOG_CONF=/etc/watchdog.conf +if [ -f $WATCHDOG_CONF ]; then + echo "PASS: watchdog config file found" + sed -i '23,23 s/#//' $WATCHDOG_CONF +else + echo "FAIL: watchdog config file not found" + exit 1 +fi + +$WATCHDOG -v /dev/watchdog +watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` +if [ $watchdog_thread -eq 2 ]; then + echo "PASS: Watchdog daemon started successfully" +else + echo "FAIL: Failed to start watchdog daemon" + exit 1 +fi + +sleep 5s + +killall watchdog + +retry=0 +while [ $retry -lt 10 ] +do + watchdog_thread=`ps | grep -c 'watchdog -v /dev/watchdog'` + if [ $watchdog_thread -eq 1 ]; then + echo "PASS: Watchdog daemon stopped successfully" + break; + fi + sleep 1s + retry=`expr $retry + 1` +done + +if [ $retry -eq 10 ]; then + echo "FAIL: Failed to stop watchdog daemon" +fi + +found=0 +while read line +do + result=`echo $line | grep -c 'still alive after 1 interval'` + if [ $result -eq 1 ]; then + echo "PASS: Watchdog is still alive after 1 interval" + found=1 + fi +done < /var/log/messages + +if [ $found -eq 0 ]; then + echo "FAIL: Watchdog is not alive after 1 interval" +fi + -- cgit v1.2.3-54-g00ecf