bpftool/tests/sanity/runtest.sh
Ziqian SUN (Zamir) 52aeb5db0f Initial gating test for bpftool
Signed-off-by: Ziqian SUN (Zamir) <zsun@redhat.com>
2025-01-10 10:47:44 +08:00

39 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh
rlJournalStart
CONFIG_FILE=/boot/config-$(uname -r)
if ! grep "CONFIG_BPF_SYSCALL=y" $CONFIG_FILE; then
rstrnt-report-result $TEST SKIP 0
exit 0
fi
rlPhaseStartSetup
dnf install -y kernel-devel
rpm -q bpftool || dnf install -y -q bpftool
BEAHARCH=${ARCH}
unset ARCH
rlPhaseEnd
for cmds in prog map link perf net; do
if ! bpftool help 2>&1 | grep " OBJECT" | grep -q "${cmds}"; then
continue
fi
rlPhaseStartTest "bpftool ${cmds}"
rlRun -l "bpftool ${cmds}"
rlPhaseEnd
done
for cmds in feature btf; do
if ! bpftool help 2>&1 | grep " OBJECT" | grep -q "${cmds}"; then
continue
fi
rlPhaseStartTest "bpftool ${cmds}"
rlRun -l "bpftool ${cmds} &> bpftool-${cmds}.log"
rstrnt-report-log bpftool-${cmds}.log
rlPhaseEnd
done
rlPhaseStartCleanup
ARCH=${BEAHARCH}
rlPhaseEnd
rlJournalEnd