Skip to content

Commit

Permalink
fixup: integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed Jul 24, 2024
1 parent efc792c commit 3d51caf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ test!(kill_ipv4_state {

for expected_state in &expected_states {
let Some(state) = states.iter().find(|&state| matches!(ExpectedState::try_from(state.clone()), Ok(v) if v == *expected_state)) else {
panic!("expected state: {expected_state:?}");
panic!("cannot find state: {expected_state:?}");
};
assert_matches!(pf.kill_state(&state), Ok(_));
}
Expand All @@ -168,8 +168,8 @@ test!(kill_ipv4_state {
test!(kill_ipv6_state {
let mut pf = pfctl::PfCtl::new().unwrap();
let ipv6 = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
let server_addr = SocketAddr::new(ipv6, 13370);
let sender_addr = SocketAddr::new(ipv6, 13380);
let server_addr = SocketAddr::new(ipv6, 13371);
let sender_addr = SocketAddr::new(ipv6, 13381);

pf.add_rule(ANCHOR_NAME, &rule_builder(server_addr)).unwrap();
send_udp_packet(sender_addr, server_addr);
Expand Down Expand Up @@ -197,7 +197,7 @@ test!(kill_ipv6_state {

for expected_state in &expected_states {
let Some(state) = states.iter().find(|&state| matches!(ExpectedState::try_from(state.clone()), Ok(v) if v == *expected_state)) else {
panic!("expected state: {expected_state:?}");
panic!("cannot find state: {expected_state:?}");
};
assert_matches!(pf.kill_state(&state), Ok(_));
}
Expand Down

0 comments on commit 3d51caf

Please sign in to comment.