From 9ce1530695cf2c979c443e0bfd0d07f435231709 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Wed, 14 Dec 2022 17:34:39 +1100 Subject: [PATCH] tests: skip tests that assume bpf_link based XDP on older kernels --- test/integration-test/src/tests/load.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/integration-test/src/tests/load.rs b/test/integration-test/src/tests/load.rs index b88867f9..f9a88ff9 100644 --- a/test/integration-test/src/tests/load.rs +++ b/test/integration-test/src/tests/load.rs @@ -9,6 +9,9 @@ use aya::{ }, Bpf, }; +use log::warn; + +use crate::tests::kernel_version; use super::{integration_test, IntegrationTest}; @@ -107,6 +110,11 @@ fn unload() { #[integration_test] fn pin_link() { + if kernel_version().unwrap() < (5, 9, 0) { + warn!("skipping test, XDP uses netlink"); + return; + } + let bytes = include_bytes_aligned!("../../../../target/bpfel-unknown-none/debug/test"); let mut bpf = Bpf::load(bytes).unwrap(); let prog: &mut Xdp = bpf.program_mut("test_unload").unwrap().try_into().unwrap(); @@ -133,6 +141,11 @@ fn pin_link() { #[integration_test] fn pin_lifecycle() { + if kernel_version().unwrap() < (5, 9, 0) { + warn!("skipping test, XDP uses netlink"); + return; + } + let bytes = include_bytes_aligned!("../../../../target/bpfel-unknown-none/debug/pass"); // 1. Load Program and Pin