Skip to content

Commit efef394

Browse files
committed
Sanitize tests conf
1 parent 6f5074f commit efef394

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

devops/scripts/benchmarking/benchmark.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ build_compute_bench() {
4949
while IFS= read -r case; do
5050
# Skip lines starting with '#'
5151
[ "${case##\#*}" ] || continue
52+
53+
if [ -n "$(printf "%s" "$case" | sed "s/[a-zA-Z_]*//g")" ]; then
54+
echo "Illegal characters in $TESTS_CONFIG."
55+
exit 1
56+
fi
5257
# TODO Sanitize this
5358
make "-j$SANITIZED_COMPUTE_BENCH_COMPILE_JOBS" "$case"
5459
done < "$TESTS_CONFIG"
@@ -150,6 +155,10 @@ process_benchmarks() {
150155
# Loop through each line of enabled_tests.conf, but ignore lines in the
151156
# test config starting with #'s:
152157
grep "^[^#]" "$TESTS_CONFIG" | while read -r testcase; do
158+
if [ -n "$(printf "%s" "$testcase" | sed "s/[a-zA-Z_]*//g")" ]; then
159+
echo "Illegal characters in $TESTS_CONFIG."
160+
exit 1
161+
fi
153162
echo "# Running $testcase..."
154163

155164
# The benchmark results git repo and this script's output both share

0 commit comments

Comments
 (0)