[Armadeus-commitlog] SF.net SVN: armadeus:[1136] trunk/target/test/test_watchdog.sh
Brought to you by:
sszy
|
From: <ar...@us...> - 2009-03-10 09:39:15
|
Revision: 1136
http://armadeus.svn.sourceforge.net/armadeus/?rev=1136&view=rev
Author: artemys
Date: 2009-03-10 09:39:05 +0000 (Tue, 10 Mar 2009)
Log Message:
-----------
[TEST] Add test for watchdog
Added Paths:
-----------
trunk/target/test/test_watchdog.sh
Added: trunk/target/test/test_watchdog.sh
===================================================================
--- trunk/target/test/test_watchdog.sh (rev 0)
+++ trunk/target/test/test_watchdog.sh 2009-03-10 09:39:05 UTC (rev 1136)
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+#
+# Script to test Armadeus Software release
+#
+# Copyright (C) 2008 The Armadeus Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+
+source ./test_helpers.sh
+source ./test_env.sh
+
+WATCHDOG_DEV="/dev/watchdog"
+SEC=5
+
+test_watchdog()
+{
+ show_test_banner "Watchdog"
+
+ ask_user "This test will reboot your board. Continue ? (y/n)"
+ if [ "$response" != "y" ]; then
+ exit_failed
+ fi
+
+ modprobe imx-wdt timeout=$SEC
+ if [ "$?" != 0 ] || [ ! -c "$WATCHDOG_DEV" ] ; then
+ echo "Module failed to load"
+ exit_failed
+ fi
+
+ watchdog -t $(($SEC-2)) /dev/watchdog
+ if [ "$?" != 0 ]; then
+ echo "Failed to launch userspace helper"
+ exit_failed
+ fi
+
+ ask_user "Press ENTER to reboot your system after $SEC seconds"
+
+ killall watchdog
+ sleep $(($SEC+2))
+
+ echo "You didn't reboot"
+ exit_failed
+}
+
+test_watchdog
+
Property changes on: trunk/target/test/test_watchdog.sh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|