Files
recon-pipeline/tests/test_recon/test_nmap.py
epi052 7a24d85db4 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
2020-02-04 06:33:00 -06:00

39 lines
1.1 KiB
Python

from pathlib import Path
from recon.nmap import ThreadedNmapScan, SearchsploitScan
import luigi
from ..utils import is_kali
tfp = "../data/bitdiscovery"
tf = Path(tfp).stem
el = "../data/blacklist"
rd = "../data/recon-results"
nmap_results = Path(__file__).parent.parent / "data" / "recon-results" / "nmap-results"
def test_nmap_output_location(tmp_path):
tns = ThreadedNmapScan(target_file=tf, exempt_list=el, results_dir=str(tmp_path), top_ports=100)
assert tns.output().path == str(Path(tmp_path) / "nmap-results")
def test_searchsploit_output_location(tmp_path):
sss = SearchsploitScan(target_file=tf, exempt_list=el, results_dir=str(tmp_path), top_ports=100)
assert sss.output().path == str(Path(tmp_path) / "searchsploit-results")
def test_searchsploit_produces_results(tmp_path):
sss = SearchsploitScan(target_file=tf, exempt_list=el, results_dir=str(tmp_path), top_ports=100)
sss.input = lambda: luigi.LocalTarget(nmap_results)
if not is_kali():
return True
sss.run()
assert len([x for x in Path(sss.output().path).glob("searchsploit*.txt")]) > 0