]> git.proxmox.com Git - mirror_frr.git/blob - tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py
doc: Add `show ipv6 rpf X:X::X:X` command to docs
[mirror_frr.git] / tests / topotests / bgp_l3vpn_to_bgp_vrf / test_bgp_l3vpn_to_bgp_vrf.py
1 #!/usr/bin/env python
2
3 #
4 # Part of NetDEF Topology Tests
5 #
6 # Copyright (c) 2018, LabN Consulting, L.L.C.
7 # Authored by Lou Berger <lberger@labn.net>
8 #
9 # Permission to use, copy, modify, and/or distribute this software
10 # for any purpose with or without fee is hereby granted, provided
11 # that the above copyright notice and this permission notice appear
12 # in all copies.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
15 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
17 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
18 # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
19 # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
20 # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
21 # OF THIS SOFTWARE.
22 #
23
24 import os
25 import sys
26 import pytest
27
28 sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
29
30 from lib.ltemplate import *
31
32 pytestmark = [pytest.mark.bgpd, pytest.mark.ospfd]
33
34
35 def test_check_linux_vrf():
36 CliOnFail = None
37 # For debugging, uncomment the next line
38 # CliOnFail = 'tgen.mininet_cli'
39 CheckFunc = "ltemplateVersionCheck('4.1', iproute2='4.9')"
40 # uncomment next line to start cli *before* script is run
41 # CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
42 ltemplateTest("scripts/check_linux_vrf.py", False, CliOnFail, CheckFunc)
43
44
45 def test_adjacencies():
46 CliOnFail = None
47 # For debugging, uncomment the next line
48 # CliOnFail = 'tgen.mininet_cli'
49 CheckFunc = "ltemplateVersionCheck('4.1')"
50 # uncomment next line to start cli *before* script is run
51 # CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True)'
52 ltemplateTest("scripts/adjacencies.py", False, CliOnFail, CheckFunc)
53
54
55 def test_notification_check():
56 CliOnFail = None
57 # For debugging, uncomment the next line
58 # CliOnFail = 'tgen.mininet_cli'
59 CheckFunc = "ltemplateVersionCheck('4.1', iproute2='4.9')"
60 # uncomment next line to start cli *before* script is run
61 # CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
62 ltemplateTest("scripts/notification_check.py", False, CliOnFail, CheckFunc)
63
64
65 def SKIP_test_add_routes():
66 CliOnFail = None
67 # For debugging, uncomment the next line
68 # CliOnFail = 'tgen.mininet_cli'
69 CheckFunc = "ltemplateVersionCheck('4.1')"
70 # uncomment next line to start cli *before* script is run
71 # CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True)'
72 ltemplateTest("scripts/add_routes.py", False, CliOnFail, CheckFunc)
73
74
75 def test_check_routes():
76 CliOnFail = None
77 # For debugging, uncomment the next line
78 # CliOnFail = 'tgen.mininet_cli'
79 CheckFunc = "ltemplateVersionCheck('4.1')"
80 # uncomment next line to start cli *before* script is run
81 # CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True)'
82 ltemplateTest("scripts/check_routes.py", False, CliOnFail, CheckFunc)
83
84
85 # manual data path setup test - remove once have bgp/zebra vrf path working
86 def test_check_linux_mpls():
87 CliOnFail = None
88 # For debugging, uncomment the next line
89 # CliOnFail = 'tgen.mininet_cli'
90 CheckFunc = "ltemplateVersionCheck('4.1', iproute2='4.9')"
91 # uncomment next line to start cli *before* script is run
92 # CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
93 ltemplateTest("scripts/check_linux_mpls.py", False, CliOnFail, CheckFunc)
94
95
96 def test_check_scale_up():
97 CliOnFail = None
98 # For debugging, uncomment the next line
99 # CliOnFail = 'tgen.mininet_cli'
100 CheckFunc = "ltemplateVersionCheck('4.1', iproute2='4.9')"
101 # uncomment next line to start cli *before* script is run
102 # CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
103 ltemplateTest("scripts/scale_up.py", False, CliOnFail, CheckFunc)
104
105
106 def test_check_scale_down():
107 CliOnFail = None
108 # For debugging, uncomment the next line
109 # CliOnFail = 'tgen.mininet_cli'
110 CheckFunc = "ltemplateVersionCheck('4.1', iproute2='4.9')"
111 # uncomment next line to start cli *before* script is run
112 # CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
113 ltemplateTest("scripts/scale_down.py", False, CliOnFail, CheckFunc)
114
115
116 def SKIP_test_cleanup_all():
117 CliOnFail = None
118 # For debugging, uncomment the next line
119 # CliOnFail = 'tgen.mininet_cli'
120 CheckFunc = "ltemplateVersionCheck('4.1')"
121 # uncomment next line to start cli *before* script is run
122 # CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True)'
123 ltemplateTest("scripts/cleanup_all.py", False, CliOnFail, CheckFunc)
124
125
126 if __name__ == "__main__":
127 retval = pytest.main(["-s"])
128 sys.exit(retval)