Skip to content

[acl] Make Config DB recovery more robust#2296

Merged
daall merged 2 commits intosonic-net:masterfrom
daall:acl_fixes
Sep 30, 2020
Merged

[acl] Make Config DB recovery more robust#2296
daall merged 2 commits intosonic-net:masterfrom
daall:acl_fixes

Conversation

@daall
Copy link
Contributor

@daall daall commented Sep 30, 2020

Signed-off-by: Danny Allen [email protected]

Description of PR

Summary: Make Config DB recovery more robust
Fixes #2292

Type of change

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

Approach

What is the motivation for this PR?

It is possible for loganalyzer to throw an exception during table removal and never reach the config save -y step in the finally block. This leaves the config_db.json in a bad state, which can cause strange issues for downstream tests if config reload or a reboot are issued.

How did you do it?

I took advantage of the newly added backup_and_restore fixture to restore the config_db.json rather than relying on the finally block to work every time.

How did you verify/test it?

Ran the test locally, verified that the config_db.json was the same before and after. Going to go back and validate this works for 201911 as well as master.

Any platform specific information?

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

Documentation

@daall daall requested a review from a team September 30, 2020 00:58
@daall daall marked this pull request as ready for review September 30, 2020 04:09


@pytest.fixture
def backup_and_restore_config_db(duthost):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bingwang-ms can you help me verify that this works OK for the advanced_reboot tests? It seemed fine to me but I think a second set of eyes would be helpful. :)

@daall
Copy link
Contributor Author

daall commented Sep 30, 2020

retest vsimage please

@daall daall merged commit 7e357f7 into sonic-net:master Sep 30, 2020
@daall daall deleted the acl_fixes branch September 30, 2020 17:12
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)
```
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.

[acl] ACL test teardown failures leave config_db.json in a bad state

2 participants