diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..4ca9235 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-10 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/sanity/metadata b/tests/sanity/metadata new file mode 100644 index 0000000..337bc1b --- /dev/null +++ b/tests/sanity/metadata @@ -0,0 +1,13 @@ +[General] +name=bpftool gating test +owner=Ziqian SUN +description=bpftool gating test +license=GPLv2 +confidential=no +destructive=no + +[restraint] +entry_point=./runtest.sh +max_time=15m +use_pty=false + diff --git a/tests/sanity/runtest.sh b/tests/sanity/runtest.sh new file mode 100755 index 0000000..4025aed --- /dev/null +++ b/tests/sanity/runtest.sh @@ -0,0 +1,38 @@ +#!/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 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..41ac101 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,10 @@ +- hosts: localhost + tags: + - classic + roles: + - role: standard-test-basic + tests: + - sanity + required_packages: + - kernel-devel + - bpftool