|
1 | | -"""LT-001: Live platform coverage — all vendors × all OSPF queries + interfaces. |
| 1 | +"""LT-001: Live platform coverage — all vendors × all OSPF, routing_table, tools + interfaces. |
2 | 2 |
|
3 | 3 | Generates platform_coverage_results.md with detailed output per test. |
4 | 4 | """ |
|
7 | 7 | import pytest |
8 | 8 |
|
9 | 9 | from core.inventory import devices |
10 | | -from input_models.models import InterfacesQuery, OspfQuery |
11 | | -from tools.operational import get_interfaces |
| 10 | +from input_models.models import InterfacesQuery, OspfQuery, RoutingQuery, TracerouteInput |
| 11 | +from tools.operational import get_interfaces, traceroute |
12 | 12 | from tools.ospf import get_ospf |
| 13 | +from tools.routing import get_routing |
13 | 14 |
|
14 | 15 | # ── Test devices: one per vendor ───────────────────────────────────────────── |
15 | 16 | TEST_DEVICES = { |
|
21 | 22 | } |
22 | 23 |
|
23 | 24 | OSPF_QUERIES = ["neighbors", "database", "borders", "config", "interfaces", "details"] |
| 25 | +ROUTING_QUERIES = ["ip_route", "route_maps", "prefix_lists", "policy_based_routing", "access_lists"] |
| 26 | +TRACEROUTE_DEST = "172.20.20.207" # C1J management IP — core device reachable from all vendors |
| 27 | + |
24 | 28 | RESULTS = [] # collected during test run |
25 | 29 |
|
26 | 30 |
|
@@ -124,10 +128,29 @@ async def test_ospf_query(device, query): |
124 | 128 | assert status != "FAIL", f"{device} ospf/{query}: {result.get('error', result.get('raw', '')[:200])}" |
125 | 129 |
|
126 | 130 |
|
| 131 | +@pytest.mark.parametrize("device", TEST_DEVICES.keys()) |
| 132 | +@pytest.mark.parametrize("query", ROUTING_QUERIES) |
| 133 | +async def test_routing_query(device, query): |
| 134 | + """Test routing_table query against a live device.""" |
| 135 | + result = await get_routing(RoutingQuery(device=device, query=query)) |
| 136 | + status = classify(result) |
| 137 | + record(device, "routing_table", query, result, status) |
| 138 | + assert status != "FAIL", f"{device} routing_table/{query}: {result.get('error', result.get('raw', '')[:200])}" |
| 139 | + |
| 140 | + |
127 | 141 | @pytest.mark.parametrize("device", TEST_DEVICES.keys()) |
128 | 142 | async def test_interfaces(device): |
129 | 143 | """Test interface status query against a live device.""" |
130 | 144 | result = await get_interfaces(InterfacesQuery(device=device)) |
131 | 145 | status = classify(result) |
132 | 146 | record(device, "interfaces", "interface_status", result, status) |
133 | 147 | assert status != "FAIL", f"{device} interfaces: {result.get('error', result.get('raw', '')[:200])}" |
| 148 | + |
| 149 | + |
| 150 | +@pytest.mark.parametrize("device", TEST_DEVICES.keys()) |
| 151 | +async def test_traceroute(device): |
| 152 | + """Test traceroute against a live device, tracing to C1J management IP.""" |
| 153 | + result = await traceroute(TracerouteInput(device=device, destination=TRACEROUTE_DEST)) |
| 154 | + status = classify(result) |
| 155 | + record(device, "tools", "traceroute", result, status) |
| 156 | + assert status != "FAIL", f"{device} traceroute→{TRACEROUTE_DEST}: {result.get('error', result.get('raw', '')[:200])}" |
0 commit comments