def test_yes_sorted_pcap(self): set_cwd(tempfile.mkdtemp()) cuckoo_create({ "cuckoo": { "network": { "sort_pcap": True, }, }, }) mkdir(cwd(analysis=1)) shutil.copy("tests/files/sample_analysis_storage/dump.pcap", cwd("dump.pcap", analysis=1)) na = NetworkAnalysis() na.set_options({}) na.set_path(cwd(analysis=1)) na.run() assert os.path.exists(cwd("dump_sorted.pcap", analysis=1))
def test_yes_sorted_pcap(self): set_cwd(tempfile.mkdtemp()) cuckoo_create({ "cuckoo": { "network": { "sort_pcap": True, }, }, }) mkdir(cwd(analysis=1)) shutil.copy( "tests/files/sample_analysis_storage/dump.pcap", cwd("dump.pcap", analysis=1) ) na = NetworkAnalysis() na.set_options({}) na.set_path(cwd(analysis=1)) na.run() assert os.path.exists(cwd("dump_sorted.pcap", analysis=1))
def test_no_sorted_pcap(self): set_cwd(self.mkdtemp()) cuckoo_create(cfg={ "cuckoo": { "processing": { "sort_pcap": False, }, }, }) mkdir(cwd(analysis=1)) shutil.copy( "tests/files/sample_analysis_storage/dump.pcap", cwd("dump.pcap", analysis=1) ) na = NetworkAnalysis() na.set_options({}) na.set_path(cwd(analysis=1)) na.run() assert not os.path.exists(cwd("dump_sorted.pcap", analysis=1))
def test_empty_pcap(self, p): set_cwd(tempfile.mkdtemp()) cuckoo_create(cfg={ "cuckoo": { "processing": { "sort_pcap": True, }, }, }) mkdir(cwd(analysis=1)) shutil.copy("tests/files/pcap/empty.pcap", cwd("dump.pcap", analysis=1)) na = NetworkAnalysis() na.set_path(cwd(analysis=1)) na.set_options({}) na.run() p.warning.assert_not_called()
def test_empty_pcap(self, p): set_cwd(tempfile.mkdtemp()) cuckoo_create(cfg={ "cuckoo": { "processing": { "sort_pcap": True, }, }, }) mkdir(cwd(analysis=1)) shutil.copy( "tests/files/pcap/empty.pcap", cwd("dump.pcap", analysis=1) ) na = NetworkAnalysis() na.set_path(cwd(analysis=1)) na.set_options({}) na.run() p.warning.assert_not_called()