Skip to content

reconFTW is a tool designed to perform automated recon on a target domain by running the best set of tools to perform scanning and finding out vulnerabilities

892 B
Raw Blame
#!/usr/bin/env bats

setup() {
  source "$(cd "$(dirname "$BATS_TEST_FILENAME")" && pwd)/../helpers/common.bash"
  setup_recon_env
}

@test "apply_performance_profile sets numeric values for low profile" {
  export PERF_PROFILE="low"
  unset PARALLEL_MAX_JOBS
  # NOT `run`: it executes in a subshell, so the variables the function sets do
  # not survive into this shell and the assertions below would read the unset
  # values this test just unset.
  apply_performance_profile
  [[ "$PARALLEL_MAX_JOBS" =~ ^[0-9]+$ ]]
  [[ "$FFUF_THREADS" =~ ^[0-9]+$ ]]
  [ "$PARALLEL_MAX_JOBS" -ge 1 ]
}

@test "apply_performance_profile max profile is not lower than low profile ffuf" {
  export PERF_PROFILE="low"
  apply_performance_profile >/dev/null
  low_ffuf="$FFUF_THREADS"

  export PERF_PROFILE="max"
  run apply_performance_profile
  [ "$status" -eq 0 ]
  [ "$FFUF_THREADS" -ge "$low_ffuf" ]
}