This patch fixes the equality test script and the valgrind wrapper
script to make the parser under test use the features.all features file
from the features_files/ subdirectory. Otherwise, the equality tests
will fail on systems where the not all of the current language features
are supported. The equality fix does so in a way to make the script work
correctly regardless of the directory it is run from.

Signed-off-by: Steve Beattie <[email protected]> for trunk and 2.9
---
 parser/tst/equality.sh        |    6 ++++--
 parser/tst/valgrind_simple.py |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

Index: b/parser/tst/valgrind_simple.py
===================================================================
--- a/parser/tst/valgrind_simple.py
+++ b/parser/tst/valgrind_simple.py
@@ -42,7 +42,7 @@ class AAParserValgrindTests(testlib.AATe
         self.maxDiff = None
 
     def _runtest(self, testname, config):
-        parser_args = ['-Q', '-I', config.testdir]
+        parser_args = ['-Q', '-I', config.testdir, '-M', 
'./features_files/features.all']
         failure_rc = [VALGRIND_ERROR_CODE, testlib.TIMEOUT_ERROR_CODE]
         command = [config.valgrind]
         command.extend(VALGRIND_ARGS)
Index: b/parser/tst/equality.sh
===================================================================
--- a/parser/tst/equality.sh
+++ b/parser/tst/equality.sh
@@ -22,13 +22,15 @@
 
 set -o pipefail
 
-APPARMOR_PARSER="${APPARMOR_PARSER:-../apparmor_parser}"
+_SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}" )
+
+APPARMOR_PARSER="${APPARMOR_PARSER:-${_SCRIPTDIR}/../apparmor_parser}"
 fails=0
 errors=0
 
 hash_binary_policy()
 {
-       printf %s "$1" | ${APPARMOR_PARSER} -qS 2>/dev/null| md5sum | cut -d ' 
' -f 1
+       printf %s "$1" | ${APPARMOR_PARSER} --features-file 
${_SCRIPTDIR}/features_files/features.all -qS 2>/dev/null| md5sum | cut -d ' ' 
-f 1
        return $?
 }
 
-- 
Steve Beattie
<[email protected]>
http://NxNW.org/~steve/

Attachment: signature.asc
Description: Digital signature

-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to