sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
201 stars 727 forks source link

leftover route configuration from test_bgp_gr_helper_routes_perserved cause test_bgp_brr to fail #3786

Open slutati1536 opened 3 years ago

slutati1536 commented 3 years ago

Description

leftover route configuration from test_bgp_gr_helper_routes_perserved cause test_bgp_brr to fail

Steps to reproduce the issue: run the following tests in consecutive order:

test_bgp_bbr.py - tests pass test_bgp_gr_helper.py -test is skipped but configuration/cleanup is being executed test_bgp_bbr.py - tests fail

Describe the results you received: configuration of test test_bgp_gr_helper.py is uncleaned correctly, even when the test is skipped the setup/teardown of the tests is still being executed. the function "restore_nbr_gr" is not restoring the neighbors route.

this is causing the test of tets_ngp_bbr to fail on function check_other_vms because the route.prefix is in vm_route['vrfs']['default']['bgpRouteEntries'], so the tests fails.

def check_other_vms(nbrhosts, setup, route, accepted=True, node=None, results=None):
    logger.info('Check route {} on {}'.format(str(route), node))

    dut_asn = setup['dut_asn']
    tor1_asn = setup['tor1_asn']

    vm_route = nbrhosts[node]['host'].get_route(route.prefix)
    vm_route['failed'] = False
    vm_route['message'] = 'Checking route {} on {} passed'.format(str(route), node)
    if accepted:
        if route.prefix not in vm_route['vrfs']['default']['bgpRouteEntries'].keys():
            vm_route['failed'] = True
            vm_route['message'] = 'No route for {} found on {}'.format(route.prefix, node)
   Failed: Checking route Route(prefix='172.16.10.0/24', nexthop=u'10.0.0.32', aspath='65100 64101') failed, failed_results: { 

on log:

E "ARISTA06T0": {

E "failed": true,

E "message": "No route for 172.16.10.0/24 found on ARISTA06T0",

E "vrfs": {

E "default": {

E "routerId": "100.1.0.22",

E "bgpRouteEntries": {},

E "vrf": "default",

E "asn": "64006"

E }

E }

E },

E
Describe the results you expected: test failed because check_other_vms, but check_other_vms should pass

Additional information you deem important:

**Output of `show version`:**
SONiC Software Version: SONiC.202012.125-a5fe47858_Internal
Distribution: Debian 10.10
Kernel: 4.19.0-12-2-amd64
Build commit: a5fe47858
Build date: Sun Jul 11 19:57:57 UTC 2021
Built by: sw-r2d2-bot@r-build-sonic-ci03

Platform: x86_64-mlnx_msn3700-r0
HwSKU: ACS-MSN3700
ASIC: mellanox
ASIC Count: 1
Serial Number: MT1851X02961
Uptime: 15:20:59 up  2:23,  1 user,  load average: 0.73, 1.13, 1.17

Docker images:
REPOSITORY                    TAG                             IMAGE ID            SIZE
docker-syncd-mlnx             202012.125-a5fe47858_Internal   b46673b01389        951MB
docker-syncd-mlnx             latest                          b46673b01389        951MB
docker-snmp                   202012.125-a5fe47858_Internal   b8c9dccf4ee6        442MB
docker-snmp                   latest                          b8c9dccf4ee6        442MB
docker-teamd                  202012.125-a5fe47858_Internal   0c2355d28aea        411MB
docker-teamd                  latest                          0c2355d28aea        411MB
docker-nat                    202012.125-a5fe47858_Internal   10935438a571        414MB
docker-nat                    latest                          10935438a571        414MB
docker-sonic-mgmt-framework   202012.125-a5fe47858_Internal   42d8d48e33db        622MB
docker-sonic-mgmt-framework   latest                          42d8d48e33db        622MB
docker-router-advertiser      202012.125-a5fe47858_Internal   2cfa88f062b6        401MB
docker-router-advertiser      latest                          2cfa88f062b6        401MB
docker-platform-monitor       202012.125-a5fe47858_Internal   eae9c0efef95        721MB
docker-platform-monitor       latest                          eae9c0efef95        721MB
docker-lldp                   202012.125-a5fe47858_Internal   aa8a44c643c8        441MB
docker-lldp                   latest                          aa8a44c643c8        441MB
docker-database               202012.125-a5fe47858_Internal   8c29c916fdac        401MB
docker-database               latest                          8c29c916fdac        401MB
docker-orchagent              202012.125-a5fe47858_Internal   adb1c8797afc        430MB
docker-orchagent              latest                          adb1c8797afc        430MB
docker-sonic-telemetry        202012.125-a5fe47858_Internal   5045b96ba620        491MB
docker-sonic-telemetry        latest                          5045b96ba620        491MB
docker-fpm-frr                202012.125-a5fe47858_Internal   38f3faaf58da        430MB
docker-fpm-frr                latest                          38f3faaf58da        430MB
docker-dhcp-relay             202012.125-a5fe47858_Internal   ef55ec70075b        408MB
docker-dhcp-relay             latest                          ef55ec70075b        408MB
docker-sflow                  202012.125-a5fe47858_Internal   193481185c66        412MB
docker-sflow                  latest                          193481185c66        412MB
docker-sonic-restapi          202012.125-a5fe47858_Internal   1672a6d5bf23        352MB
docker-sonic-restapi          latest                          1672a6d5bf23        352MB
**Attach debug file `sudo generate_dump`:**

sonic_dump_arc-switch1038_20210713_142949.tar.gz

roy-sror commented 3 years ago

@yxieca - can you please assist in assigning this ticket to the relevant owner.

lguohan commented 3 years ago

@lolyu , can you check?

lolyu commented 3 years ago

Could reproduce this, will propose a PR to fix

roy-sror commented 2 years ago

@lolyu - could you please update on the status of this issue.

roy-sror commented 2 years ago

@lolyu , @yxieca - any update on that?