Skip to content

Commit

Permalink
test: Assert the full packed method for all L4 protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
vadorovsky committed Jun 24, 2024
1 parent c783846 commit 38c6c5b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions crates/modules/network-monitor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,6 @@ pub mod test_suite {
// for TCP it's overriden on connection
let mut source = dest;
let msg = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let data_copied = match proto {
Proto::TCP => Vec::new(),
Proto::UDP => msg.to_vec(),
};
TestRunner::with_ebpf(program)
.run(|| match proto {
Proto::UDP => {
Expand Down Expand Up @@ -592,15 +588,15 @@ pub mod test_suite {
NetworkEvent::Send,
(dst, dest.into(), "destination address"),
(src, source.into(), "source address"),
(data, data_copied.clone(), "data copy"),
(data, msg.to_vec(), "data copy"),
(data_len, msg.len() as u32, "real message len"),
(proto, proto, "protocol")
))
.expect_event(event_check!(
NetworkEvent::Receive,
(dst, source.into(), "destination address"),
(src, dest.into(), "source address"),
(data, data_copied.clone(), "data copy"),
(data, msg.to_vec(), "data copy"),
(data_len, msg.len() as u32, "real message len"),
(proto, proto, "protocol")
))
Expand Down

0 comments on commit 38c6c5b

Please sign in to comment.