Skip to content

Commit

Permalink
ci: Use veristat's -f flag to read veristat.cfg in run_selftests.sh
Browse files Browse the repository at this point in the history
This patch adds a VERISTAT_CFG_FILE var to
run_veristat.{meta,kernel}.cfg which points to appropariate config file.
run_selftests.sh uses this with veristat's -f flag to read the config.

For meta bpf objs, this change results in the three bpf objects added in
the previous patch being ignored.

For kernel bpf objs, this patch should not have a functional effect.
Previously, VERISTAT_OBJECTS_GLOB for kernel bpf objs was using awk to
essentially do "look at allowlisted BPF objs in this veristat.cfg,
ignore comments". Using a broad glob and feeding the veristat.cfg
to veristat itself has the same effect.

Signed-off-by: Dave Marchevsky <[email protected]>
  • Loading branch information
davemarchevsky committed Nov 12, 2023
1 parent 944fc2a commit 5a7cc34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ci/vmtest/configs/run_veristat.kernel.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
VERISTAT_OBJECTS_DIR="/${PROJECT_NAME}/selftests/bpf"
VERISTAT_OBJECTS_GLOB=$(awk '/^#/ { next; } { print $0 ".bpf.o"; }' "${BPF_SELFTESTS_DIR}/veristat.cfg")
VERISTAT_OBJECTS_DIR="${BPF_SELFTESTS_DIR}"
VERISTAT_OBJECTS_GLOB="*.bpf.o"
VERISTAT_CFG_FILE="${BPF_SELFTESTS_DIR}/veristat.cfg"
VERISTAT_OUTPUT="veristat-kernel"
1 change: 1 addition & 0 deletions ci/vmtest/configs/run_veristat.meta.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
VERISTAT_OBJECTS_DIR="/bpf_objects"
VERISTAT_OBJECTS_GLOB="*.o"
VERISTAT_OUTPUT="veristat-meta"
VERISTAT_CFG_FILE="${VMTEST_CONFIGS_PATH}/veristat_meta.cfg"
3 changes: 2 additions & 1 deletion ci/vmtest/run_selftests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ run_veristat_helper() {
mkdir -p ${OUTPUT_DIR}
pushd "${VERISTAT_OBJECTS_DIR}"
"${BPF_SELFTESTS_DIR}/veristat" -o csv -q -e file,prog,verdict,states ${VERISTAT_OBJECTS_GLOB} > \
"${BPF_SELFTESTS_DIR}/veristat" -o csv -q -e file,prog,verdict,states \
-f "@${VERISTAT_CFG_FILE}" ${VERISTAT_OBJECTS_GLOB} > \
"${OUTPUT_DIR}/${VERISTAT_OUTPUT}"
echo "run_veristat_${mode}:$?" >> ${STATUS_FILE}
Expand Down

0 comments on commit 5a7cc34

Please sign in to comment.