-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Azure:main' into pr-baby-hero-test1
- Loading branch information
Showing
27 changed files
with
1,592 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -584,6 +584,7 @@ Unpair | |
untracked | ||
upcasting | ||
upstreaming | ||
utils | ||
vcpus | ||
veth | ||
VFP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Requires <url of sai-challenger branch> <commit sha> or something | ||
FROM sc-client | ||
|
||
ADD tests/ /tests/ | ||
|
Submodule SAI-Challenger
updated
111 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Table of content | ||
|
||
1. [Objectives](#objectives) | ||
2. [Requirements](#requirements) | ||
3. [Automation](#automation) | ||
4. [Test Suites](#test-suites) | ||
- [ENI creation](#eni-creation) | ||
- [ENI removal](#eni-removal) | ||
- [ENI scale](#eni-scale) | ||
|
||
--- | ||
|
||
# Objectives | ||
|
||
Verify proper CRUD API operations and scaling for Elastic Network Interface (ENI). | ||
|
||
# Requirements | ||
|
||
| Item | Expected value | | ||
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| ENI per card | 64 | | ||
| Bulk operations | Yes | | ||
| Admin state | When the ENI is admin-state down, the packets destined to this ENI shall be dropped. | | ||
| Remove | - During ENI delete, implementation must support ability to delete all mappings or routes in a single API call.<br>- Deleting an object that doesn't exists shall not return an error and shall not perform any force-deletions or delete dependencies implicitly. Sonic implementation shall validate the entire API as pre-checks before applying and return accordingly | | ||
| Memory | Flexible memory allocation for ENI and not reserve max scale during initial create. (To allow oversubscription) | | ||
| Error handling | Implementation must not have silent failures for APIs. | | ||
|
||
# Automation | ||
|
||
Test cases are automated using SAI PTF test framework. | ||
|
||
# Test suites | ||
|
||
## ENI creation | ||
|
||
Verifies create operations, an association with VNI, MAC. | ||
|
||
| # | Test case | Test Class.Method | | ||
|-----|---------------------------------------------------------------|---------------------------------------------------------------------------------------------------| | ||
| 1 | create inbound/outbound DASH ACL groups entries | `CreateDeleteEniTest.createInOutAclGroupsTest` | | ||
| 2 | create VNET entry | `CreateDeleteEniTest.createVnetTest` | | ||
| 3 | create Direction lookup entry | `CreateDeleteEniTest.createDirectionLookupTest` | | ||
| 4 | create ENI entry | `CreateDeleteEniTest.createEniTest` | | ||
| 5 | create ENI Ether address map entry | `CreateDeleteEniTest.createEniEtherAddressMapTest` | | ||
| 6 | create Inbound routing entry | `CreateDeleteEniTest.createInboundRoutingEntryTest` | | ||
| 7 | create PA validation entry | `CreateDeleteEniTest.createPaValidationTest` | | ||
| 8 | create Outbound routing entry | `CreateDeleteEniTest.createOutboundRoutingEntryTest` | | ||
| 9 | create Outbound CA to PA entry | `CreateDeleteEniTest.createCa2PaEntryTest` | | ||
| 10 | verify DASH ACL Group entry attributes getting/setting | `CreateDeleteEniTest.dashAclGroupAttributesTest` | | ||
| 11 | verify VNET entry attributes getting/setting | `CreateDeleteEniTest.vnetAttributesTest` | | ||
| 12 | verify Direction lookup entry attributes getting/setting | `CreateDeleteEniTest.directionLookupAttributesTest` | | ||
| 13 | verify Inbound routing entry attributes getting/setting | `CreateDeleteEniTest.inboundRoutingEntryAttributesTest` | | ||
| 14 | verify ENI attributes getting/setting | `CreateDeleteEniTest.eniGetAttributesTest`<br/> `CreateDeleteEniTest.eniSetAndGetAttributesTest` | | ||
| 15 | verify ENI Ether address map entry attributes getting/setting | `CreateDeleteEniTest.eniEtherAddressMapAttributesTest` | | ||
| 16 | verify PA validation entry attributes getting/setting | `CreateDeleteEniTest.paValidationEntryAttributesTest` | | ||
| 17 | verify Outbound routing entry attributes getting/setting | `CreateDeleteEniTest.outboundRoutingEntryAttributesTest` | | ||
| 18 | verify Outbound CA to PA entry attributes getting/setting | `CreateDeleteEniTest.outboundCa2PaEntryAttributesTest` | | ||
|
||
## ENI removal | ||
|
||
Verifies remove operations. | ||
|
||
| # | Test case | Test Class.Method | | ||
|-----|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| | ||
| 1 | normal delete:<br>verify deletion of: inbound/outbound DASH ACL groups, VNET, ENI, ENI Ether address map entry, PA validation entry, inbound/outbound routing entry | Is a part of `CreateDeleteEniTest.destroy_teardown_obj` | | ||
| 2 | error if mapped rules exist:<br>verify VNET cannot be deleted when map exist | `CreateDeleteEniTest.deleteVnetWhenMapExistTest` | | ||
| 3 | duplicated deletion<br>no errors expected | Is a part of `CreateDeleteEniTest.destroy_teardown_obj` | | ||
| 4 | ENI deletion when map exists: no errors, related entries also deleted(To clarify: list of entries that must be deleted) | `CreateDeleteEniTest.deleteEniWhenMapExistTest` | | ||
| 5 | normal bulk delete | - | | ||
| 6 | bulk delete does not remove any if there is a mapping for some ENI | - | | ||
|
||
## ENI scale. | ||
|
||
Verifies basic ENI scale, create/remove/recreate maximum number of ENIs . | ||
|
||
| # | Test case | Test Class.Method | | ||
|-----|------------------------------------------------------------------|-----------------------------| | ||
| 1 | Create/remove a max number of ENI entries | `EniScaleTest.eniScaleTest` | | ||
| 2 | Recreate (repeated creation/removal a max number of ENI entries) | `EniScaleTest.eniScaleTest` | | ||
|
||
## ENI negative | ||
|
||
| # | Test case purpose | Test Class.Method | Test description | | ||
|:---:|:---------------------------------------------------------------|:---------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------| | ||
| 1 | Verifies failure in case of creation the same ENIs in one VNET | `CreateTwoSameEnisNegativeTest`.<br/> `enisCreationTest` | Create two same ENIs in the single VNET and verify creation failure.<br/> **To clarify:** exact step to expect failure | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/bash | ||
# To be run inside saithrift-client container, assumes SAI repo portions exist under /SAI directory | ||
|
||
SCRIPT=$0 | ||
BMV2="True" | ||
TEST_DIR="functional/ptf" | ||
EXTRA_PARAMETERS="" | ||
INTERFACES="veth1,veth3" | ||
TIMEOUT=1800 | ||
TEST_PARAMS="" | ||
|
||
function show_help_and_exit() | ||
{ | ||
echo "Usage ${SCRIPT} [options]" | ||
echo " options with (*) must be provided" | ||
echo " -h -? : get this help" | ||
echo " -s <server ip> : specify thrift server IP address (e.g. -s 192.168.1.1)" | ||
echo " -p <port map file path> : specify path to port map file (e.g. -p /tests-dev/config/front-map.ini)" | ||
echo " -c <port config path> : specify path to port config file (e.g. -c /tests-dev/config/port-map.ini)" | ||
echo " -U : specify to run PTF underlay test cases. (default: run PTF overlay test cases)" | ||
echo " -I <interfaces> : specify comma-separated DUT 2 interfaces names (default: veth1,veth3)" | ||
echo " -H : specify if tests are run on real hardware" | ||
echo " -e <parameters> : specify extra parameter(s) (default: none)" | ||
echo -e " -t <timeout> : specify timeout for test case execution\n" | ||
|
||
exit $1 | ||
} | ||
|
||
function validate_parameters() | ||
{ | ||
RET=0 | ||
|
||
if [[ ${#iface_array[@]} < 2 ]] || [[ ${#iface_array[@]} > 2 ]]; then | ||
echo -e "\nTwo interfaces names must be specified (e.g. -I iface1, iface2)." | ||
echo -e "Instead received - ${#iface_array[@]}: $INTERFACES\n" | ||
RET=1 | ||
fi | ||
|
||
if [[ ${RET} != 0 ]]; then | ||
show_help_and_exit ${RET} | ||
fi | ||
} | ||
|
||
while getopts "h?UHI:s:p:c:e:t:" opt; do | ||
case ${opt} in | ||
h|\? ) | ||
show_help_and_exit 0 | ||
;; | ||
U ) | ||
TEST_DIR="/SAI/ptf" | ||
;; | ||
H ) | ||
BMV2="False" | ||
;; | ||
I ) | ||
INTERFACES=${OPTARG} | ||
;; | ||
s ) | ||
TEST_PARAMS="${TEST_PARAMS}thrift_server='${OPTARG}';" | ||
;; | ||
p ) | ||
TEST_PARAMS="${TEST_PARAMS}port_map_file='${OPTARG}';" | ||
;; | ||
c ) | ||
TEST_PARAMS="${TEST_PARAMS}port_config_ini='${OPTARG}';" | ||
;; | ||
e ) | ||
EXTRA_PARAMETERS="${EXTRA_PARAMETERS} ${OPTARG}" | ||
;; | ||
t ) | ||
TIMEOUT=${OPTARG} | ||
esac | ||
done | ||
|
||
IFS="," read -a iface_array <<< $INTERFACES | ||
|
||
validate_parameters | ||
|
||
set -x | ||
ptf \ | ||
--test-dir ${TEST_DIR}\ | ||
--pypath /SAI/ptf \ | ||
--interface 0@${iface_array[0]} \ | ||
--interface 1@${iface_array[1]} \ | ||
--test-case-timeout=${TIMEOUT} \ | ||
--test-params="bmv2=${BMV2};${TEST_PARAMS}" \ | ||
${EXTRA_PARAMETERS} |
Oops, something went wrong.