Here's a simple script to check if the alarm system works:
Code:
#! /bin/sh
set -e
WAKE_ALARM=/sys/class/rtc/rtc0/wakealarm
# Cancel an existing alarm.
echo 0 > "$WAKE_ALARM"
# Set an alarm one second into the future.
echo +1 > "$WAKE_ALARM"
# Check that the pseudo-file contains a Unix Epoch.
grep -q '^[0-9]\+$' "$WAKE_ALARM"
# The alarm should fire while we're sleeping.
sleep 2
# And now, the pseudo-file should be empty.
test -s "$WAKE_ALARM"