Open
Description
The following test case fails on the remove operation. I found experimentally if I delete the extraneous information after the "op" it passes. All I can see in the DUT switch trace (DASH bmv2) is "Match key not found." The sai-thrift -server trace shows a P4Runtime error:
GRPC call Write::DELETE ERROR:
table_id: 38612462 match { field_id: 1 exact { value: "\000\252\252\252\273\000" } }
I assume this is some kind of key, but I can't associate it with anything SAI Challenger is doing because I can't see any trace info.
I suppose there needs to be some clear rules regarding use of "name" vs "key" in a DASH sai record. Please document.
import json
import time
from pathlib import Path
from pprint import pprint
import pytest
# Constants
SWITCH_ID = 5
class TestSaiVnetVni:
def test_vnet_eni_ether_address_create(self, dpu):
commands = [
{
"name": "eni_ether_address_map_entry",
"op": "create",
"type": "SAI_OBJECT_TYPE_ENI_ETHER_ADDRESS_MAP_ENTRY",
"key": {
"switch_id": "$SWITCH_ID",
"address": "00:AA:AA:AA:AA:00"
},
"attributes": [
"SAI_ENI_ETHER_ADDRESS_MAP_ENTRY_ATTR_ENI_ID",
"1"
]
},
]
result = [*dpu.process_commands(commands)]
print("\n======= SAI commands RETURN values create =======")
pprint(result)
def test_vnet_eni_ether_address_remove(self, dpu):
commands = [
{
"name": "eni_ether_address_map_entry",
"op": "remove",
# Keeping entries below this causes test to fail; removing makes it pass
"type": "SAI_OBJECT_TYPE_ENI_ETHER_ADDRESS_MAP_ENTRY",
"key": {
"switch_id": "$SWITCH_ID",
"address": "00:AA:AA:AA:BB:00"
},
"attributes": [
"SAI_ENI_ETHER_ADDRESS_MAP_ENTRY_ATTR_ENI_ID",
"$eni_id"
]
},
]
result = [*dpu.process_commands(commands)]
print("\n======= SAI commands RETURN values remove =======")
pprint(result)