From 4e46df38cfdedf7795eee2468b412652d81f9f48 Mon Sep 17 00:00:00 2001 From: Georgia Garcia Date: Fri, 6 Dec 2024 15:32:23 -0300 Subject: [PATCH] tests: fix profile name when wrapper is specified When settest was called with two parameters, one for the test name and the other for the test wrapper/binary, the profile created with genprofile would show the test name, causing an error if the file didn't exist. Signed-off-by: Georgia Garcia (cherry picked from commit b4adff2ce03e936cfac1742b655cdb74284dd211) Signed-off-by: John Johansen --- tests/regression/apparmor/prologue.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/regression/apparmor/prologue.inc b/tests/regression/apparmor/prologue.inc index 18a01c740..cc8564888 100755 --- a/tests/regression/apparmor/prologue.inc +++ b/tests/regression/apparmor/prologue.inc @@ -456,7 +456,7 @@ fi while /bin/true do - imagename=$test + imagename=$testbin # image/subhat allows overriding of the default # imagename which is based on the testname @@ -632,6 +632,11 @@ settest() fatalerror "settest, illegal usage" fi + # store testbin name from testexec so that testexec represents + # what will be executed - allowing for a change of username + # with sudo -u + testbin=$testexec + if [ ! -z "$username" ] then testexec="sudo -u $username $testexec"