Skip to content

Commit

Permalink
Gate out test functions that use probe! on ppc64le and s390x
Browse files Browse the repository at this point in the history
These require `feature(asm_experimental_arch)` which only works on
nightly compilers.

See rust-lang/rust#93335

Also loosen version requirement on `probe`; on Fedora we have been
building with `probe` 0.5.1 with no issue.

Tested by doing a scratch build on Fedora's Koji build system:

https://koji.fedoraproject.org/koji/taskinfo?taskID=123361398

Signed-off-by: Michel Lind <[email protected]>
  • Loading branch information
michel-slm committed Sep 13, 2024
1 parent bece44a commit 00dcfb9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libbpf-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ libbpf-rs = {path = ".", features = ["generate-test-files"]}
log = "0.4.4"
memmem = "0.1.1"
plain = "0.2.3"
probe = "0.3"
probe = ">=0.3, <0.6"
scopeguard = "1.1"
serial_test = { version = "3.0", default-features = false }
tempfile = "3.3"
Expand Down
1 change: 0 additions & 1 deletion libbpf-rs/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use libbpf_rs::ObjectBuilder;
use libbpf_rs::OpenObject;
use libbpf_rs::ProgramMut;


pub fn get_test_object_path(filename: &str) -> PathBuf {
let mut path = PathBuf::new();
// env!() macro fails at compile time if var not found
Expand Down
9 changes: 8 additions & 1 deletion libbpf-rs/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ use crate::common::get_test_object;
use crate::common::get_test_object_path;
use crate::common::open_test_object;


/// A helper function for instantiating a `RingBuffer` with a callback meant to
/// be invoked when `action` is executed and that is intended to trigger a write
/// to said `RingBuffer` from kernel space, which then reads a single `i32` from
Expand Down Expand Up @@ -1565,6 +1564,10 @@ fn test_object_map_handle_clone() {
);
}

#[cfg(not(any(
all(target_arch = "powerpc64", target_endian = "little"),
target_arch = "s390x"
)))]
#[tag(root)]
#[test]
fn test_object_usdt() {
Expand Down Expand Up @@ -1593,6 +1596,10 @@ fn test_object_usdt() {
assert_eq!(result, 1);
}

#[cfg(not(any(
all(target_arch = "powerpc64", target_endian = "little"),
target_arch = "s390x"
)))]
#[tag(root)]
#[test]
fn test_object_usdt_cookie() {
Expand Down

0 comments on commit 00dcfb9

Please sign in to comment.