CSIT-233 IPv4 IPFIX - baseline tests
[csit.git] / resources / libraries / robot / ipfix.robot
1 # Copyright (c) 2016 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 """Traffic keywords"""
15
16 *** Settings ***
17 | Library | resources.libraries.python.TrafficScriptExecutor
18 | Library | resources.libraries.python.InterfaceUtil
19 | Resource | resources/libraries/robot/default.robot
20 | Documentation | Traffic keywords
21
22 *** Keywords ***
23 | Send packets and verify IPFIX
24 | | [Documentation] | Send simple TCP or UDP packets from source interface\
25 | | ... | to destination interface. Listen for IPFIX flow report on source\
26 | | ... | interface and verify received report against number of packets sent.
27 | | ...
28 | | ... | *Arguments:*
29 | | ...
30 | | ... | - tg_node - TG node. Type: dictionary
31 | | ... | - dst_node - Destination node. Type: dictionary
32 | | ... | - src_int - Source interface. Type: string
33 | | ... | - dst_int - Destination interface. Type: string
34 | | ... | - src_ip - Source IP address. Type: string
35 | | ... | - dst_ip - Destination IP address. Type: string
36 | | ... | - protocol - TCP or UDP (Optional, default is TCP). Type: string
37 | | ... | - port - Source and destination ports to use
38 | | ... | (Optional, default is port 20). Type: integer
39 | | ... | - count - Number of packets to send
40 | | ... | (Optional, default is one packet). Type: integer
41 | | ... | - timeout - Timeout value in seconds (Optional, default is 10 sec).
42 | | ... | Should be at least twice the configured IPFIX flow report interval.
43 | | ... | Type: integer
44 | | ...
45 | | ... | *Return:*
46 | | ...
47 | | ... | - No value returned
48 | | ...
49 | | ... | *Example:*
50 | | ...
51 | | ... | \| Send packets and verify IPFIX \| ${nodes['TG']} | ${nodes['DUT1']}\
52 | | ... | \| eth1 \| GigabitEthernet0/8/0 \| 16.0.0.1 \| 192.168.0.2 \| UDP \
53 | | ... | \| ${20} \| ${5} \| ${10} \|
54 | | ... |
55 | | [Arguments] | ${tg_node} | ${dst_node} | ${src_int} | ${dst_int} |
56 | | ... | ${src_ip} | ${dst_ip} | ${protocol}=tcp | ${port}=20 | ${count}=1
57 | | ... | ${timeout}=${10}
58 | | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int}
59 | | ${dst_mac}= | Get Interface Mac | ${dst_node} | ${dst_int}
60 | | ${src_int_name}= | Get interface name | ${tg_node} | ${src_int}
61 | | ${dst_int_name}= | Get interface name | ${dst_node} | ${dst_int}
62 | | ${args}= | Traffic Script Gen Arg | ${dst_int_name} | ${src_int_name}
63 | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip}
64 | | ${args}= | Set Variable
65 | | ... | ${args} --protocol ${protocol} --port ${port} --count ${count}
66 | | Run Traffic Script On Node | ipfix_check.py | ${tg_node} | ${args}
67 | | ... | ${timeout}