Skip to content

Commit

Permalink
fixed up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
epi052 committed Feb 27, 2024
1 parent 48cecc4 commit df64d6a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rm ferox-*.state
# dependency management
[tasks.upgrade-deps]
command = "cargo"
args = ["upgrade", "--to-lockfile", "--exclude", "indicatif", "self_update"]
args = ["upgrade", "--exclude", "indicatif, self_update"]

[tasks.update]
command = "cargo"
Expand All @@ -28,5 +28,5 @@ cargo clippy --all-targets --all-features -- -D warnings
[tasks.test]
clear = true
script = """
cargo nextest run --all-features --all-targets --retries 10
cargo nextest run --all-features --all-targets
"""
2 changes: 1 addition & 1 deletion src/event_handlers/statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl StatsHandler {

self.bar.finish();

log::debug!("{:#?}", *self.stats);
log::info!("{:#?}", *self.stats);
log::trace!("exit: start");
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ fn main() -> Result<()> {
// print the banner to stderr
let std_stderr = stderr(); // std::io::stderr
let banner = Banner::new(&targets, &config);
if !config.quiet && !config.silent {
if (!config.quiet && !config.silent) || config.parallel != 0 {
banner.print_to(std_stderr, config).unwrap();
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/test_banner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,7 @@ fn banner_prints_parallel() {
Command::cargo_bin("feroxbuster")
.unwrap()
.arg("--stdin")
.arg("--quiet")
.arg("--parallel")
.arg("4316")
.arg("--wordlist")
Expand Down
4 changes: 3 additions & 1 deletion tests/test_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ fn main_parallel_spawns_children() -> Result<(), Box<dyn std::error::Error>> {

Command::cargo_bin("feroxbuster")
.unwrap()
.env("RUST_LOG", "trace")
.arg("--stdin")
.arg("--parallel")
.arg("2")
.arg("-vvvv")
.arg("--quiet")
.arg("--debug-log")
.arg(outfile.as_os_str())
.arg("--wordlist")
Expand Down Expand Up @@ -172,6 +173,7 @@ fn main_parallel_creates_output_directory() -> Result<(), Box<dyn std::error::Er
Command::cargo_bin("feroxbuster")
.unwrap()
.arg("--stdin")
.arg("--quiet")
.arg("--parallel")
.arg("2")
.arg("--output")
Expand Down
12 changes: 6 additions & 6 deletions tests/test_policies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn auto_bail_cancels_scan_with_timeouts() {
let error_mock = srv.mock(|when, then| {
when.method(GET)
.path_matches(Regex::new("/[a-zA-Z]{6}error[a-zA-Z]{6}").unwrap());
then.delay(Duration::new(3, 0))
then.delay(Duration::new(2, 5000))
.status(200)
.body("verboten, nerd");
});
Expand All @@ -57,18 +57,18 @@ fn auto_bail_cancels_scan_with_timeouts() {
Command::cargo_bin("feroxbuster")
.unwrap()
.arg("--url")
.arg(srv.url("/"))
.arg(&srv.url("/"))
.arg("--wordlist")
.arg(file.as_os_str())
.arg("--auto-bail")
.arg("--dont-filter")
.arg("--timeout")
.arg("2")
.arg("--threads")
.arg("4")
.arg("8")
.arg("--debug-log")
.arg(logfile.as_os_str())
.arg("-vvvv")
.arg("-vv")
.arg("--json")
.assert()
.success();
Expand Down Expand Up @@ -146,7 +146,7 @@ fn auto_bail_cancels_scan_with_403s() {
.arg("4")
.arg("--debug-log")
.arg(logfile.as_os_str())
.arg("-vvvv")
.arg("-vv")
.arg("--json")
.assert()
.success();
Expand Down Expand Up @@ -228,7 +228,7 @@ fn auto_bail_cancels_scan_with_429s() {
.arg("4")
.arg("--debug-log")
.arg(logfile.as_os_str())
.arg("-vvvv")
.arg("-vvv")
.arg("--json")
.assert()
.success();
Expand Down

0 comments on commit df64d6a

Please sign in to comment.