f9dc4ab233d5f6abe3fc1d1e04df7f12a01129cd
[csit.git] / resources / test_data / honeycomb / bgp.py
1 # Copyright (c) 2017 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 from copy import deepcopy
15
16 """Test variables for BGP test suite."""
17
18 # Internal BGP peers for CRUD tests
19 address_internal = "192.168.0.2"
20 address_internal2 = "192.168.0.3"
21 peer_internal = {
22     "bgp-openconfig-extensions:neighbor": [{
23         "neighbor-address": address_internal,
24         "config": {
25             "peer-type": "INTERNAL"
26         },
27         "timers": {
28             "config": {
29                 "connect-retry": 10,
30                 "hold-time": 60
31             }
32         },
33         "transport": {
34             "config": {
35                 "remote-port": 17900,
36                 "passive-mode": False
37             }
38         },
39         "afi-safis": {
40             "afi-safi": [{
41                 "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
42                 "receive": True,
43                 "send-max": 0
44                 }]
45             }
46         }]
47     }
48
49 peer_internal_update = {
50     "bgp-openconfig-extensions:neighbor": [{
51         "neighbor-address": address_internal,
52         "config": {
53             "peer-type": "INTERNAL"
54         },
55         "timers": {
56             "config": {
57                 "connect-retry": 5,
58                 "hold-time": 120
59             }
60         },
61         "transport": {
62             "config": {
63                 "remote-port": 17901,
64                 "passive-mode": True
65             }
66         },
67         "afi-safis": {
68             "afi-safi": [{
69                 "afi-safi-name": "openconfig-bgp-types:IPV6-UNICAST",
70                 "receive": False,
71                 "send-max": 1
72                 }]
73             }
74         }]
75     }
76
77 peer_internal2 = deepcopy(peer_internal)
78 peer_internal2["bgp-openconfig-extensions:neighbor"][0]["neighbor-address"] = \
79     address_internal2
80
81 # Application BGP peer for CRUD tests
82 address_application = "192.168.0.4"
83 peer_application = {
84     "bgp-openconfig-extensions:neighbor": [{
85         "neighbor-address": address_application,
86         "config": {
87             "peer-group": "application-peers"
88         },
89         "afi-safis": {
90             "afi-safi": [
91                 {
92                     "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
93                     "receive": True,
94                     "send-max": 0
95                 },
96                 {
97                     "afi-safi-name":
98                         "openconfig-bgp-types:IPV4-LABELLED-UNICAST",
99                     "receive": True,
100                     "send-max": 0
101                 }]
102             }
103         }]
104     }
105
106 route_address_ipv4 = "192.168.0.5/32"
107 route_id_ipv4 = 0
108 route_data_ipv4 = {
109     "bgp-inet:ipv4-route": [{
110         "path-id": route_id_ipv4,
111         "prefix": route_address_ipv4,
112         "attributes": {
113             "as-path": {},
114             "origin": {
115                 "value": "igp"
116             },
117             "local-pref": {
118                 "pref": 100
119             },
120             "ipv4-next-hop": {
121                 "global": "192.168.1.1"
122             }
123         }
124     }]
125 }
126
127 route_data_ipv4_update = {
128     "bgp-inet:ipv4-route": [{
129         "path-id": route_id_ipv4,
130         "prefix": route_address_ipv4,
131         "attributes": {
132             "as-path": {},
133             "origin": {
134                 "value": "egp"
135             },
136             "local-pref": {
137                 "pref": 200
138             },
139             "ipv4-next-hop": {
140                 "global": "192.168.1.2"
141             }
142         }
143     }]
144 }
145
146 route_address_ipv4_2 = "192.168.0.6/32"
147 route_id_ipv4_2 = 1
148 route_data_ipv4_2 = {
149     "bgp-inet:ipv4-route": [{
150         "path-id": route_id_ipv4_2,
151         "prefix": route_address_ipv4_2,
152         "attributes": {
153             "as-path": {},
154             "origin": {
155                 "value": "igp"
156             },
157             "local-pref": {
158                 "pref": 100
159             },
160             "ipv4-next-hop": {
161                 "global": "192.168.1.2"
162             }
163         }
164     }]
165 }
166
167 route_address_ipv6 = "3ffe:62::1/64"
168 route_id_ipv6 = 0
169 route_data_ipv6 = {
170     "bgp-inet:ipv6-route": [{
171         "path-id": route_id_ipv6,
172         "prefix": route_address_ipv6,
173         "attributes": {
174             "as-path": {},
175             "origin": {
176                 "value": "igp"
177             },
178             "local-pref": {
179                 "pref": 100
180             },
181             "ipv6-next-hop": {
182                 "global": "3ffe:63::1"
183             }
184         }
185     }]
186 }
187
188 table1_oper = {
189     "destination-prefix": route_address_ipv4,
190     "next-hop": "192.168.1.1",
191     "vpp-ipv4-route-state": {}
192 }

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.