* tests/grub_cmd_date.in: New test for datetime.
This commit is contained in:
parent
f9d4005539
commit
e3734b84cf
3 changed files with 22 additions and 0 deletions
|
@ -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.
|
||||||
|
|
|
@ -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
12
tests/grub_cmd_date.in
Normal 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"
|
Loading…
Reference in a new issue