X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Frobot%2Fhoneycomb%2Faccess_control_lists.robot;h=57016f9a1aa0ace6c911bc1dd1471aa0bae6d7b5;hp=3f0b3d05927f71a01dd669f61fda37a57209ca85;hb=20cc67d5f23a7f4e05b08012bf3d3a63be4bcf63;hpb=b7f0c133f672b39b49e0480f71dd0629986bcf72 diff --git a/resources/libraries/robot/honeycomb/access_control_lists.robot b/resources/libraries/robot/honeycomb/access_control_lists.robot index 3f0b3d0592..57016f9a1a 100644 --- a/resources/libraries/robot/honeycomb/access_control_lists.robot +++ b/resources/libraries/robot/honeycomb/access_control_lists.robot @@ -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 @@ -135,7 +136,7 @@ | | ... | | ... | *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} @@ -170,7 +171,7 @@ | | ... | \| 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 @@ -191,23 +192,21 @@ | | ... | ${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 @@ -228,8 +227,8 @@ | | ... | 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:* @@ -239,19 +238,17 @@ | | ... | | ... | *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\ @@ -324,8 +321,9 @@ | | ... | \| ${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\ @@ -356,7 +354,7 @@ | | [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\ @@ -377,7 +375,7 @@ | | ... | ${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\ @@ -438,12 +436,12 @@ | | ${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}