diff --git a/tests/filter_rules.rs b/tests/filter_rules.rs index 27a28fb..c64de28 100644 --- a/tests/filter_rules.rs +++ b/tests/filter_rules.rs @@ -8,6 +8,8 @@ mod helper; use crate::helper::pfcli; use assert_matches::assert_matches; use std::net::Ipv4Addr; +use std::thread; +use std::time::Duration; static ANCHOR_NAME: &'static str = "pfctl-rs.integration.testing.filter-rules"; @@ -17,14 +19,17 @@ fn before_each() { .try_add_anchor(ANCHOR_NAME, pfctl::AnchorKind::Filter) .unwrap(); pfcli::flush_rules(ANCHOR_NAME, pfcli::FlushOptions::Rules).unwrap(); + thread::sleep(Duration::from_millis(500)); } fn after_each() { + thread::sleep(Duration::from_millis(500)); pfcli::flush_rules(ANCHOR_NAME, pfcli::FlushOptions::Rules).unwrap(); pfctl::PfCtl::new() .unwrap() .try_remove_anchor(ANCHOR_NAME, pfctl::AnchorKind::Filter) .unwrap(); + thread::sleep(Duration::from_millis(500)); } test!(drop_all_rule {