kdbus: build and package kdbus-tests 35/256235/1 accepted/tizen/unified/20210401.110012 submit/tizen/20210401.011549
authorŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 29 Mar 2021 08:35:37 +0000 (10:35 +0200)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Wed, 31 Mar 2021 06:05:10 +0000 (08:05 +0200)
Change-Id: Icfcecc2780e6c5cdddaad0440b731ebb9dc49446
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
packaging/linux-rpi3.spec

index 4985a68..f7b4b32 100644 (file)
@@ -80,6 +80,15 @@ Provides: perf = %{fullVersion}
 This package provides the "perf" tool that can be used to monitor performance
 counter events as well as various kernel internal events.
 
+%package -n linux-kernel-kdbus-tests
+License:       Apache-2.0
+Summary:       Kdbus tests
+Group:         Base/IPC
+BuildRequires: libcap-devel
+
+%description -n linux-kernel-kdbus-tests
+A single binary that tests kdbus operation.
+
 %prep
 %setup -q
 
@@ -87,6 +96,10 @@ counter events as well as various kernel internal events.
 %{?asan:/usr/bin/gcc-unforce-options}
 %{?ubsan:/usr/bin/gcc-unforce-options}
 
+# 0. extract uapi headers
+make headers_check %{?_smp_mflags}
+make headers_install %{?_smp_mflags}
+
 # 1-1. Set config file
 make %{config_name} %{?_smp_mflags}
 if ! grep -q "^CONFIG_LOCALVERSION=\"-%{variant}" .config; then
@@ -106,6 +119,9 @@ make modules %{?_smp_mflags}
 make -s -C tools/lib/traceevent %{?_smp_mflags} NO_LIBPERL=1
 make -s -C tools/perf EXTRA_CFLAGS="-fPIE -rdynamic" %{?_smp_mflags} NO_LIBPERL=1
 
+# 1-6. Additionally, build kdbus tests
+make -C tools/testing/selftests/kdbus
+
 %install
 QA_SKIP_BUILD_ROOT="DO_NOT_WANT"; export QA_SKIP_BUILD_ROOT
 
@@ -144,6 +160,11 @@ rm -rf %{buildroot}/usr/lib/debug
 rm -rf %{buildroot}/usr/lib/perf
 rm -rf %{buildroot}/usr/share
 
+# 2-6. install kdbus tests
+%define _test_runner_dir /usr/lib/dbus-tests/runner
+make -C tools/testing/selftests/kdbus INSTALL_PATH=%{buildroot}%{_test_runner_dir} install
+
+
 # 3. Copy files for devel package
 mkdir -p %{buildroot}/boot/kernel/devel/kernel-devel-%{variant}
 rsync -lr \
@@ -153,6 +174,7 @@ rsync -lr \
     --exclude "/*.manifest" \
     --exclude "/packaging/" \
     --exclude "/.gbs.conf" \
+    --exclude "/usr/include/" \
     --exclude ".gitignore" \
     --exclude "*\.c" \
     --exclude ".tmp_vmlinux*" \
@@ -167,6 +189,7 @@ rsync -lr \
     --exclude "*.o" \
     --exclude "*.S" \
     --exclude "*.HEX" \
+    --exclude "/tools/testing/selftests/kdbus/kdbus-test" \
 %{_builddir}/%{name}-%{version}/ %{buildroot}/boot/kernel/devel/kernel-devel-%{variant}
 
 
@@ -198,3 +221,7 @@ rm -rf %{buildroot}
 /usr/bin/*
 /usr/libexec/*
 /usr/lib/traceevent/*
+
+%files -n linux-kernel-kdbus-tests
+%defattr(-,root,root)
+%{_test_runner_dir}/kdbus-test