mirror of
https://github.com/aljazceru/recon-pipeline.git
synced 2025-12-24 01:34:26 +01:00
Add scan tests (#12) - tests of current codebase complete
* recon.targets tests added * restructured tests logically * fixed yaml error * fixed job names * recon.__init__ tests added * recon.config tests added * recon.amass.ParseAmassScan tests added * fixed test destined to fail on CI pipeline * testing amass partially complete * Changed the dir layout (#6) and fixed paths (#8) this commit closes #6 and #8 updated existing tests to utilize new paths * tests of current codebase complete * added is_kali check to searchsploit test * added test_web action to pipeline
This commit is contained in:
@@ -7,29 +7,21 @@ def test_creates_ips(tmp_path):
|
||||
targetfile = tmp_path / "test_targetlist"
|
||||
targetfile.write_text("127.0.0.1")
|
||||
|
||||
tl = TargetList(
|
||||
target_file=str(targetfile), results_dir=str(tmp_path / "recon-results")
|
||||
)
|
||||
tl = TargetList(target_file=str(targetfile), results_dir=str(tmp_path / "recon-results"))
|
||||
|
||||
out = tl.output()
|
||||
|
||||
assert out.path == str(
|
||||
(tmp_path / "recon-results" / "target-results" / "ip_addresses").resolve()
|
||||
)
|
||||
assert out.path == str((tmp_path / "recon-results" / "target-results" / "ip_addresses").resolve())
|
||||
|
||||
|
||||
def test_creates_domains(tmp_path):
|
||||
targetfile = tmp_path / "test_targetlist"
|
||||
targetfile.write_text("stuff.com")
|
||||
|
||||
tl = TargetList(
|
||||
target_file=str(targetfile), results_dir=str(tmp_path / "recon-results")
|
||||
)
|
||||
tl = TargetList(target_file=str(targetfile), results_dir=str(tmp_path / "recon-results"))
|
||||
out = tl.output()
|
||||
|
||||
assert out.path == str(
|
||||
(tmp_path / "recon-results" / "target-results" / "domains").resolve()
|
||||
)
|
||||
assert out.path == str((tmp_path / "recon-results" / "target-results" / "domains").resolve())
|
||||
|
||||
|
||||
def test_filenotfound(tmp_path):
|
||||
@@ -44,30 +36,20 @@ def test_results_dir_relative(tmp_path):
|
||||
targetfile = tmp_path / "test_targetlist"
|
||||
targetfile.write_text("stuff.com")
|
||||
|
||||
tl = TargetList(
|
||||
target_file=str(targetfile),
|
||||
results_dir=str((tmp_path / ".." / tmp_path / "recon-results")),
|
||||
)
|
||||
tl = TargetList(target_file=str(targetfile), results_dir=str((tmp_path / ".." / tmp_path / "recon-results")),)
|
||||
out = tl.output()
|
||||
|
||||
assert out.path == str(
|
||||
(tmp_path / "recon-results" / "target-results" / "domains").resolve()
|
||||
)
|
||||
assert out.path == str((tmp_path / "recon-results" / "target-results" / "domains").resolve())
|
||||
|
||||
|
||||
def test_results_dir_absolute(tmp_path):
|
||||
targetfile = tmp_path / "test_targetlist"
|
||||
targetfile.write_text("stuff.com")
|
||||
|
||||
tl = TargetList(
|
||||
target_file=str(targetfile),
|
||||
results_dir=str((tmp_path / "recon-results").resolve()),
|
||||
)
|
||||
tl = TargetList(target_file=str(targetfile), results_dir=str((tmp_path / "recon-results").resolve()),)
|
||||
out = tl.output()
|
||||
|
||||
assert out.path == str(
|
||||
(tmp_path / "recon-results" / "target-results" / "domains").resolve()
|
||||
)
|
||||
assert out.path == str((tmp_path / "recon-results" / "target-results" / "domains").resolve())
|
||||
|
||||
|
||||
def test_results_dir_empty(tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user