2024-07-24 19:04:28 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
import asyncio
|
2024-07-26 18:53:27 +00:00
|
|
|
from python.BIRD.Test import Test, BIRDInstance, DumpRIB, DumpLinuxKRT, DumpOSPFNeighbors
|
2024-07-24 19:04:28 +00:00
|
|
|
from python.BIRD.LogChecker import LogExpectedStub
|
|
|
|
|
|
|
|
class ThisTest(Test):
|
|
|
|
async def prepare(self):
|
|
|
|
# Set epoch
|
|
|
|
|
|
|
|
# Prepare machines and links
|
|
|
|
await self.machines(
|
|
|
|
*[ f"m{n}" for n in range(1,9) ],
|
|
|
|
t=BIRDInstance,
|
|
|
|
)
|
|
|
|
|
|
|
|
for m in self.machine_index.values():
|
|
|
|
m.conf = "template.conf"
|
|
|
|
m.default_log_checker.expected += [
|
|
|
|
LogExpectedStub(f"{m.logprefix} <INFO> Chosen router ID .*")
|
|
|
|
]
|
|
|
|
|
|
|
|
await asyncio.gather(*[
|
|
|
|
self.link("ve31", "m3", "m1"),
|
|
|
|
self.link("ve12", "m1", "m2"),
|
|
|
|
self.link("ve23", "m2", "m3"),
|
|
|
|
self.link("ve57", "m5", "m7"),
|
|
|
|
self.link("ve78", "m7", "m8"),
|
|
|
|
self.link("ve86", "m8", "m6"),
|
|
|
|
self.link("multi", "m3", "m4", "m5", "m6"),
|
|
|
|
])
|
|
|
|
|
|
|
|
async def test(self):
|
|
|
|
# Startup check
|
2024-07-25 11:32:55 +00:00
|
|
|
await asyncio.gather(*[
|
|
|
|
DumpRIB(self, 30, "rib-startup")(),
|
|
|
|
DumpLinuxKRT(self, 30, "fib-startup")(),
|
2024-07-26 18:53:27 +00:00
|
|
|
DumpOSPFNeighbors(self, 30, "ospf-neighbors", protocols=["ospf4", "ospf6"])(),
|
2024-07-25 11:32:55 +00:00
|
|
|
])
|