* tests/grub_cmd_date.in: New test for datetime.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-04-12 01:47:38 +02:00
parent f9d4005539
commit e3734b84cf
3 changed files with 22 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
* tests/grub_cmd_date.in: New test for datetime.
2013-04-12 Vladimir Serbinenko <phcoder@gmail.com> 2013-04-12 Vladimir Serbinenko <phcoder@gmail.com>
* tests/partmap_test.in: Fix missing qemudisk setting. * tests/partmap_test.in: Fix missing qemudisk setting.

View file

@ -674,6 +674,12 @@ script = {
common = tests/grub_cmd_regexp.in; common = tests/grub_cmd_regexp.in;
}; };
script = {
testcase;
name = grub_cmd_date;
common = tests/grub_cmd_date.in;
};
script = { script = {
testcase; testcase;
name = grub_script_expansion; name = grub_script_expansion;

12
tests/grub_cmd_date.in Normal file
View file

@ -0,0 +1,12 @@
#! /bin/bash
set -e
pdt="$(date -u +%s)"
dt=`echo date | @builddir@/grub-shell`
dtg="$(date -u -d "$dt" +%s)"
ndt="$(date -u +%s)"
if [ $pdt -le $dtg ] && [ $dtg -le $ndt ]; then
exit 0;
fi
echo "Date not in range: $pdt <= $dtg <= $ndt"