Make multi-threaded
[wakeup.git] / test / wakeup_spring
1 #!/bin/bash
2 #
3 #  Test the wakeup sequence in spring.
4 #  Sunrise happens a few minutes after wakeup time
5 #
6 set -m
7 PATH=../src:$PATH
8
9 # Reset the lights and clear the log files
10
11 lightcontrol -r 0 -g 0 -b 0 -w 0
12 > lightcontrol.log
13 > wakeup.log
14
15 ln -f -s wakeup_empty.xml wakeup_link.xml
16
17 wakeup &
18 sleep 1
19
20 read TACHYON_NAME <wakeup.run
21 Time=`date --date '2020-05-07 05:00' +%s`
22 tachyon -t $Time $TACHYON_NAME
23 tachyon -a 1000   $TACHYON_NAME
24
25 ln -f -s wakeup_alarms.xml wakeup_link.xml
26
27 kill -HUP `cat wakeup.pid`
28
29 fg %1
30 #kill  `cat wakeup.pid`
31
32 # Remove timestamps from the log.
33 cut -c 22- wakeup.log >wakeup_spring.log.test
34
35 diff wakeup_spring.log.test wakeup_spring.log.expect
36
37 exit $?