aboutsummaryrefslogtreecommitdiff
path: root/tests/models/network/rdns.py
diff options
context:
space:
mode:
authorstuppie2026-03-09 18:42:22 -0600
committerstuppie2026-03-09 18:42:22 -0600
commita68a9eb9873c7502c2b7bddb55c4eb61689a48a2 (patch)
tree6a4df8d399e94532dd3938f53f467913f412ce10 /tests/models/network/rdns.py
parentcf274a5814e02aefc0c9e25f96927b3163a4abaf (diff)
downloadgeneralresearch-a68a9eb9873c7502c2b7bddb55c4eb61689a48a2.tar.gz
generalresearch-a68a9eb9873c7502c2b7bddb55c4eb61689a48a2.zip
add IPLabel, NmapRun, RDNSResult, ToolRun, model/managers/tests. nmap xml parser. + test. work in progress
Diffstat (limited to 'tests/models/network/rdns.py')
-rw-r--r--tests/models/network/rdns.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/models/network/rdns.py b/tests/models/network/rdns.py
new file mode 100644
index 0000000..9167749
--- /dev/null
+++ b/tests/models/network/rdns.py
@@ -0,0 +1,23 @@
+from generalresearch.models.network.rdns import dig_rdns
+import faker
+
+fake = faker.Faker()
+
+
+def test_dig_rdns():
+ # Actually runs dig -x. Idk how stable this is
+ ip = "45.33.32.156"
+ rdns_result = dig_rdns(ip)
+ assert rdns_result.primary_hostname == "scanme.nmap.org"
+ assert rdns_result.primary_org == "nmap"
+
+ ip = "65.19.129.53"
+ rdns_result = dig_rdns(ip)
+ assert rdns_result.primary_hostname == "in1-smtp.grlengine.com"
+ assert rdns_result.primary_org == "grlengine"
+
+ ip = fake.ipv6()
+ rdns_result = dig_rdns(ip)
+ assert rdns_result.primary_hostname is None
+ assert rdns_result.primary_org is None
+ print(rdns_result.model_dump_postgres())