From e1f2f1ebb5e4a88f3145782a0cb3d8ba8fa1f929 Mon Sep 17 00:00:00 2001 From: zhang-mingyi66 Date: Thu, 30 Mar 2023 06:58:21 +0800 Subject: [PATCH] add test --- libbpf.spec | 12 +++++++++--- test.sh | 25 +++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100755 test.sh diff --git a/libbpf.spec b/libbpf.spec index d0ac48a..45a7170 100644 --- a/libbpf.spec +++ b/libbpf.spec @@ -4,13 +4,13 @@ Name: %{githubname} Version: %{githubver} -Release: 7 +Release: 8 Summary: Libbpf library License: LGPLv2 or BSD URL: https://github.com/%{githubname}/%{githubname} Source: https://github.com/%{githubname}/%{githubname}/archive/%{githubname}-%{githubver}.tar.gz -BuildRequires: gcc elfutils-libelf-devel elfutils-devel +BuildRequires: gcc elfutils-libelf-devel elfutils-devel kernel-source #patches Patch0000: backport-libbpf-Fix-determine_ptr_size-guessing.patch @@ -67,6 +67,9 @@ developing applications that use %{name} %install %make_install -C ./src %{make_flags} +%check +/bin/bash ../../SOURCES/test.sh + %files %{_libdir}/libbpf.so.0.3.0 %{_libdir}/libbpf.so.0 @@ -79,7 +82,10 @@ developing applications that use %{name} %files static %{_libdir}/libbpf.a -%changelog +%changelogi +* Sat Apr 1 2023 zhangmingyi - 2:0.3-8 +- test + * Wed Mar 22 2023 zhangmingyi - 2:0.3-7 - fix use undefine function diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..9269ff4 --- /dev/null +++ b/test.sh @@ -0,0 +1,25 @@ + + + +wget https://gitee.com/openeuler/kernel/repository/archive/openEuler-22.03-LTS.zip + +yum install git +cat /etc/yum.repos.d/*.repos | grep baseurl +yum install kernel.src +git clone http://gitee.com/openeuler/kernel.git + +cd kernel/tools/testing/selftest/bpf/ +rpm -qa kernel-source +cd /usr/src +ls +KERNEL_DIR=$(rpm -qa kernel-source) +KERNEL_DIR=linux${KERNEL_DIR#kernel-source} +cd /usr/src/$KERNEL_DIR +cd tools/testing/selftests/bpf + +pwd + +make +./test_verifier +./test_maps +./test_progs -- Gitee