Clean: Various libraries
[csit.git] / resources / libraries / robot / features / gbp.robot
1 # Copyright (c) 2019 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 *** Settings ***
15 | Library | resources.libraries.python.GBP
16 | ...
17 | Documentation | GBP keywords.
18
19 *** Keywords ***
20 | Initialize GBP routing domains on node
21 | | [Documentation]
22 | | ... | Initialize GBP routing domains on node.
23 | | ...
24 | | ... | *Arguments:*
25 | | ... | - dut - DUT node. Type: string
26 | | ... | - count - Number of baseline interface variables. Type: integer
27 | | ...
28 | | ... | *Example:*
29 | | ...
30 | | ... | \| Initialize GBP routing domains on node \| DUT1 \| 1 \|
31 | | ...
32 | | [Arguments] | ${dut} | ${count}=${1}
33 | | ...
34 | | ${dut_str}= | Convert To Lowercase | ${dut}
35 | | :FOR | ${id} | IN RANGE | 1 | ${count} + 1
36 | | | ${hexa_id}= | Convert To Hex | ${id} | length=2 | lowercase=yes
37 | | | ${dut_lo}= | VPP Create Loopback | ${nodes['${dut}']}
38 | | | ... | mac=ba:dc:00:ff:ee:${hexa_id}
39 | | | Set Interface State
40 | | | ... | ${nodes['${dut}']} | ${dut_lo} | up
41 | | | Add Fib Table
42 | | | ... | ${nodes['${dut}']} | ${id}
43 | | | GBP Route Domain Add
44 | | | ... | ${nodes['${dut}']} | rd_id=${id}
45 | | | Assign Interface To Fib Table
46 | | | ... | ${nodes['${dut}']} | ${dut_lo} | ${id}
47 | | | Create L2 BD
48 | | | ... | ${nodes['${dut}']} | ${id} | arp_term=${1}
49 | | | GBP Bridge Domain Add
50 | | | ... | ${nodes['${dut}']} | ${dut_lo} | bd_id=${id}
51 | | | GBP Endpoint Group Add
52 | | | ... | ${nodes['${dut}']} | ${100} | bd_id=${id} | rd_id=${id}
53 | | | VPP Interface Set IP Address
54 | | | ... | ${nodes['${dut}']} | ${dut_lo} | 1.1.1.1 | 24
55 | | | GBP Subnet Add Del
56 | | | ... | ${nodes['${dut}']} | 1.1.1.0 | 24 | ${100} | rd_id=${id}
57 | | | GBP Ext Itf Add Del
58 | | | ... | ${nodes['${dut}']} | ${dut_lo} | bd_id=${id} | rd_id=${id}
59 | | | GBP Endpoint Add
60 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_1} | 1.1.1.100
61 | | | ... | ${tg_if1_mac} | ${100}
62 | | | GBP Endpoint Add
63 | | | ... | ${nodes['${dut}']} | ${${dut_str}_${prev_layer}_${id}_2} | 1.1.1.200
64 | | | ... | ${tg_if2_mac} | ${100}
65 | | | VPP Route Add
66 | | | ... | ${nodes['${dut}']} | 10.10.10.0 | 24 | gateway=1.1.1.100
67 | | | ... | interface=${dut_lo} | vrf=${1}
68 | | | VPP Route Add
69 | | | ... | ${nodes['${dut}']} | 20.20.20.0 | 24 | gateway=1.1.1.200
70 | | | ... | interface=${dut_lo} | vrf=${1}
71 | | | GBP Subnet Add Del
72 | | | ... | ${nodes['${dut}']} | 10.10.10.0 | 24 | ${200} | rd_id=${id}
73 | | | GBP Subnet Add Del
74 | | | ... | ${nodes['${dut}']} | 20.20.20.0 | 24 | ${300} | rd_id=${id}
75 | | | Add Replace Acl Multi Entries
76 | | | ... | ${nodes['${dut}']}
77 | | | ... | rules="ipv4 permit src 0.0.0.0/0 dst 0.0.0.0/0 proto 61"
78 | | | ... | tag="gbp-permit-200-300"
79 | | | GBP Contract Add Del
80 | | | ... | ${nodes['${dut}']} | ${200} | ${300} | acl_index=${0}
81 | | | GBP Contract Add Del
82 | | | ... | ${nodes['${dut}']} | ${300} | ${200} | acl_index=${0}
83
84 | Initialize GBP routing domains
85 | | [Documentation]
86 | | ... | Initialize GBP routing domains on all DUTs.
87 | | ...
88 | | ... | *Arguments:*
89 | | ... | - count - Number of GBP routing domains. Type: integer
90 | | ...
91 | | ... | *Example:*
92 | | ...
93 | | ... | \| Initialize GBP routing domains \| 1 \|
94 | | ...
95 | | [Arguments] | ${count}=${1}
96 | | ...
97 | | :FOR | ${dut} | IN | @{duts}
98 | | | Initialize GBP routing domains on node | ${dut} | count=${count}
99 | | Set interfaces in path up