From d19db55a37047d570f0dce5e8f8c3c1a6c7968fd Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Tue, 12 Mar 2024 19:37:29 +0100 Subject: [PATCH] Fix test-aa-notify on openSUSE Tumbleweed (new 'last') The new 2037-proof `last` on openSUSE Tumbleweed doesn't support the `-1` option. Remove it, and cut off the output manually. --- utils/test/test-aa-notify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/test/test-aa-notify.py b/utils/test/test-aa-notify.py index 6635f154e..4f3e540e9 100644 --- a/utils/test/test-aa-notify.py +++ b/utils/test/test-aa-notify.py @@ -140,7 +140,8 @@ Feb 4 13:40:38 XPS-13-9370 kernel: [128552.880347] audit: type=1400 audit({epoc if 'SUDO_USER' in os.environ: username = os.environ.get('SUDO_USER') - return_code, output = cmd(['last', '-1', username, '--time-format', 'iso']) + return_code, output = cmd(['last', username, '--time-format', 'iso']) + output = output.split('\n')[0] # the first line is enough # example of output: # ubuntu tty7 :0 2024-01-05T14:29:11-03:00 gone - no logout if output.startswith(username):