From 0f2a33e7fbd4dd9e0c65f6188e15d5693fc11ed1 Mon Sep 17 00:00:00 2001 From: Alex Murray Date: Wed, 11 Aug 2021 17:57:11 +0930 Subject: [PATCH] regression tests: fix aa_policy_cache when using system parser When using the system parser ${parser_config} will be empty and so if this is unconditionally passed as an argument to the parser then this gets in interpreted as the name of a file to be compiled and hence the parser just prints: File not found, skipping... File not found, skipping... File not found, skipping... ... for all the aa_policy_cache tests - instead fix this to pass a single args argument to the parser which will only include parser_config if it is not empty. This fixes the regression tests to run to completion without error when USE_SYSTEM=1 is set. Signed-off-by: Alex Murray --- tests/regression/apparmor/aa_policy_cache.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/regression/apparmor/aa_policy_cache.sh b/tests/regression/apparmor/aa_policy_cache.sh index 6fe97e470..fe13ff831 100755 --- a/tests/regression/apparmor/aa_policy_cache.sh +++ b/tests/regression/apparmor/aa_policy_cache.sh @@ -56,7 +56,13 @@ create_cache_files() do cachefile="${cachedir}/${policy}" - echo "profile $policy { /f r, }" | ${subdomain} "${parser_config}" -qS > "$cachefile" + args="-qS" + if [ -n "${parser_config}" ] + then + args="${args} ${parser_config}" + fi + echo "profile $policy { /f r, }" | ${subdomain} "${args}" > "$cachefile" + done }