pull/773/head
pdliyan 2 years ago
parent b24978955e
commit 31fb700ad5

@ -8,7 +8,6 @@ use aya::{
use aya_log::BpfLogger;
use bytes::BytesMut;
use log::warn;
use tokio::task;
use crate::STACK_ARGUMENT;
@ -40,13 +39,14 @@ async fn stack_argument() {
prog.load().unwrap();
prog.attach(Some("trigger_stack_argument"), 0, "/proc/self/exe", None)
.unwrap();
let mut args_map = HashMap::try_from(bpf.take_map("ARGS").unwrap())?;
let mut args_map: HashMap<_, u32, u64> =
HashMap::try_from(bpf.take_map("ARGS").unwrap()).unwrap();
trigger_stack_argument(0, 1, 2, 3, 4, 5, 6, 7);
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
assert_eq!(args_map.keys().count(), 8);
for iter in args_map.iter() {
let iter_v = iter.unwrap();
assert_eq!(iter_v.0, iter_v.1);
assert_eq!(iter_v.0 as u64, iter_v.1);
}
}

Loading…
Cancel
Save