Skip to content

Commit

Permalink
TMP: Add sleeps to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed May 28, 2024
1 parent 7976384 commit c0e26be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/enable_disable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ extern crate error_chain;
#[allow(dead_code)]
mod helper;

use std::time::Duration;

use crate::helper::pfcli;
use assert_matches::assert_matches;

Expand All @@ -15,7 +17,9 @@ test!(enable_pf {
let mut pf = pfctl::PfCtl::new().unwrap();

assert_matches!(pfcli::disable_firewall(), Ok(()));
std::thread::sleep(Duration::from_millis(1000));
assert_matches!(pf.enable(), Ok(()));
std::thread::sleep(Duration::from_millis(1000));
assert_matches!(pfcli::is_enabled(), Ok(true));
assert_matches!(pf.enable(), Err(pfctl::Error(pfctl::ErrorKind::StateAlreadyActive, _)));
assert_matches!(pf.try_enable(), Ok(()));
Expand Down

0 comments on commit c0e26be

Please sign in to comment.