summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlan Dunn <amdunn@google.com>2016-03-02 08:59:03 -0800
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-04-26 12:56:36 +1000
commit013bf20025957f1b812f0c6e50f8d7afa215e1a3 (patch)
treeb8b6285f1c9eb703f03e0734833156e2b3a4f890 /test
parent9f0f86150e9bf14760e155768dcb7df682257327 (diff)
downloadtalos-petitboot-013bf20025957f1b812f0c6e50f8d7afa215e1a3.zip
talos-petitboot-013bf20025957f1b812f0c6e50f8d7afa215e1a3.tar.gz
Allow evaluation of arbitrarily-positioned arguments in GRUB2 parser
GRUB2 allows essentially arbitrary numbers of positional arguments, so ensure that they can be evaluated within scripts. GRUB2 also appears to support arbitrary numbers of leading 0's in positional parameters (i.e., $01 should evalute the same as $1), but this doesn't seem like a particularly important case to support. Tested: Modified test-grub2-pos-param to cover higher-numbered positional arguments. Signed-off-by: Alan Dunn <amdunn@google.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'test')
-rw-r--r--test/parser/test-grub2-pos-param.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/parser/test-grub2-pos-param.c b/test/parser/test-grub2-pos-param.c
index 09ac8fc..36447ff 100644
--- a/test/parser/test-grub2-pos-param.c
+++ b/test/parser/test-grub2-pos-param.c
@@ -4,10 +4,10 @@
#if 0 /* PARSER_EMBEDDED_CONFIG */
function set_params_var {
- params="$1 $2"
+ params="$1 $2 $10"
}
menuentry 'Linux' {
- set_params_var abc 123
+ set_params_var abc 123 3 4 5 6 7 8 9 bingo
linux test_kernel $params
}
@@ -31,5 +31,5 @@ void run_test(struct parser_test *test)
/* The linux command, $params is expected to have been set when
* set_params was called in menuentry.
*/
- check_args(opt, "abc 123");
+ check_args(opt, "abc 123 bingo");
}
OpenPOWER on IntegriCloud