From 2a7348129a42f21095fcd62e47a035f78d254130 Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 12 Dec 2013 17:36:38 +0100 Subject: initial commit of Enea Linux 3.1 Migrated from the internal git server on the dora-enea branch Signed-off-by: Adrian Dudau --- recipes-test/ddt-runner/files/scripts/p4080ds/rtc | 42 +++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 recipes-test/ddt-runner/files/scripts/p4080ds/rtc (limited to 'recipes-test/ddt-runner/files/scripts/p4080ds/rtc') diff --git a/recipes-test/ddt-runner/files/scripts/p4080ds/rtc b/recipes-test/ddt-runner/files/scripts/p4080ds/rtc new file mode 100755 index 0000000..0d38293 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/p4080ds/rtc @@ -0,0 +1,42 @@ +#!/bin/sh + +RTC_DEVICE="/dev/rtc" + +if [ ! -e $RTC_DEVICE ]; then + echo "FAIL: rtc device does not exist" + exit 1 +else + echo "PASS: rtc device exists" +fi + +/sbin/hwclock -f $RTC_DEVICE +if [ $? -ne 0 ]; then + echo "FAIL: rtc device open failed" + exit 1 +else + echo "PASS: rtc device open success" +fi + + +/sbin/hwclock --systohc +if [ $? -ne 0 ]; then + echo "FAIL: sync system clock and hardware clock failed" + exit 1 +else + echo "PASS: sync system clock and hardware clock success" +fi + +RTC_TIME=$(/sbin/hwclock -r |awk '{print $4}') +echo $RTC_TIME +SYS_TIME=$(date +%m/%d/%Y-%X |awk '{print $1}' |awk -F- '{print $2}') +echo $SYS_TIME + +if [ "$RTC_TIME" = "$SYS_TIME" ] ; then + echo "PASS: system time same with hardware time" +else + echo "FAIL: system time different with hardware time" + exit 1 +fi + +echo "PASS: rtc test successful" +exit 0 -- cgit v1.2.3-54-g00ecf