mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 13:58:22 +00:00
Merge dirtest.sh: error out on unexpected success
... if a test is expected to fail, but succeeds.
Also fix the copyright year - the test was created in 2022, not in 2013.
This fixes my comments on
bd78b6b292
The original MR !850 was merged into 3.0 and master, therefore I also propose this patch for 3.0 and master.
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/868
Approved-by: Jon Tourville <jon.tourville@canonical.com>
Merged-by: Christian Boltz <apparmor@cboltz.de>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013
|
# Copyright (c) 2022
|
||||||
# Canonical, Ltd. (All rights reserved)
|
# Canonical, Ltd. (All rights reserved)
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
@@ -37,6 +37,10 @@ do_tst() {
|
|||||||
echo "failed: expected \"$expected\" but parser returned error"
|
echo "failed: expected \"$expected\" but parser returned error"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
if [ $rc -eq 0 ] && [ "$expected" = "fail" ] ; then
|
||||||
|
echo "succeeded unexpectedly: expected \"$expected\" but parser returned success"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
if ! diff -q "$tmpdir/out" dirtest/dirtest.out ; then
|
if ! diff -q "$tmpdir/out" dirtest/dirtest.out ; then
|
||||||
echo "failed: expected \"$expected\" but output comparison failed"
|
echo "failed: expected \"$expected\" but output comparison failed"
|
||||||
diff -u dirtest/dirtest.out "$tmpdir/out"
|
diff -u dirtest/dirtest.out "$tmpdir/out"
|
||||||
|
Reference in New Issue
Block a user