apparmor:fix-dirtest

Last commit made on 2022-07-25
Get this branch:
git clone -b fix-dirtest https://git.launchpad.net/apparmor

Branch merges

Branch information

Name:
fix-dirtest
Repository:
lp:apparmor

Recent commits

c0815d0... by intrigeri

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.

c0b5d90... by Christian Boltz

Merge Resolve "Python: Ensure opened files are closed."

This MR closes #239. In the temporary file commit, `tempfile.NamedTemporaryFile` is preferred over `tempfile.mkstemp` because it allows for simpler use of context managers and lets you choose what mode to open the file in. Also in this commit, note that in `aa.py` and `easyprof.py` destination files are now written directly, instead of writing to temp files and then renaming them.

Closes #239
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/898
Approved-by: Christian Boltz <email address hidden>
Merged-by: Christian Boltz <email address hidden>

e6cbdef... by Mark Grassi

Implement code review comments.

ea0dc96... by Christian Boltz

Merge Support setuptools >= 61.2 in Python tests

Fix for #253, by mirroring the change from https://github.com/pypa/setuptools/pull/3258/commits/1c23f5e1e4b18b50081cbabb2dea22bf345f5894

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/897
Approved-by: Christian Boltz <email address hidden>
Merged-by: Christian Boltz <email address hidden>

d442584... by Ben Greiner <email address hidden>

reviewed edits

cf6606d... by Mark Grassi

Ensure opened temporary files are closed.

85734c3... by Ben Greiner <email address hidden>

add setuptools to test-utils CI job

47d68da... by Ben Greiner <email address hidden>

use new build_platlib path with setuptools >= 61.2

0c1eb3e... by Mark Grassi

Ensure opened files are closed.

97bd86c... by Christian Boltz

Merge Remove Python 2 support.

Per the discussion in #243, this MR removes Python 2 compatibility. Namely, this merge request:
- removes code behind `sys` and `platform` interpreter version checks
- removes `unicode` vs. `str` handling
- removes unnecessary `__future__` imports
- removes unnecessary `object` inheritance
- removes unnecessary `super()` arguments
- uncomments commented-out code with "uncomment when python3 only" notes or some variant of that message

Regarding the `unicode` vs. `str` handling, it's arguably more Pythonic to check `isinstance(x, str)` as opposed to `type(x) is str`, but I didn't want to alter code behavior.

A change needs to be made to the `INCOMPLETE_COVERAGE` setting in `utils/test/Makefile` to get the pipeline to pass. I didn't get anywhere tweaking the setting myself, so someone else with more AppArmor experience will have to make that change.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/894
Approved-by: Christian Boltz <email address hidden>
Merged-by: Christian Boltz <email address hidden>