Skip to content

[test_vlan] Update test_vlan to fix warmRestartCheck error#2328

Merged
bingwang-ms merged 1 commit intosonic-net:masterfrom
bingwang-ms:update_vlan_test
Oct 12, 2020
Merged

[test_vlan] Update test_vlan to fix warmRestartCheck error#2328
bingwang-ms merged 1 commit intosonic-net:masterfrom
bingwang-ms:update_vlan_test

Conversation

@bingwang-ms
Copy link
Collaborator

@bingwang-ms bingwang-ms commented Oct 10, 2020

Description of PR

Summary:
Test case test_vlan added some static route in order to do test.
https://github.com/Azure/sonic-mgmt/blob/457a6400e16bf018d16d0ca64e9a50a03f6ef911/tests/vlan/test_vlan.py#L143-L148
However, these staticly added routes are not cleared after test. As a result, warm-reboot will report errors because RESTARTCHECK failed.

root@str-7260cx3-acs-2:/var/log# warm-reboot -v
Sat Oct 10 06:43:36 UTC 2020 Pausing orchagent ...
RESTARTCHECK failed
Sat Oct 10 06:43:36 UTC 2020 warm-reboot failure (10) cleanup ...
Sat Oct 10 06:43:37 UTC 2020 Cancel warm-reboot: code (1)

Logs in syslog told that these uncleared route caused warmRestartCheck failed

Oct 10 06:43:36.862060 str-7260cx3-acs-2 NOTICE swss#orchagent_restart_check: :- main: requested orchagent to do warm restart state check, retry count: 0
Oct 10 06:43:36.862305 str-7260cx3-acs-2 NOTICE swss#orchagent: :- doTask: RESTARTCHECK notification for orchagent
Oct 10 06:43:36.862305 str-7260cx3-acs-2 NOTICE swss#orchagent: :- doTask: orchagent|NoFreeze:false|SkipPendingTaskCheck:false
Oct 10 06:43:36.862553 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck: WarmRestart check found pending tasks:
Oct 10 06:43:36.862553 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:100.1.1.115|SET|nexthop:192.168.100.115|ifname:unknown
Oct 10 06:43:36.862577 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:100.1.1.2|SET|nexthop:192.168.100.2|ifname:unknown
Oct 10 06:43:36.862599 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:100.1.1.3|SET|nexthop:192.168.100.3|ifname:unknown
Oct 10 06:43:36.862599 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:100.1.1.4|SET|nexthop:192.168.100.4|ifname:unknown
Oct 10 06:43:36.862636 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:100.1.1.5|SET|nexthop:192.168.100.5|ifname:unknown
Oct 10 06:43:36.862687 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:100.1.1.55|SET|nexthop:192.168.100.55|ifname:unknown
Oct 10 06:43:36.862687 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:200.1.1.115|SET|nexthop:192.168.200.115|ifname:unknown
Oct 10 06:43:36.862718 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:200.1.1.2|SET|nexthop:192.168.200.2|ifname:unknown
Oct 10 06:43:36.862718 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:200.1.1.3|SET|nexthop:192.168.200.3|ifname:unknown
Oct 10 06:43:36.862718 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:200.1.1.4|SET|nexthop:192.168.200.4|ifname:unknown
Oct 10 06:43:36.862737 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:200.1.1.5|SET|nexthop:192.168.200.5|ifname:unknown
Oct 10 06:43:36.862757 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck:     ROUTE_TABLE:200.1.1.55|SET|nexthop:192.168.200.55|ifname:unknown
Oct 10 06:43:36.862757 str-7260cx3-acs-2 NOTICE swss#orchagent: :- warmRestartCheck: Restart check result: NOT_READY

This PR add a cleanup for static route added in test setup.
Besides, a duplicate ip add for Vlan interface is removed.
https://github.com/Azure/sonic-mgmt/blob/457a6400e16bf018d16d0ca64e9a50a03f6ef911/tests/vlan/test_vlan.py#L94-L95
There is exactly same operation here
https://github.com/Azure/sonic-mgmt/blob/457a6400e16bf018d16d0ca64e9a50a03f6ef911/tests/vlan/test_vlan.py#L116-L118

Type of change

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

Approach

What is the motivation for this PR?

This PR is to fix warm-reboot issues caused by test_vlan. And some duplicated code is removed as well.

How did you do it?

  1. Add a cleanup for static route added in test setup
  2. Remove duplicate 'ip add' for Vlan interface

How did you verify/test it?

Verified on Arista-7260. After this update, the warm-reboot completed successfully after running test_vlan.

py.test --inventory ../ansible/str,../ansible/veos --host-pattern str-7260cx3-acs-2 --module-path ../ansible --testbed vms7-t0-7260-2 --testbed_file ../ansible/testbed.csv --junit-xml=tr.xml --log-cli-level warn --collect_techsupport=False --topology=t0,any,util vlan/test_vlan.py
========================================================================================= test session starts =========================================================================================
platform linux2 -- Python 2.7.12, pytest-4.6.5, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
metadata: {'Python': '2.7.12', 'Platform': 'Linux-4.10.0-42-generic-x86_64-with-Ubuntu-16.04-xenial', 'Packages': {'py': '1.9.0', 'pytest': '4.6.5', 'pluggy': '0.13.1'}, 'Plugins': {u'repeat': u'0.8.0', u'html': u'1.22.1', u'xdist': u'1.28.0', u'ansible': u'2.2.2', u'forked': u'1.3.0', u'metadata': u'1.10.0'}}
ansible: 2.8.12
rootdir: /data/Networking-acs-sonic-mgmt/tests, inifile: pytest.ini
plugins: ansible-2.2.2, forked-1.3.0, xdist-1.28.0, html-1.22.1, repeat-0.8.0, metadata-1.10.0
collected 3 items                                                                                                                                                                                     

vlan/test_vlan.py::test_vlan_tc1_send_untagged PASSED                                                                                                                                           [ 33%]
vlan/test_vlan.py::test_vlan_tc2_send_tagged PASSED                                                                                                                                             [ 66%]
vlan/test_vlan.py::test_vlan_tc3_send_invalid_vid PASSED                                                                                                                                        [100%]^@

------------------------------------------------------------------ generated xml file: /data/Networking-acs-sonic-mgmt/tests/tr.xml -------------------------------------------------------------------
===================================================================================== 3 passed in 464.46 seconds ======================================================================================

Any platform specific information?

No.

Supported testbed topology if it's a new test case?

No.

Documentation

No.

1. Add a cleanup for static route added in test setup
2. Remove duplicate 'ip add' for Vlan interface
@bingwang-ms bingwang-ms merged commit b9a95f7 into sonic-net:master Oct 12, 2020
praveen-li pushed a commit to praveen-li/sonic-mgmt that referenced this pull request Jul 29, 2021
1. Add a cleanup for static route added in test setup
2. Remove duplicate 'ip add' for Vlan interface
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
Include following commits:
```
839625d Replace cmp in acl_loader with operator.eq (sonic-net#2328)
af245ad [route_check]: Ignore standalone tunnel routes (sonic-net#2332)
c9aa65c Revert "[DHCPv6] [202012] Update the dhcpv6_relay config/show cli (sonic-net#2271)" (sonic-net#2336)
6b9cdc9 Made changes to only allow a valid IPv4 or Ipv6 string for dhcp cli (sonic-net#2296)
```
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…x-kernel] advance submodule head (sonic-net#12025)

linkmgrd:
* ab5b2c1 2022-09-02 | Fix mux config (sonic-net#128) (HEAD -> 202205, github/202205) [Longxiang Lyu]

utilities:
* 7de9305 2022-09-07 | [generate dump]Added error message when saisdkdump fails (sonic-net#2356) (HEAD -> 202205, github/202205) [Sudharsan Dhamal Gopalarathnam]
* c5b0a6d 2022-09-07 | [counterpoll]Fixing counterpoll show for tunnel and acl stats (sonic-net#2355) [Sudharsan Dhamal Gopalarathnam]
* 1452b44 2022-09-05 | [GCU] Fix missing backend in dry run (sonic-net#2347) [jingwenxie]
* bc7b845 2022-09-04 | Add Password Hardening CLI support (sonic-net#2338) [davidpil2002]
* 55e8948 2022-09-06 | [fast-reboot]Avoid stopping masked services during fast-reboot (sonic-net#2335) [Sudharsan Dhamal Gopalarathnam]
* f7d69d4 2022-08-30 | Replace cmp in acl_loader with operator.eq (sonic-net#2328) [Zhaohui Sun]
* 4054ebb 2022-09-05 | Add verification for override (sonic-net#2305) [jingwenxie]
* 729d811 2022-05-30 | Fix sonic-installer and 'show version' command crash when database docker not running issue. (sonic-net#2183) [Hua Liu]

platform-daemons:
* 36ba7c0 2022-09-07 | [ycable] cleanup logic for creating grpc future ready (sonic-net#289) (HEAD -> 202205) [vdahiya12]
* 2a9db73 2022-09-01 | [ycabled] fix insert events from xcvrd;cleanup some mux toggle logic (sonic-net#287) [vdahiya12]

platform-common:
* d7c990d 2022-09-03 | [CMIS] 'get_transceiver_info' should return 'None' when CMIS cable EEPROM is not ready  (sonic-net#305) (HEAD -> 202205) [Kebo Liu]

linux-kernel:
* 25ea052 2022-08-31 | [patch]: Add accpt_untracked_na kernel param (sonic-net#292) (HEAD -> 202205) [Lawrence Lee]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants