3.0.0 make -C utils check fails on hardcoded absolute path and "persists" log file to volatile directory
When building apparmor 3.0.0 for Arch Linux I ran into several issues running the tests for the utils:
=== test-aa-notify.py ===
.Fs.s
======================================================================
FAIL: test_entries_since_login (__main__.AANotifyTest)
Test showing log entries since last login
----------------------------------------------------------------------
Traceback (most recent call last):
File "test-aa-notify.py", line 202, in test_entries_since_login
self.assertEqual(expected_return_code, return_code, result + output)
AssertionError: 0 != 1 : Got return code 1, expected 0
Traceback (most recent call last):
File "../aa-notify", line 569, in <module>
main()
File "../aa-notify", line 559, in main
show_entries_since_last_login(logfile)
File "../aa-notify", line 189, in show_entries_since_last_login
epoch_since = get_last_login_timestamp(username)
File "../aa-notify", line 72, in get_last_login_timestamp
with open(filename, "rb") as wtmp_file:
FileNotFoundError: [Errno 2] No such file or directory: '/var/log/wtmp'
An unexpected error occoured!
For details, see /tmp/apparmor-bugreport-c97w5jag.txt
Please consider reporting a bug at https://gitlab.com/apparmor/apparmor/-/issues
and attach this file.
It seems that https://gitlab.com/apparmor/apparmor/-/blob/master/utils/test/test-aa-notify.py#L192-204 also needs to be guarded by a skipUnless
decorator.
Additionally, as we build in pristine systemd-nspawn containers, the bug report file mentioned in the error message above is gone before I can even grab it. Please make sure to persist it to a non-volatile location.