Commit b09af1b8 authored by Emanuele Aina's avatar Emanuele Aina

apparmor: Switch to aa_log_extract_tokens.sh in run-aa-test

Update the `run-aa-test` script to use the new shell/awk based
`aa_log_extract_tokens.sh` implementation instead of the old Perl-based one.

This affects the follwing testcases:
* apparmor-geoclue
* apparmor-ofono
* apparmor-tracker
Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent e4e9e3e7
......@@ -118,7 +118,7 @@ print('#--->8---')
raw_expected = open(argv[1]).readlines()
print('#---8<--- expected output from aa_log_extract_tokens.pl')
print('#---8<--- expected output from aa_log_extract_tokens.sh')
for line in raw_expected:
print('# ' + line.rstrip('\n'))
print('#--->8---')
......@@ -128,18 +128,18 @@ expected = ''.join(raw_expected)
if ALTERNATIVE_SEPARATOR in expected:
expected = expected.split(ALTERNATIVE_SEPARATOR)
aa_parse = Popen(['/usr/bin/aa_log_extract_tokens.pl', 'REJECTING'],
aa_parse = Popen(['/usr/bin/aa_log_extract_tokens.sh', 'DENIED'],
stdin=PIPE,
stdout=PIPE,
universal_newlines=True)
output = aa_parse.communicate(input=''.join(log))[0].splitlines(True)
if aa_parse.returncode != 0:
print('# aa_log_extract_tokens.pl failed, trying line-by-line...')
print('# aa_log_extract_tokens.sh failed, trying line-by-line...')
output = []
for line in log:
aa_parse = Popen(['/usr/bin/aa_log_extract_tokens.pl', 'REJECTING'],
aa_parse = Popen(['/usr/bin/aa_log_extract_tokens.sh', 'DENIED'],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE,
......@@ -155,7 +155,7 @@ if aa_parse.returncode != 0:
if aa_parse.returncode != 0:
output.append('^ original line: %s' % line)
print('#---8<--- actual output from aa_log_extract_tokens.pl')
print('#---8<--- actual output from aa_log_extract_tokens.sh')
for line in output:
if line:
print('# ' + line.rstrip('\n'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment