diff options
| author | stuppie | 2026-03-12 11:53:18 -0600 |
|---|---|---|
| committer | stuppie | 2026-03-12 11:53:18 -0600 |
| commit | d9ab70d98624e22b87dfe40cc5e18c8ad5eb44c4 (patch) | |
| tree | 194ec20d29ec614fc2344ab242923cbbded06316 /tests/models/network/mtr.py | |
| parent | b0306293ef52816998a463fbfe4c5b97d00b9b65 (diff) | |
| download | generalresearch-d9ab70d98624e22b87dfe40cc5e18c8ad5eb44c4.tar.gz generalresearch-d9ab70d98624e22b87dfe40cc5e18c8ad5eb44c4.zip | |
some tests to execute the full Toolrun pipeline for each tool. fix small bugs
Diffstat (limited to 'tests/models/network/mtr.py')
| -rw-r--r-- | tests/models/network/mtr.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/models/network/mtr.py b/tests/models/network/mtr.py new file mode 100644 index 0000000..2965300 --- /dev/null +++ b/tests/models/network/mtr.py @@ -0,0 +1,26 @@ +from generalresearch.models.network.mtr.execute import execute_mtr +import faker + +from generalresearch.models.network.tool_run import ToolName, ToolClass + +fake = faker.Faker() + + +def test_execute_mtr(toolrun_manager): + ip = "65.19.129.53" + + run = execute_mtr(ip=ip, report_cycles=3) + assert run.tool_name == ToolName.MTR + assert run.tool_class == ToolClass.TRACEROUTE + assert run.ip == ip + result = run.parsed + + last_hop = result.hops[-1] + assert last_hop.asn == 6939 + assert last_hop.domain == "grlengine.com" + + last_hop_1 = result.hops[-2] + assert last_hop_1.asn == 6939 + assert last_hop_1.domain == "he.net" + + toolrun_manager.create_mtr_run(run) |
