Skip to content

[sanity check] add BGP to the sanity check list#1963

Merged
yxieca merged 2 commits intosonic-net:masterfrom
yxieca:sanity
Jul 27, 2020
Merged

[sanity check] add BGP to the sanity check list#1963
yxieca merged 2 commits intosonic-net:masterfrom
yxieca:sanity

Conversation

@yxieca
Copy link
Collaborator

@yxieca yxieca commented Jul 24, 2020

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

Noticed that nightly test left system in a state that all BGP sessions are gone.

admin@str-dx010-acs-1:~$ show ip bgp sum
% No BGP neighbors found

How did you do it?

  • Generate warning log when sanity check recovery action is taken.
  • Check BGP neighbor health by default.
  • Separate the default check list from supported check list.
  • Allow disabling check with command line parameters.
  • Increase load_config recovery wait time to 120 seconds.
  • Address variable used before initialize issue in bgp_facts.py.

Signed-off-by: Ying Xie [email protected]

How did you verify/test it?

  • Without the change, when BGP is not healthy, test can still pass:

================================================================================== test session starts ===================================================================================
platform linux2 -- Python 2.7.12, pytest-4.6.5, py-1.8.1, pluggy-0.13.1
ansible: 2.8.7
rootdir: /var/src/sonic-mgmt/tests, inifile: pytest.ini
plugins: ansible-2.2.2, xdist-1.28.0, forked-1.1.3, repeat-0.8.0
collected 1 item

test_interfaces.py::test_interfaces PASSED

  • With the change, when BGP is not healthy, recovery action will be taken:
    ================================================================================== test session starts ===================================================================================
    platform linux2 -- Python 2.7.12, pytest-4.6.5, py-1.8.1, pluggy-0.13.1
    ansible: 2.8.7
    rootdir: /var/src/sonic-mgmt/tests, inifile: pytest.ini
    plugins: ansible-2.2.2, xdist-1.28.0, forked-1.1.3, repeat-0.8.0
    collected 1 item

test_interfaces.py::test_interfaces
------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------
21:25:46 ERROR recover.py:adaptive_recover:80: Restoring {'check_item': 'bgp', 'failed': True} with proposed action config_reload, final action config_reload
PASSED [100%]

  • Manually shutdown a session and it will also trigger recovery:
    ================================================================================== test session starts ===================================================================================
    platform linux2 -- Python 2.7.12, pytest-4.6.5, py-1.8.1, pluggy-0.13.1
    ansible: 2.8.7
    rootdir: /var/src/sonic-mgmt/tests, inifile: pytest.ini
    plugins: ansible-2.2.2, xdist-1.28.0, forked-1.1.3, repeat-0.8.0
    collected 1 item

test_interfaces.py::test_interfaces
------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------
21:47:44 WARNING checks.py:check_bgp_status:115: BGP neighbors down: [u'10.0.0.33']
21:48:19 WARNING recover.py:adaptive_recover:80: Restoring {'check_item': 'bgp', 'failed': True, 'down_neighbors': [u'10.0.0.33']} with proposed action: config_reload, final action: config_reload
PASSED [100%]

@lgtm-com
Copy link

lgtm-com bot commented Jul 24, 2020

This pull request introduces 1 alert when merging d626dd1bb6ad17d772c0d3515210e9d47f2a1ddf into 7ced602 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

- Generate warning log when sanity check recovery action is taken.
- Check BGP neighbor health by default.
- Separate the default check list from supported check list.
- Allow disabling check with command line parameters.
- Increase load_config recovery wait time to 120 seconds.
- Address variable used before initialize issue in bgp_facts.py.

Signed-off-by: Ying Xie <[email protected]>
@yxieca yxieca merged commit 106fbd0 into sonic-net:master Jul 27, 2020
@yxieca yxieca deleted the sanity branch July 27, 2020 05:18
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
Update submodule sonic-utilities that contains the following commits:

Revert "[202012] [generate_dump] allow to extend dump with plugin scripts (sonic-net#1945)" (sonic-net#1993)
[soft-reboot] Add support for platforms based on Device Tree (sonic-net#1963)
[Reclaiming buffer][202012] Database migrator for reclaiming buffer (sonic-net#1898)
[202012] [generate_dump] allow to extend dump with plugin scripts (sonic-net#1945)

Signed-off-by: dprital <[email protected]>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
4236bc4 [config reload] Fixing config reload when timer based delayed services are disabled (sonic-net#1967)
d2514e4 [GCU] Different apply-patch runs should produce same sorted steps (sonic-net#1988)
2878adb [GCU] Using simulated config instead of target config when validating replace operation in NoDependencyMoveValidator (sonic-net#1987)
fb8ca98 [GCU] Loading yang-models only once (sonic-net#1981)
f88ee92 [GCU] Copying config_db before callding sonic_yang.loadData (sonic-net#1983)
9ed0e91 [GCU] Implementing DryRun by printing patch-sorter steps/imitating config_db (sonic-net#1973)
b36b5e3 [GCU] Moving PatchSorter unit-test to json file to make it easier to read/maintain (sonic-net#1977)
c0fa28b [generic-config-updater] Improving CreateOnly validator and marking /LOOPBACK_INTERFACE/LOOPBACK#/vrf_name as create-only (sonic-net#1969)
0559d04 [generic-config-updater] Adding non-strict mode (sonic-net#1929)
b07f477 [debug dump util] FDB debug dump util changes (sonic-net#1968)
6d8757a [warm/fast-reboot] Fix kexec portion to support platforms based on Device Tree (sonic-net#1966)
cc1409e [Auto Techsupport] Event driven Techsupport Bug Fixes (sonic-net#1986)
6c48bd5 Fix wrong help message for cable length setting (sonic-net#1978)
c0bbbe3 [breakout] Fix the check  when port is not present in BREAKOUT_CFG table (sonic-net#1765)
5bb8cad [doc][DPB] Update DPB related interface breakout command Info (sonic-net#1438)
e6fd990 [config] Fix 'config reload -l' command to get filename by default (sonic-net#1611)
bd8f7bb Update swss_ready check to check per namespace swss service (sonic-net#1974)
5439f94 [soft-reboot] Add support for platforms based on Device Tree (sonic-net#1963)
7c5810a [config] Add portchannel support  for static route  (sonic-net#1857)
7cb6a1b preserve old order for config reload (sonic-net#1964)
20bddbd [Auto-Techsupport] Issues related to Multiple Cores crashing handled (sonic-net#1948)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants