]>
Commit | Line | Data |
---|---|---|
6d0dbb79 | 1 | #!/usr/bin/env python |
acddc0ed | 2 | # SPDX-License-Identifier: ISC |
6d0dbb79 LB |
3 | |
4 | # | |
6d0dbb79 LB |
5 | # Part of NetDEF Topology Tests |
6 | # | |
db2dbd24 LB |
7 | # Copyright (c) 2018, LabN Consulting, L.L.C. |
8 | # Authored by Lou Berger <lberger@labn.net> | |
6d0dbb79 | 9 | # |
6d0dbb79 | 10 | |
6d0dbb79 | 11 | import os |
6d0dbb79 LB |
12 | import sys |
13 | import pytest | |
6d0dbb79 | 14 | |
787e7624 | 15 | sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")) |
db2dbd24 LB |
16 | |
17 | from lib.ltemplate import * | |
18 | ||
3dedee4f | 19 | pytestmark = [pytest.mark.bgpd, pytest.mark.ospfd] |
787e7624 | 20 | |
5980ad0a | 21 | |
db2dbd24 LB |
22 | def test_adjacencies(): |
23 | CliOnFail = None | |
24 | # For debugging, uncomment the next line | |
787e7624 | 25 | # CliOnFail = 'tgen.mininet_cli' |
26 | CheckFunc = "ltemplateVersionCheck('3.1')" | |
27 | # uncomment next line to start cli *before* script is run | |
28 | # CheckFunc = 'ltemplateVersionCheck(\'3.1\', cli=True)' | |
29 | ltemplateTest("scripts/adjacencies.py", False, CliOnFail, CheckFunc) | |
30 | ||
db2dbd24 LB |
31 | |
32 | def test_add_routes(): | |
33 | CliOnFail = None | |
34 | # For debugging, uncomment the next line | |
787e7624 | 35 | # CliOnFail = 'tgen.mininet_cli' |
36 | CheckFunc = "ltemplateVersionCheck('3.1')" | |
37 | # uncomment next line to start cli *before* script is run | |
38 | # CheckFunc = 'ltemplateVersionCheck(\'3.1\', cli=True)' | |
39 | ltemplateTest("scripts/add_routes.py", False, CliOnFail, CheckFunc) | |
40 | ||
db2dbd24 LB |
41 | |
42 | def test_check_routes(): | |
43 | CliOnFail = None | |
44 | # For debugging, uncomment the next line | |
787e7624 | 45 | # CliOnFail = 'tgen.mininet_cli' |
46 | CheckFunc = "ltemplateVersionCheck('3.1')" | |
47 | # uncomment next line to start cli *before* script is run | |
48 | # CheckFunc = 'ltemplateVersionCheck(\'3.1\', cli=True)' | |
49 | ltemplateTest("scripts/check_routes.py", False, CliOnFail, CheckFunc) | |
50 | ||
db2dbd24 LB |
51 | |
52 | def test_cleanup_all(): | |
53 | CliOnFail = None | |
54 | # For debugging, uncomment the next line | |
787e7624 | 55 | # CliOnFail = 'tgen.mininet_cli' |
56 | CheckFunc = "ltemplateVersionCheck('3.1')" | |
57 | # uncomment next line to start cli *before* script is run | |
58 | # CheckFunc = 'ltemplateVersionCheck(\'3.1\', cli=True)' | |
59 | ltemplateTest("scripts/cleanup_all.py", False, CliOnFail, CheckFunc) | |
60 | ||
6d0dbb79 | 61 | |
787e7624 | 62 | if __name__ == "__main__": |
db2dbd24 LB |
63 | retval = pytest.main(["-s"]) |
64 | sys.exit(retval) |