blob: a598a71f3f7c86d56494dfcb78749ef21ea43dc7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
from uuid import uuid4
import faker
from generalresearch.models.network.tool_run import (
new_tool_run_from_nmap,
run_dig,
)
fake = faker.Faker()
def test_create_tool_run_from_nmap(nmap_run, toolrun_manager):
scan_group_id = uuid4().hex
run = new_tool_run_from_nmap(nmap_run, scan_group_id=scan_group_id)
toolrun_manager.create_portscan_run(run)
run_out = toolrun_manager.get_portscan_run(run.id)
assert run == run_out
def test_create_tool_run_from_dig_fixture(reverse_dns_run, toolrun_manager):
toolrun_manager.create_rdns_run(reverse_dns_run)
run_out = toolrun_manager.get_rdns_run(reverse_dns_run.id)
assert reverse_dns_run == run_out
def test_run_dig(toolrun_manager):
reverse_dns_run = run_dig(ip="65.19.129.53")
toolrun_manager.create_rdns_run(reverse_dns_run)
run_out = toolrun_manager.get_rdns_run(reverse_dns_run.id)
assert reverse_dns_run == run_out
def test_run_dig_empty(toolrun_manager):
reverse_dns_run = run_dig(ip=fake.ipv6())
toolrun_manager.create_rdns_run(reverse_dns_run)
run_out = toolrun_manager.get_rdns_run(reverse_dns_run.id)
assert reverse_dns_run == run_out
|