Merge regression tests: check for setfattr binary used by xattrs_profile

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1412
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
This commit is contained in:
John Johansen 2024-11-07 03:27:28 +00:00
commit 0828ab67b2

View file

@ -151,8 +151,7 @@ SRC=access.c \
unlink.c \
userns.c \
userns_setns.c \
xattrs.c \
xattrs_profile.c
xattrs.c
#only do the ioperm/iopl tests for x86 derived architectures
ifneq (,$(findstring $(shell uname -i),i386 i486 i586 i686 x86 x86_64))
@ -165,6 +164,17 @@ ifeq ($(USE_SYSCTL),true)
SRC+=syscall_sysctl.c
endif
# Only do xattrs_profile test if we have the required setfattr binary
ifneq (,$(shell which -s setfattr && echo TRUE))
SRC+=xattrs_profile.c
else
$(warning ${nl}\
************************************************************************${nl}\
No setfattr skipping xattrs_profile tests ...${nl}\
Install attr or equivalent package to build and run this test${nl}\
************************************************************************${nl})
endif
#only do dbus if proper libs are installl
ifneq (,$(shell pkg-config --exists dbus-1 && echo TRUE))
SRC+=dbus_eavesdrop.c dbus_message.c dbus_service.c dbus_unrequested_reply.c
@ -279,10 +289,14 @@ TESTS=aa_exec \
unlink\
userns\
xattrs\
xattrs_profile\
longpath \
nfs
# Only do xattrs_profile test if we have the required setfattr binary
ifneq (,$(shell which -s setfattr && echo TRUE))
TESTS+=xattrs_profile
endif
#only do dbus if proper libs are installl
ifneq (,$(shell pkg-config --exists dbus-1 && echo TRUE))
TESTS+=dbus_eavesdrop dbus_message dbus_service dbus_unrequested_reply