summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2017-01-23 14:31:36 +0300
committerVladimir Serbinenko <phcoder@gmail.com>2017-05-03 12:22:05 +0200
commitb43b8cacc813c2c15347de1e35cc88d9aa912d22 (patch)
treeab9f24f561e03038c1952c587308ec5d648c3c5f /tests
parent37865c2c4ad26cd5e947b08abf1fde8145699919 (diff)
support busybox date.
Busybox date doesn't understand weekdays in -d input, so strip them beforehand.
Diffstat (limited to 'tests')
-rw-r--r--tests/grub_cmd_date.in2
-rw-r--r--tests/grub_cmd_sleep.in4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/grub_cmd_date.in b/tests/grub_cmd_date.in
index 0d8162e98..60f039ebc 100644
--- a/tests/grub_cmd_date.in
+++ b/tests/grub_cmd_date.in
@@ -9,7 +9,7 @@ if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ];
fi
pdt="$(date -u +%s)"
-dt=`echo date | @builddir@/grub-shell`
+dt=`echo date | @builddir@/grub-shell | sed 's, [A-Z][a-z]*$,,'`
dtg="$(date -u -d "$dt" +%s)"
ndt="$(date -u +%s)"
diff --git a/tests/grub_cmd_sleep.in b/tests/grub_cmd_sleep.in
index 05b8f6b73..ac51d4209 100644
--- a/tests/grub_cmd_sleep.in
+++ b/tests/grub_cmd_sleep.in
@@ -11,8 +11,8 @@ 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)"
+dt1="$(date -u -d "$(echo "$dt" | head -n 1 | sed 's, [A-Z][a-z]*$,,')" +%s)"
+dt2="$(date -u -d "$(echo "$dt" | tail -n 1 | sed 's, [A-Z][a-z]*$,,')" +%s)"
# Ignore QEMU bug
if [ "${grub_modinfo_target_cpu}" = arm ] && [ $((dt2 - dt1)) -ge 15 ] && [ $((dt2 - dt1)) -le 17 ]; then