#[cfg(test)]
mod tests {
extern crate bcc;
use bcc::{Kprobe, BPF};
#[test]
fn error_handling() {
let code = include_str!("error.c");
let mut module = BPF::new(code).unwrap();
if Kprobe::new()
.handler("trace_return")
.function("do_sys_open")
.attach(&mut module)
.is_ok()
{
eprintln!("expected error during program load");
std::process::exit(1);
}
}
}