Improve test tag string parsing
[csit.git] / resources / libraries / robot / honeycomb / access_control_lists.robot
index 3f0b3d0..57016f9 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2019 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -10,6 +10,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 *** Variables ***
 #TODO: update based on resolution of bug https://jira.fd.io/browse/HONEYCOMB-119
 
 | | ...
 | | ... | *Example:*
 | | ...
-| | ... | \| ACL session from VAT should be \| ${nodes['DUT1']} \
+| | ... | \| ACL session from PAPI should be \| ${nodes['DUT1']} \
 | | ... | \| ${0} \| ${settings} \|
 | | [Arguments] | ${node} | ${table_index} | ${settings}
 | | ${data}= | Get classify table data | ${node} | ${table_index}
 | | ... | \| ACL table from VAT should not exist \| ${nodes['DUT1']} \
 | | ... | \| ${0} \|
 | | [Arguments] | ${node} | ${table_index}
-| | Run keyword and expect error | VAT: no JSON data.
+| | Run keyword and expect error | *
 | | ... | Get classify table data | ${node} | ${table_index}
 
 | ACL session from Honeycomb should be
 | | ... | ${node} | ${table_name} | ${settings['match']}
 | | Compare data structures | ${data} | ${settings}
 
-| ACL session from VAT should be
-| | [Documentation] | Retrieves ACL session information from VAT\
+| ACL session from PAPI should be
+| | [Documentation] | Retrieves ACL session information from PAPI\
 | | ... | and compares with expected settings.
 | | ...
 | | ... | *Arguments:*
 | | ... | - node - information about a DUT node. Type: dictionary
 | | ... | - table_index - VPP internal index of an ACL table. Type: integer
-| | ... | - session_index - VPP internal index of an ACL session. Type: integer
 | | ... | - settings - expected ACL session settings. Type: dictionary
 | | ...
 | | ... | *Example:*
 | | ...
-| | ... | \| ACL session from VAT should be \| ${nodes['DUT1']} \
-| | ... | \| ${0} \| ${0} \| ${settings} \|
+| | ... | \| ACL session from PAPI should be \| ${nodes['DUT1']} \
+| | ... | \| ${0} \| ${settings} \|
 | | [Arguments] | ${node} | ${table_index} | ${session_index} | ${settings}
-| | ${data}= | Get classify session data
-| | ... | ${node} | ${table_index} | ${session_index}
+| | ${data}= | Get classify session data | ${node} | ${table_index}
 | | Compare data structures | ${data} | ${settings}
 
 | ACL session from Honeycomb should not exist
 | | ... | Get classify session oper data
 | | ... | ${node} | ${table_name} | ${session_match}
 
-| ACL session from VAT should not exist
-| | [Documentation] | Retrieves ACL session information from VAT\
+| ACL session from PAPI should not exist
+| | [Documentation] | Retrieves ACL session information from PAPI\
 | | ... | and compares with expected settings.
 | | ...
 | | ... | *Arguments:*
 | | ...
 | | ... | *Example:*
 | | ...
-| | ... | \| ACL session from VAT should not exist \| ${nodes['DUT1']} \
-| | ... | \| ${0} \| ${0} \|
-| | [Arguments] | ${node} | ${table_index} | ${session_index}
+| | ... | \| ACL session from PAPI should not exist \| ${nodes['DUT1']} \
+| | ... | \| ${0} \|
+| | [Arguments] | ${node} | ${table_index}
 | | Run keyword if | ${session_index} == 0
 | | ... | Run keyword and expect error
 | | ... | ValueError: No JSON object could be decoded
-| | ... | Get classify session data
-| | ... | ${node} | ${table_index} | ${session_index}
+| | ... | Get classify session data | ${node} | ${table_index}
 | | Run keyword if | ${session_index} > 0
 | | ... | Run keyword and expect error
 | | ... | IndexError: list index out of range
-| | ... | Get classify session data
-| | ... | ${node} | ${table_index} | ${session_index}
+| | ... | Get classify session data | ${node} | ${table_index}
 
 | Interface ACL configuration from Honeycomb should be
 | | [Documentation] | Retrieves ACL interface settings from Honeycomb\
 | | ... | \| ${nodes['DUT1']} \| GigabithEthernet0/8/0 \|
 | | [Arguments] | ${node} | ${interface}
 | | ${data}= | Get interface classify table | ${node} | ${interface}
-| | Should be equal | ${data['l2_table_id']} | ${-1}
-| | Should be equal | ${data['ip4_table_id']} | ${-1}
+| | ${bitwise_non_zero}= | Convert To Integer | ${0xFFFFFFFF}
+| | Should be equal | ${data['l2_table_id']} | ${bitwise_non_zero}
+| | Should be equal | ${data['ip4_table_id']} | ${bitwise_non_zero}
 
 | Clear all ACL settings
 | | [Documentation] | Removes all ACL sessions and tables from Honeycomb\
 | | [Arguments] | ${node} | ${acl_list_name} | ${acl_list_settings}
 | | ... | ${macip}=${False}
 | | Create ACL plugin classify chain
-| | ... | ${node} | ${acl_list_name} | ${acl_list_settings} | ${macip}
+| | ... | ${node} | ${acl_list_name} | ${acl_list_settings}
 
 | Honeycomb assigns plugin-ACL chain to interface
 | | [Documentation] | Applies classification through the high-level\
 | | ... | ${node} | ${interface} | ${acl_list_name} | ${direction}
 | | ... | ${macip}=${False}
 | | Set ACL plugin interface
-| | ... | ${node} | ${interface} | ${acl_list_name} | ${direction} | ${macip}
+| | ... | ${node} | ${interface} | ${acl_list_name} | ${direction}
 
 | Clear plugin-ACL configuration
 | | [Documentation] | Removes ACl assignment from interface, then deletes\
 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_port}
 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
 | | ${args}= | Catenate | --src_mac | ${tx_mac}
-| | ...                 | --dst_mac | ${rx_mac}
-| | ...                 | --src_ip | ${src_ip}
-| | ...                 | --dst_ip | ${dst_ip}
-| | ...                 | --tx_if | ${tx_port_name}
-| | ...                 | --rx_if | ${rx_port_name}
-| | ...                 | --icmp_type | ${icmp_type}
-| | ...                 | --icmp_code | ${icmp_code}
+| | ... | --dst_mac | ${rx_mac}
+| | ... | --src_ip | ${src_ip}
+| | ... | --dst_ip | ${dst_ip}
+| | ... | --tx_if | ${tx_port_name}
+| | ... | --rx_if | ${rx_port_name}
+| | ... | --icmp_type | ${icmp_type}
+| | ... | --icmp_code | ${icmp_code}
 | | Run Traffic Script On Node | send_icmp_type_code.py
 | | ... | ${tg_node} | ${args}