]>
Commit | Line | Data |
---|---|---|
7cd87abc CH |
1 | # -*- coding: utf-8 eval: (blacken-mode 1) -*- |
2 | # SPDX-License-Identifier: ISC | |
3 | # | |
4 | # May 2 2023, Christian Hopps <chopps@labn.net> | |
5 | # | |
6 | # Copyright (c) 2023, LabN Consulting, L.L.C. | |
7 | # | |
8 | """ | |
9 | Verify routes present when staticd (backend client) is started after it's startup config | |
10 | is present during launch. | |
11 | """ | |
12 | ||
13 | import pytest | |
14 | from lib.topogen import Topogen, TopoRouter | |
15 | from util import _test_staticd_late_start | |
16 | ||
17 | # pytestmark = [pytest.mark.staticd, pytest.mark.mgmtd] | |
18 | pytestmark = [pytest.mark.staticd] | |
19 | ||
20 | ||
21 | @pytest.fixture(scope="module") | |
22 | def tgen(request): | |
23 | "Setup/Teardown the environment and provide tgen argument to tests" | |
24 | ||
25 | topodef = { | |
26 | "s1": ("r1",), | |
27 | } | |
28 | ||
29 | tgen = Topogen(topodef, request.module.__name__) | |
30 | tgen.start_topology() | |
31 | ||
32 | # configure mgmtd using current mgmtd config file | |
33 | tgen.gears["r1"].load_config(TopoRouter.RD_ZEBRA, "zebra.conf") | |
34 | tgen.gears["r1"].load_config(TopoRouter.RD_MGMTD) | |
35 | ||
36 | # Explicit disable staticd now.. | |
37 | tgen.gears["r1"].net.daemons["staticd"] = 0 | |
38 | ||
39 | tgen.start_router() | |
40 | yield tgen | |
41 | tgen.stop_topology() | |
42 | ||
43 | ||
44 | def test_staticd_late_start(tgen): | |
45 | return _test_staticd_late_start(tgen, tgen.routers()["r1"]) |