mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 00:14:44 +01:00
dirtest.sh: don't rely on apparmor_parser -N's output sort order to be deterministic
I've seen this test fail because "apparmor_parser -N" returned the expected lines, but in a different order than what's expected (dirtest.out). To fix this, sort both the expected and actual output.
This commit is contained in:
parent
c0b5d90848
commit
c0815d0e0f
2 changed files with 3 additions and 2 deletions
|
@ -31,8 +31,9 @@ do_tst() {
|
|||
shift 2
|
||||
#global tmpdir
|
||||
|
||||
${APPARMOR_PARSER} "$@" > "$tmpdir/out" 2>/dev/null
|
||||
${APPARMOR_PARSER} "$@" > "$tmpdir/out.unsorted" 2>/dev/null
|
||||
rc=$?
|
||||
LC_ALL=C sort "$tmpdir/out.unsorted" > "$tmpdir/out"
|
||||
if [ $rc -ne 0 ] && [ "$expected" != "fail" ] ; then
|
||||
echo "failed: expected \"$expected\" but parser returned error"
|
||||
return 1
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
good_target
|
||||
a_profile
|
||||
b_profile
|
||||
good_target
|
||||
|
|
Loading…
Add table
Reference in a new issue