]>
git.proxmox.com Git - mirror_frr.git/blob - tests/topotests/mgmt_startup/test_bigconf.py
1 # -*- coding: utf-8 eval: (blacken-mode 1) -*-
2 # SPDX-License-Identifier: ISC
4 # May 2 2023, Christian Hopps <chopps@labn.net>
6 # Copyright (c) 2023, LabN Consulting, L.L.C.
9 Test static route startup functionality
17 from lib
.common_config
import step
18 from lib
.topogen
import Topogen
, TopoRouter
19 from munet
.base
import Timeout
20 from util
import check_kernel
, check_vtysh_up
, write_big_route_conf
22 CWD
= os
.path
.dirname(os
.path
.realpath(__file__
))
24 # pytestmark = [pytest.mark.staticd, pytest.mark.mgmtd]
25 pytestmark
= [pytest
.mark
.staticd
]
30 ROUTE_RANGE
= [None, None]
33 @pytest.fixture(scope
="module")
35 "Setup/Teardown the environment and provide tgen argument to tests"
42 tgen
= Topogen(topodef
, request
.module
.__name
__)
45 confpath
= f
"{tgen.gears['r1'].gearlogdir}/r1-late-big.conf"
46 start
, end
= write_big_route_conf("10.0.0.0/8", ROUTE_COUNT
, confpath
)
47 ROUTE_RANGE
[0] = start
50 # configure mgmtd using current mgmtd config file
51 tgen
.gears
["r1"].load_config(TopoRouter
.RD_ZEBRA
, "zebra.conf")
52 tgen
.gears
["r1"].load_config(TopoRouter
.RD_MGMTD
, confpath
)
54 track
.started_on
= datetime
.datetime
.now()
61 def test_staticd_latestart(tgen
):
62 if tgen
.routers_have_failure():
63 pytest
.skip(tgen
.errors
)
65 r1
= tgen
.routers()["r1"]
67 step(f
"Verifying {ROUTE_COUNT} startup routes are present")
70 logging
.info("r1: vtysh connected after %ss", track
.elapsed())
72 result
= check_kernel(r1
, ROUTE_RANGE
[0], retry_timeout
=60)
74 logging
.info("r1: first route installed after %ss", track
.elapsed())
76 result
= check_kernel(r1
, ROUTE_RANGE
[1], retry_timeout
=60)
78 logging
.info("r1: last route installed after %ss", track
.elapsed())