2024-07-10 10:44:53 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
import asyncio
|
2024-07-12 19:08:42 +00:00
|
|
|
from python.BIRD.Test import Test, BIRDInstance
|
2024-07-10 13:41:20 +00:00
|
|
|
|
2024-07-11 20:31:06 +00:00
|
|
|
class ThisTest(Test):
|
2024-07-12 20:01:55 +00:00
|
|
|
async def run(self):
|
|
|
|
# Prepare machines and links
|
2024-07-11 21:06:14 +00:00
|
|
|
self.src, self.dest = await self.machines(
|
|
|
|
"src", "dest",
|
|
|
|
t=BIRDInstance,
|
|
|
|
)
|
2024-07-12 16:45:53 +00:00
|
|
|
self.links = {
|
|
|
|
"L": await self.link("L", "src", "dest")
|
|
|
|
}
|
2024-07-11 20:31:06 +00:00
|
|
|
|
2024-07-12 20:01:55 +00:00
|
|
|
# Start machines and links
|
|
|
|
await self.start()
|
2024-07-10 10:44:53 +00:00
|
|
|
|
2024-07-19 14:47:29 +00:00
|
|
|
# Startup check
|
|
|
|
await self.route_dump(10, "startup")
|
2024-07-10 13:41:20 +00:00
|
|
|
|
2024-07-19 14:47:29 +00:00
|
|
|
wtb = ("p170", "p180", "p190", "p200")
|
|
|
|
btw = reversed(wtb)
|
|
|
|
|
|
|
|
# Enable worst to best
|
|
|
|
for p in wtb:
|
|
|
|
await self.src.enable(p)
|
|
|
|
await self.route_dump(1, f"enable-{p}")
|
|
|
|
|
|
|
|
# Disable worst to best
|
|
|
|
for p in wtb:
|
|
|
|
await self.src.disable(p)
|
|
|
|
await self.route_dump(1, f"disable-{p}")
|
|
|
|
|
|
|
|
# Enable best to worst
|
|
|
|
for p in btw:
|
2024-07-12 20:01:55 +00:00
|
|
|
await self.src.enable(p)
|
2024-07-19 14:47:29 +00:00
|
|
|
await self.route_dump(1, f"enable-{p}")
|
|
|
|
|
|
|
|
# Disable worst to best
|
|
|
|
for p in btw:
|
|
|
|
await self.src.disable(p)
|
|
|
|
await self.route_dump(1, f"disable-{p}")
|
|
|
|
|
|
|
|
# Re-enable all at once
|
|
|
|
await asyncio.gather(*[ self.src.enable(p) for p in wtb ])
|
|
|
|
await self.route_dump(5, f"add-all")
|
2024-07-10 10:44:53 +00:00
|
|
|
|
2024-07-12 20:01:55 +00:00
|
|
|
await self.cleanup()
|