INMARSAT-54 Honeycomb configures PBB
[csit.git] / resources / libraries / robot / telemetry / 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 """IPFIX 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}
68
69 | Send session sweep and verify IPFIX
70 | | [Documentation] | Send simple TCP or UDP packets from source interface\
71 | | ... | to destination interface using a range of source addresses. Listen\
72 | | ... | for IPFIX flow report on source interface and verify received report\
73 | | ... | against number of packets sent from each source address.
74 | | ...
75 | | ... | *Arguments:*
76 | | ...
77 | | ... | - tg_node - TG node. Type: dictionary
78 | | ... | - dst_node - Destination node. Type: dictionary
79 | | ... | - src_int - Source interface. Type: string
80 | | ... | - dst_int - Destination interface. Type: string
81 | | ... | - src_ip - Source IP address. Type: string
82 | | ... | - dst_ip - Destination IP address. Type: string
83 | | ... | - ip_range - Number of sequential source addresses. Type:integer
84 | | ... | - protocol - TCP or UDP (Optional, defaults to TCP). Type: string
85 | | ... | - port - Source and destination ports to use (Optional). Type: integer
86 | | ... | - count - Number of packets to send (Optional). Type: integer
87 | | ... | - timeout - Timeout value in seconds (optional). Type:integer
88 | | ...
89 | | ... | *Return:*
90 | | ...
91 | | ... | - No value returned
92 | | ...
93 | | ... | *Example:*
94 | | ...
95 | | ... | \| Send packets and verify IPFIX \| ${nodes['TG']} | ${nodes['DUT1']}\
96 | | ... | \| eth1 \| GigabitEthernet0/8/0 \| 16.0.0.1 \| 192.168.0.2 \| 20 \|
97 | | ... | UDP \| ${20} \| ${5} \| ${10} \|
98 | | ... |
99 | | [Arguments] | ${tg_node} | ${dst_node} | ${src_int} | ${dst_int} |
100 | | ... | ${src_ip} | ${dst_ip} | ${ip_range} | ${protocol}=tcp | ${port}=20
101 | | ... | ${count}=${1} | ${timeout}=${10}
102 | | ${src_mac}= | Get Interface Mac | ${tg_node} | ${src_int}
103 | | ${dst_mac}= | Set Variable | ${dut1_to_tg_mac}
104 | | ${src_int_name}= | Get interface name | ${tg_node} | ${src_int}
105 | | ${dst_int_name}= | Get interface name | ${dst_node} | ${dst_int}
106 | | ${args}= | Traffic Script Gen Arg | ${dst_int_name} | ${src_int_name}
107 | | ... | ${src_mac} | ${dst_mac} | ${src_ip} | ${dst_ip}
108 | | ${args}= | Set Variable | ${args} --protocol ${protocol} --port ${port}
109 | | ${args}= | Set Variable | ${args} --count ${count} --sessions ${ip_range}
110 | | Run Traffic Script On Node | ipfix_sessions.py | ${tg_node} | ${args}
111 | | ... | ${timeout}