42026a1e2c4f86115f73ad955063df811432d028
[csit.git] / resources / libraries / robot / tcp / tcp_setup.robot
1 # Copyright (c) 2018 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.IPv4Util.IPv4Util
16 | Library | resources.libraries.python.InterfaceUtil
17 | Library | resources.libraries.python.tcp.TCPUtils
18 | Resource | resources/libraries/robot/ip/ip4.robot
19 | ...
20 | Documentation | L2 keywords to set up VPP to test tcp.
21
22 *** Keywords ***
23 | Create base startup configuration of VPP for TCP tests on all DUTs
24 | | [Documentation] | Create base startup configuration of VPP for TCP related
25 | | ... | tests to all DUTs.
26 | | ...
27 | | ${duts}= | Get Matches | ${nodes} | DUT*
28 | | :FOR | ${dut} | IN | @{duts}
29 | | | Import Library | resources.libraries.python.VppConfigGenerator
30 | | | ... | WITH NAME | ${dut}
31 | | | Run keyword | ${dut}.Set Node |  ${nodes['${dut}']}
32 | | | Run keyword | ${dut}.Add Unix Log
33 | | | Run keyword | ${dut}.Add Unix CLI Listen
34 | | | Run keyword | ${dut}.Add Unix Nodaemon
35 | | | Run keyword | ${dut}.Add DPDK Socketmem | 4096,4096
36 | | | Run keyword | ${dut}.Add DPDK Log Level | debug
37 | | | Run keyword | ${dut}.Add DPDK Uio Driver | ${uio_driver}
38 | | | Run keyword | ${dut}.Add Heapsize | 4G
39 | | | Run keyword | ${dut}.Add Plugin | disable | default
40 | | | Run keyword | ${dut}.Add Plugin | enable | @{plugins_to_enable}
41 | | | Run keyword | ${dut}.Add IP6 Hash Buckets | 2000000
42 | | | Run keyword | ${dut}.Add IP6 Heap Size | 4G
43 | | | Run keyword | ${dut}.Add IP Heap Size | 4G
44
45 | Set up HTTP server with paramters on the VPP node
46 | | [Documentation]
47 | | ... | Configure IP address on the port, set it up and start HTTP server on
48 | | ... | the VPP.
49 | | ...
50 | | ... | *Arguments:*
51 | | ... | - ${prealloc_fifos} - Max number of connections you expect to handle
52 | | ... | at one time. Type: string
53 | | ... | - ${fifo_size} - FIFO size in kB. Type: string
54 | | ... | - ${private_segment_size} - Private segment size. Number + unit.
55 | | ... | Type: string
56 | | ...
57 | | ... | *Example:*
58 | | ...
59 | | ... | \| Set up HTTP server with paramters on the VPP node \| 400 \| 4096\
60 | | ... | \| 2g \|
61 | | ...
62 | | [Arguments] | ${prealloc_fifos} | ${fifo_size} | ${private_segment_size}
63 | | ...
64 | | Set Interface State | ${dut1} | ${dut1_if1} | up
65 | | Set Interface Address | ${dut1} | ${dut1_if1} | 192.168.10.2 | 24
66 | | Set Interface Address | ${dut1} | ${dut1_if1} | 192.168.20.2 | 24
67 | | Set Interface Address | ${dut1} | ${dut1_if1} | 192.168.30.2 | 24
68 | | Set Interface Address | ${dut1} | ${dut1_if1} | 192.168.40.2 | 24
69 | | Set Interface Address | ${dut1} | ${dut1_if1} | 192.168.50.2 | 24
70 | | Set Interface Address | ${dut1} | ${dut1_if1} | 192.168.60.2 | 24
71 | | Set Interface Address | ${dut1} | ${dut1_if1} | 192.168.70.2 | 24
72 | | Set Interface Address | ${dut1} | ${dut1_if1} | 192.168.80.2 | 24
73 | | Vpp Node Interfaces Ready Wait | ${dut1}
74 | | Start HTTP server params | ${dut1} | ${prealloc_fifos} | ${fifo_size}
75 | | ... | ${private_segment_size}
76 | | Sleep | 30