sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
200 stars 728 forks source link

[ gnmi/test_gnmi_appldb.py ] - Fails due to AssertionError in T0 Physical Topology #8332

Open Vickyni2 opened 1 year ago

Vickyni2 commented 1 year ago

Description The test case gnmi/test_gnmi_appldb.py fails due to Assertion Error in T0 topology with a physical DUT

Steps to reproduce the issue: 1.Run the test case in a physical DUT. 2.

Describe the results you received:

=================================== FAILURES =================================== _ test_gnmi_appldb_01 __

duthosts = [] rand_one_dut_hostname = 'dev-msn2700-01' localhost = <tests.common.devices.local.Localhost object at 0x7f9c445c4bd0>

def test_gnmi_appldb_01(duthosts, rand_one_dut_hostname, localhost):
    '''
    Verify GNMI native write with ApplDB
    Update DASH_VNET_TABLE
    '''
    duthost = duthosts[rand_one_dut_hostname]
    file_name = "vnet.txt"
    text = "{\"Vnet1\": {\"vni\": \"1000\", \"guid\": \"559c6ce8-26ab-4193-b946-ccc6e8f930b2\"}}"
    with open(file_name, 'w') as file:
        file.write(text)
    # Add DASH_VNET_TABLE
    update_list = ["/sonic-db:APPL_DB/DASH_VNET_TABLE:@./%s" % (file_name)]
    ret, msg = gnmi_set(duthost, localhost, [], update_list, [])
  assert ret == 0, msg

E AssertionError: F0516 19:06:34.047198 562991 gnmi_set.go:192] Set failed: rpc error: code = Unavailable desc = connection closed

duthost = duthosts = [] file = <closed file 'vnet.txt', mode 'w' at 0x7f9c4c40b9c0> file_name = 'vnet.txt' localhost = <tests.common.devices.local.Localhost object at 0x7f9c445c4bd0> msg = u'F0516 19:06:34.047198 562991 gnmi_set.go:192] Set failed: rpc error: code = Unavailable desc = connection closed' rand_one_dut_hostname = 'dev-msn2700-01' ret = -1 text = '{"Vnet1": {"vni": "1000", "guid": "559c6ce8-26ab-4193-b946-ccc6e8f930b2"}}' update_list = ['/sonic-db:APPL_DB/DASH_VNET_TABLE:@./vnet.txt']

gnmi/test_gnmi_appldb.py:27: AssertionError

Describe the results you expected: The test case should PASS.

Additional information you deem important:

**Output of `show version`:**

SONiC Software Version: SONiC.202211.269499-59c7d39ef SONiC OS Version: 11 Distribution: Debian 11.6 Kernel: 5.10.0-18-2-amd64 Build commit: 59c7d39ef Build date: Tue May 9 17:58:15 UTC 2023 Built by: AzDevOps@vmss-soni00118K Platform: x86_64-accton_as7716_32x-r0 HwSKU: Accton-AS7716-32X ASIC: broadcom ASIC Count: 1

**Attach debug file `sudo generate_dump`:**

```
(paste your output here)
```
Vickyni2 commented 1 year ago

Same Error seen in [ gnmi / test_gnmi_configdb.py ] with the same Assertion Error .

ERROR LOG :

filename = 'full.txt' interface = 'Ethernet4' localhost = <tests.common.devices.local.Localhost object at 0x7efeac5282d0> msg = u'F0516 19:16:20.864516 566396 gnmi_set.go:192] Set failed: rpc error: code = Unavailable desc = connection closed' output = {'stderr_lines': [], u'cmd': u'sonic-cfggen -d --print-data', u'end': u'2022-0... "tagging_mode": "untagged"', u' }', u' }', u'}'], 'failed': False} rand_one_dut_hostname = 'dev-msn2700-01' ret = -1 update_list = ['/sonic-db:CONFIG_DB/:@full.txt']

gnmi/test_gnmi_configdb.py:134: AssertionError

yxieca commented 1 year ago

@qiluo-msft can you give some advices?