From: Nico Pache <npache(a)redhat.com>
redhat: Enable VM kselftests
in order to increase code coverage for HMM and GUP we need to build the
vm kselftests into our internal testing packages.
Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1978539
Upstream-status: RHEL-only
Signed-off-by: Nico Pache <npache(a)redhat.com>
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -2297,7 +2297,7 @@ export BPFTOOL=$(pwd)/tools/bpf/bpftool/bpftool
pushd tools/testing/selftests
# We need to install here because we need to call make with ARCH set which
# doesn't seem possible to do in the install section.
-%{make} %{?_smp_mflags} ARCH=$Arch V=1 TARGETS="bpf livepatch net net/forwarding
net/mptcp netfilter tc-testing" SKIP_TARGETS=""
INSTALL_PATH=%{buildroot}%{_libexecdir}/kselftests VMLINUX_H="${RPM_VMLINUX_H}"
install
+%{make} %{?_smp_mflags} ARCH=$Arch V=1 TARGETS="bpf vm livepatch net net/forwarding
net/mptcp netfilter tc-testing" SKIP_TARGETS=""
INSTALL_PATH=%{buildroot}%{_libexecdir}/kselftests VMLINUX_H="${RPM_VMLINUX_H}"
install
# 'make install' for bpf is broken and upstream refuses to fix it.
# Install the needed files manually.
@@ -2577,6 +2577,12 @@ find . -type f -executable -exec install -m755 {}
%{buildroot}%{_libexecdir}/ksa
find . -type f ! -executable -exec install -m644 {}
%{buildroot}%{_libexecdir}/ksamples/pktgen/{} \;
popd
popd
+# install vm selftests
+pushd tools/testing/selftests/vm
+find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/vm/{} \;
+find -type f -executable -exec install -D -m755 {}
%{buildroot}%{_libexecdir}/kselftests/vm/{} \;
+find -type f ! -executable -exec install -D -m644 {}
%{buildroot}%{_libexecdir}/kselftests/vm/{} \;
+popd
# install drivers/net/mlxsw selftests
pushd tools/testing/selftests/drivers/net/mlxsw
find -type d -exec install -d %{buildroot}%{_libexecdir}/kselftests/drivers/net/mlxsw/{}
\;
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1783