From adc4978707497e9196d77c58bb6499c87607b66e Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez-Fernandez Date: Jul 03 2023 10:05:14 +0000 Subject: libbpf-tools: run minimal tests for all tools Signed-off-by: Carlos Rodriguez-Fernandez --- diff --git a/tests/p_libbpf-tools/0_install_libbpf-tools.sh b/tests/p_libbpf-tools/0_install_libbpf-tools.sh new file mode 100755 index 0000000..cdcc57a --- /dev/null +++ b/tests/p_libbpf-tools/0_install_libbpf-tools.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Author: Carlos Rodriguez-Fernandez + +t_Log "Running $0 -installing libbpf-tools." +if [ "$centos_ver" -ge 9 ] ; then + t_InstallPackage libbpf-tools +else + t_Log "Skip on less than EL9" +fi diff --git a/tests/p_libbpf-tools/libbpf-tools_tests.sh b/tests/p_libbpf-tools/libbpf-tools_tests.sh new file mode 100755 index 0000000..9b82eda --- /dev/null +++ b/tests/p_libbpf-tools/libbpf-tools_tests.sh @@ -0,0 +1,129 @@ +#!/bin/bash +# Author: Carlos Rodriguez-Fernandez + +t_Log "Running $0 - libbpf tools" + +if [[ "$centos_ver" -lt 8 ]]; then + t_Log "Running $0 in EL8 or less -> SKIP" + exit 0 +fi + +version_tests=( +"bpf-bindsnoop -V" +"bpf-biolatency -V" +"bpf-biopattern -V" +"bpf-biosnoop -V" +"bpf-biostacks -V" +"bpf-biotop -V" +"bpf-bitesize -V" +"bpf-btrfsdist -V" +"bpf-btrfsslower -V" +"bpf-cachestat -V" +"bpf-capable -V" +"bpf-cpudist -V" +"bpf-cpufreq -V" +"bpf-drsnoop -V" +"bpf-execsnoop -V" +"bpf-exitsnoop -V" +"bpf-ext4dist -V" +"bpf-ext4slower -V" +"bpf-filelife -V" +"bpf-filetop -V" +"bpf-fsdist -V" +"bpf-fsslower -V" +"bpf-funclatency -V" +"bpf-gethostlatency -V" +"bpf-hardirqs -V" +"bpf-javagc -V" +"bpf-killsnoop -V" +"bpf-klockstat -V" +"bpf-ksnoop -V" +"bpf-llcstat -V" +"bpf-mdflush -V" +"bpf-mountsnoop -V" +"bpf-nfsdist -V" +"bpf-nfsslower -V" +"bpf-numamove -V" +"bpf-offcputime -V" +"bpf-oomkill -V" +"bpf-opensnoop -V" +"bpf-readahead -V" +"bpf-runqlat -V" +"bpf-runqlen -V" +"bpf-runqslower -V" +"bpf-sigsnoop -V" +"bpf-slabratetop -V" +"bpf-softirqs -V" +"bpf-solisten -V" +"bpf-statsnoop -V" +"bpf-syscount -V" +"bpf-tcpconnect -V" +"bpf-tcpconnlat -V" +"bpf-tcplife -V" +"bpf-tcprtt -V" +"bpf-tcpstates -V" +"bpf-tcpsynbl -V" +"bpf-tcptop -V" +"bpf-tcptracer -V" +"bpf-vfsstat -V" +"bpf-wakeuptime -V" +"bpf-xfsdist -V" +"bpf-xfsslower -V" +) + +tracing_tests=( +"bpf-biolatency 1 1" +"bpf-biopattern 1 1" +"bpf-biosnoop 1" +"bpf-biostacks 1" +"bpf-biotop 1 1" +"bpf-bitesize 1 1" +"bpf-cachestat 1 1" +"bpf-cpudist 1 1" +# IGNORE, CURRENTLY BROKEN: "bpf-cpufreq -d 1", https://github.com/iovisor/bcc/issues/4651 +"bpf-drsnoop -d 1" +"bpf-filetop 1 1" +"bpf-fsdist -t $(df -T $(pwd) | tail -1 | awk '{print $2}') 1 1" +"bpf-fsslower -t $(df -T $(pwd) | tail -1 | awk '{print $2}') -d 1" +"bpf-funclatency -i 1 -d 1 vfs_read" +"bpf-hardirqs 1 1" +"bpf-klockstat -d 1" +"bpf-llcstat 1" +"bpf-offcputime 1" +# IGNORE, CURRENTLY BROKEN: "bpf-opensnoop -d 1", see https://bugzilla.redhat.com/show_bug.cgi?id=2219192 +# IGNORE, CURRENTLY BROKEN: "bpf-readahead -d 1", see https://bugzilla.redhat.com/show_bug.cgi?id=2219193 +"bpf-runqlat 1 1" +"bpf-runqlen 1 1" +"bpf-slabratetop 1 1" +"bpf-softirqs 1 1" +"bpf-syscount -d 1 -T 1" +"bpf-tcprtt -d 1 -i 1" +"bpf-tcpsynbl 1 1" +"bpf-tcptop 1 1" +"bpf-vfsstat 1 1" +"bpf-wakeuptime 1" +) + +one_failed=0 + +for cmd in "${version_tests[@]}"; do + t_Log "Running lib-tools test: ${cmd}" + if ! eval "${cmd}" > /dev/null 2>&1; then + t_Log "FAIL: lib-tools test: ${cmd}" + one_failed=1 + else + t_Log "PASS: lib-tools test: ${cmd}" + fi +done + +for cmd in "${tracing_tests[@]}"; do + t_Log "Running $0 - lib-tools test: ${cmd}" + if ! eval "${cmd}" > /dev/null 2>&1; then + t_Log "$0: FAIL: lib-tools test: ${cmd}" + one_failed=1 + else + t_Log "$0: PASS: lib-tools test: ${cmd}" + fi +done + +exit ${one_failed}