From 6e1a694b541d97f6365d99f46c021f9e08087925 Mon Sep 17 00:00:00 2001 From: Matus Marhefka Date: Mon, 4 Nov 2024 11:30:45 +0100 Subject: [PATCH] Update test_xccdf_values_in_ds.sh to account for Bash variables Bash variables whose names start with `$XCCDF_VALUE_` are valid in SCE content. The `$XCCDF_VALUE_` variables are exported by `oscap` so that the SCE check can use XCCDF Values in its code. --- tests/test_xccdf_values_in_ds.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_xccdf_values_in_ds.sh b/tests/test_xccdf_values_in_ds.sh index 17a1c953cbb..45d8757cc15 100755 --- a/tests/test_xccdf_values_in_ds.sh +++ b/tests/test_xccdf_values_in_ds.sh @@ -5,7 +5,7 @@ if grep -iq "dangling reference to" "$DS" ; then printf "Found dangling reference in %s, ensure correct usage of the xccdf_value Jinja macro!" "$DS" >&2 exit 1 fi -if grep -iq "xccdf_value" "$DS" ; then +if grep -iq "[^$]xccdf_value" "$DS" ; then printf "Found obtrusive xccdf_value in %s, ensure correct usage of the xccdf_value Jinja macro!" "$DS" >&2 exit 1 fi