Skip to content

Commit

Permalink
Sprinkle some sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed May 29, 2024
1 parent b630098 commit f0d99ca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/filter_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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 {
Expand Down

0 comments on commit f0d99ca

Please sign in to comment.