Skip to content

Commit fefe4a9

Browse files
theyoyojoPINP
authored andcommitted
redhat: add all namespace-dependent selftests to kernel-selftests-internal
Upstream Status: RHEL-only ARK commit: b96bc78d0727ac28dae7d21b0930fd76e48f3696 JIRA: https://issues.redhat.com/browse/RHEL-122506 Utilizing the output of the following script: SORTED_TEST_FILENAMES=$(mktemp) PATTERNS=( ".*CLONE_NEW.*" ".*setns.*" ".*unshare.*" ".*/proc/.*/ns.*" ) KERNEL_TREE=${KERNEL_TREE:-/home/jsavitz/src/centos-stream-10} pushd "$KERNEL_TREE" > /dev/null for P in "${PATTERNS[@]}"; do git grep "$P" tools/testing/selftests/ | \ awk -F':' '{print $1}' | \ sed 's/tools\/testing\/selftests\///g' | \ grep -vE "(gitignore|Makefile)" done | sort | uniq > "$SORTED_TEST_FILENAMES" for t in $(cat "$SORTED_TEST_FILENAMES"); do echo "$t" grep -oE '(CLONE_NEW[[:alpha:]]*|/proc/.*/ns/[[:alpha:]]*)' tools/testing/selftests/"$t" echo "--" done | awk -F'\n' -v RS='\n--\n' '{ for (i = 2; i <= NF; i++) { print $i " " $1 } }' | sort | uniq popd > /dev/null And piping the results into this script: while read -r tline; do echo ${tline} | awk -F'/' ' BEGIN {RS=" "} {if (NR==2) print $1 } ' done | sort | uniq I came up with a list of all selftests that have any interaction with the namespace subsytem. Add any not already present in kernel-modules-internal to the package. These tests will be used by CKI to add further targeted testing to the kernel namespace subsystem. Signed-off-by: Joel Savitz <jsavitz@redhat.com>
1 parent 3fddb92 commit fefe4a9

File tree

1 file changed

+103
-1
lines changed

1 file changed

+103
-1
lines changed

redhat/kernel.spec.template

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3256,7 +3256,7 @@ pushd tools/testing/selftests
32563256
export CFLAGS="%{build_cflags}"
32573257
export CXXFLAGS="%{build_cxxflags}"
32583258

3259-
TARGETS="bpf cgroup kmod mm net net/forwarding net/mptcp net/netfilter net/packetdrill tc-testing memfd drivers/net/hw iommu cachestat pid_namespace rlimits timens pidfd"
3259+
TARGETS="bpf cgroup kmod mm net net/forwarding net/mptcp net/netfilter net/packetdrill tc-testing memfd drivers/net/hw iommu cachestat pid_namespace rlimits timens pidfd capabilities clone3 exec filesystems firmware landlock mount mount_setattr move_mount_set_group nsfs openat2 proc safesetid seccomp tmpfs uevent vDSO"
32603260
%{make} %{?_smp_mflags} EXTRA_CFLAGS="${RPM_OPT_FLAGS}" EXTRA_CXXFLAGS="${RPM_OPT_FLAGS}" EXTRA_LDFLAGS="%{__global_ldflags}" ARCH=$Arch V=1 TARGETS="$TARGETS" SKIP_TARGETS="" $force_targets VMLINUX_H="${RPM_VMLINUX_H}"
32613261

32623262
# Restore the original level of source fortification
@@ -3704,6 +3704,108 @@ find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/pidfd/{} \;
37043704
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/pidfd/{} \;
37053705
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/pidfd/{} \;
37063706
popd
3707+
# install capabilities selftests
3708+
pushd tools/testing/selftests/capabilities
3709+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/capabilities/{} \;
3710+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/capabilities/{} \;
3711+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/capabilities/{} \;
3712+
popd
3713+
# install clone3 selftests
3714+
pushd tools/testing/selftests/clone3
3715+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/clone3/{} \;
3716+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/clone3/{} \;
3717+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/clone3/{} \;
3718+
popd
3719+
# install exec selftests
3720+
pushd tools/testing/selftests/exec
3721+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/exec/{} \;
3722+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/exec/{} \;
3723+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/exec/{} \;
3724+
popd
3725+
# install filesystems selftests
3726+
pushd tools/testing/selftests/filesystems
3727+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/filesystems/{} \;
3728+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/filesystems/{} \;
3729+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/filesystems/{} \;
3730+
popd
3731+
# install firmware selftests
3732+
pushd tools/testing/selftests/firmware
3733+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/firmware/{} \;
3734+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/firmware/{} \;
3735+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/firmware/{} \;
3736+
popd
3737+
# install landlock selftests
3738+
pushd tools/testing/selftests/landlock
3739+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/landlock/{} \;
3740+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/landlock/{} \;
3741+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/landlock/{} \;
3742+
popd
3743+
# install mount selftests
3744+
pushd tools/testing/selftests/mount
3745+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/mount/{} \;
3746+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/mount/{} \;
3747+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/mount/{} \;
3748+
popd
3749+
# install mount_setattr selftests
3750+
pushd tools/testing/selftests/mount_setattr
3751+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/mount_setattr/{} \;
3752+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/mount_setattr/{} \;
3753+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/mount_setattr/{} \;
3754+
popd
3755+
# install move_mount_set_group selftests
3756+
pushd tools/testing/selftests/move_mount_set_group
3757+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/move_mount_set_group/{} \;
3758+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/move_mount_set_group/{} \;
3759+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/move_mount_set_group/{} \;
3760+
popd
3761+
# install nsfs selftests
3762+
pushd tools/testing/selftests/nsfs
3763+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/nsfs/{} \;
3764+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/nsfs/{} \;
3765+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/nsfs/{} \;
3766+
popd
3767+
# install openat2 selftests
3768+
pushd tools/testing/selftests/openat2
3769+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/openat2/{} \;
3770+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/openat2/{} \;
3771+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/openat2/{} \;
3772+
popd
3773+
# install proc selftests
3774+
pushd tools/testing/selftests/proc
3775+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/proc/{} \;
3776+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/proc/{} \;
3777+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/proc/{} \;
3778+
popd
3779+
# install safesetid selftests
3780+
pushd tools/testing/selftests/safesetid
3781+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/safesetid/{} \;
3782+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/safesetid/{} \;
3783+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/safesetid/{} \;
3784+
popd
3785+
# install seccomp selftests
3786+
pushd tools/testing/selftests/seccomp
3787+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/seccomp/{} \;
3788+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/seccomp/{} \;
3789+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/seccomp/{} \;
3790+
popd
3791+
# install tmpfs selftests
3792+
pushd tools/testing/selftests/tmpfs
3793+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/tmpfs/{} \;
3794+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/tmpfs/{} \;
3795+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/tmpfs/{} \;
3796+
popd
3797+
# install uevent selftests
3798+
pushd tools/testing/selftests/uevent
3799+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/uevent/{} \;
3800+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/uevent/{} \;
3801+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/uevent/{} \;
3802+
popd
3803+
# install vDSO selftests
3804+
pushd tools/testing/selftests/vDSO
3805+
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/vDSO/{} \;
3806+
find -type f -executable -exec install -D -m755 {} %{buildroot}%{_libexecdir}/kselftests/vDSO/{} \;
3807+
find -type f ! -executable -exec install -D -m644 {} %{buildroot}%{_libexecdir}/kselftests/vDSO/{} \;
3808+
popd
37073809
%endif
37083810

37093811
###

0 commit comments

Comments
 (0)