Add few more tests.
This commit is contained in:
parent
583e5b645c
commit
3f9634e550
17 changed files with 265 additions and 20 deletions
20
tests/grub_cmd_sleep.in
Normal file
20
tests/grub_cmd_sleep.in
Normal file
|
@ -0,0 +1,20 @@
|
|||
#! /bin/bash
|
||||
set -e
|
||||
|
||||
. "@builddir@/grub-core/modinfo.sh"
|
||||
|
||||
# FIXME: OpenBIOS on sparc64 doesn't implement RTC
|
||||
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Compare RTC with interval timer.
|
||||
# Not 100% proper but should check that timer is running ok
|
||||
dt=`echo 'date; sleep 10; date' | @builddir@/grub-shell`
|
||||
dt1="$(date -u -d "$(echo "$dt" | head -n 1)" +%s)"
|
||||
dt2="$(date -u -d "$(echo "$dt" | tail -n 1)" +%s)"
|
||||
|
||||
if [ $((dt2 - dt1)) -gt 11 ] || [ $((dt2 - dt1)) -lt 9 ]; then
|
||||
echo "Interval not in range $dt2-$dt1 != 10"
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue