File: fix-btf-sys-test.patch

package info (click to toggle)
rust-aya-obj 0.2.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,332 kB
  • sloc: ansic: 12; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 686 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Description: improve btf test
 This test attempts to read from /sys/kernel/btf/vmlinux, which doesn't exist on all kernels.
Author: Fabian Grünbichler <debian@fabian.gruenbichler.email>
Forwarded: no
--- a/src/btf/btf.rs
+++ b/src/btf/btf.rs
@@ -1816,6 +1816,8 @@
     #[cfg(target_endian = "little")]
     #[cfg(not(target_arch = "powerpc64"))]
     fn test_read_btf_from_sys_fs() {
+	// fails on debci sometimes
+	if !std::path::Path::new("/sys/kernel/btf/vmlinux").exists() { return; }
         let btf = Btf::parse_file("/sys/kernel/btf/vmlinux", Endianness::default()).unwrap();
         let task_struct_id = btf
             .id_by_type_name_kind("task_struct", BtfKind::Struct)