Mark Grassi
c57138f255
Order imports and module-level dunder name assignments.
2022-08-21 11:15:07 -04:00
Mark Grassi
96f7121944
Fix most PEP 8 whitespace, indentation, and major line length violations.
2022-08-21 11:15:07 -04:00
Mark Grassi
7581c9e113
Speed up list creations, and change lists to tuples where appropriate..
2022-06-26 22:18:56 -04:00
Mark Grassi
ca9920cf92
Avoid unnecessary memory copies when enlarging lists.
2022-06-26 12:06:22 +00:00
Christian Boltz
3f752fac5f
Ensure empty stderr if no errors are expected
...
... instead of not checking stderr if it's expected to be empty.
2020-10-04 19:51:54 +02:00
Christian Boltz
37552669d4
Test for full parser error messages, not parts
...
By using assertIn, we test if a given message is contained in the parser
error message. This can (and actually does) hide errors if the error
message changes outside the checked part.
Change the test to assertEqual to test the full error message, and add
'\n' to all expected error messages to make them still match.
Depending on the kernel version and patches, there can be an additional
message
Cache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.)
which will be ignored by the check.
2020-10-04 19:51:54 +02:00
John Johansen
761008f1b6
parser: fix yyerror message to not duplicate file name output
...
yyerror is outputting the file name twice when not in a profile or
the profilename global is not defined. Drop the second output of
the file name as it just clutters up the error message.
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/610
Signed-off-by: John Johansen <john.johansen@canonical.com >
Acked-by: Mike Salvatore <mike.salvatore@canonical.com >
2020-09-03 07:19:21 -07:00
John Johansen
c530c880b1
parser: Add warning flag that can toggle deprecation warnings
...
Add the flag
--warn=deprecated
to be able to toggle deprecation warnings
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/600
Signed-off-by: John Johansen <john.johansen@canonical.com >
2020-09-01 19:42:38 -07:00
Steve Beattie
5574af0390
parser tests: convert makefile error tests to python script
...
Make the error and warning message tests a first class test script; in
gitlab CI, failures would not necessarily result in output being
captured.
Signed-off-by: Steve Beattie <steve.beattie@canonical.com >
Acked-by: John Johansen <john.johansen@canonical.com >
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/522
2020-05-08 15:44:41 -07:00