2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 22:35:35 +00:00

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 <georgia.garcia@canonical.com>
(cherry picked from commit b4adff2ce0)
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
Georgia Garcia
2024-12-06 15:32:23 -03:00
committed by John Johansen
parent e9858c0c43
commit 4e46df38cf

View File

@@ -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"