mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 00:14:44 +01:00
Test suite: don't use fragile "-e with globs" construction
For details, see https://github.com/koalaman/shellcheck/wiki/SC2144.
This commit is contained in:
parent
14d35c651c
commit
398f584710
1 changed files with 10 additions and 2 deletions
|
@ -58,8 +58,16 @@ genprofile_ns_and_verify() {
|
|||
|
||||
[ -d /sys/kernel/security/apparmor/policy/namespaces/${ns} ]
|
||||
local dir_created=$?
|
||||
[ -d /sys/kernel/security/apparmor/policy/namespaces/${ns}/profiles/${prof}* ]
|
||||
local prof_created=$?
|
||||
local prof_created=1
|
||||
for d in /sys/kernel/security/apparmor/policy/namespaces/${ns}/profiles/${prof}*; do
|
||||
if [ -d "$d" ]; then
|
||||
prof_created=0
|
||||
fi
|
||||
# Either $d exists and we've set prof_created to 0. Or it does
|
||||
# not, because its value is the unexpanded pattern above.
|
||||
# Either way, this is all we needed to know.
|
||||
break
|
||||
done
|
||||
removeprofile
|
||||
if [ $dir_created -ne 0 ]; then
|
||||
echo "Error: ${testname} failed. Test '${desc}' did not create the expected namespace directory in apparmorfs: policy/namespaces/${ns}"
|
||||
|
|
Loading…
Add table
Reference in a new issue