Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect db dump from each asic on multi-asic DUT #5326

Merged
merged 4 commits into from
Mar 17, 2022

Conversation

xwjiang-ms
Copy link
Contributor

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012

Approach

What is the motivation for this PR?

Db dump use 'redis-dump' to dump files, but on multi-asic DUT, output
filename matches with the directory name within the same folder.

How did you do it?

Use "ip netns exec 'namespace' redis-dump" to collect dumps from each
asic on multi-asic DUT.

How did you verify/test it?

Run test in some loops

Any platform specific information?

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

Documentation

What is the motivation for this PR?
Db dump use 'redis-dump' to dump files, but on multi-asic DUT, output
filename matches with the directory name within the same folder

How did you do it?
Use "ip netns exec 'namespace' redis-dump" to collect dumps from each
asic on multi-asic DUT.

How did you verify/test it?
Run test in some loops

Any platform specific information?
Supported testbed topology if it's a new test case?
@xwjiang-ms xwjiang-ms requested a review from a team as a code owner March 15, 2022 00:25
@wangxin wangxin changed the title Collect db dump fromeach asic on multi-asic DUT Collect db dump from each asic on multi-asic DUT Mar 16, 2022
1.Improve some code habits
2.Skip state db dump on 201911 release
@xwjiang-ms xwjiang-ms requested a review from wangxin March 17, 2022 09:01
@xwjiang-ms
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xwjiang-ms xwjiang-ms merged commit 4cfc716 into sonic-net:master Mar 17, 2022
# The issue has been fixed in https://github.com/Azure/sonic-buildimage/pull/5646.
# However, the fix is not included in 201911 release. So we have to skip STATE_DB on release 201911
# to avoid raising exception when dumping the STATE_DB.
if i == state_db_id and duthosts[0].sonic_release in ['201911']:
Copy link
Contributor

Choose a reason for hiding this comment

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

@xwjiang2021 This line is giving a error as 'i' as undefined. Should this be db_id instead of i

db_dump_path = os.path.join(dut_file_path + "/" + namespace, request.module.__name__, request.node.name)
duthosts.file(path=db_dump_path, state="directory")
for i in dbs:
duthosts.shell("ip netns exec {} redis-ducmp -d {} -y -o {}/{}".format(namespace, i, db_dump_path, i))
Copy link
Contributor

Choose a reason for hiding this comment

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

@xwjiang2021the command should be 'redis-dump' and not 'redis-ducmp'

@wangxin
Copy link
Collaborator

wangxin commented Mar 18, 2022

Thanks @mannytaheri for noticing the issues. I'll revert this one and ask the author to submit a new one.

wangxin added a commit that referenced this pull request Mar 18, 2022
wangxin pushed a commit that referenced this pull request Mar 18, 2022
* Collect db dump fromeach asic on multi-asic DUT

What is the motivation for this PR?
Db dump use 'redis-dump' to dump files, but on multi-asic DUT, output
filename matches with the directory name within the same folder

How did you do it?
Use "ip netns exec 'namespace' redis-dump" to collect dumps from each
asic on multi-asic DUT.

How did you verify/test it?
Run test in some loops

Any platform specific information?
Supported testbed topology if it's a new test case?

* Improve of Collect db dump from each asic on multi-asic DUT
1.Improve some code habits
2.Skip state db dump on 201911 release

* Improve: Skip state db dump on 201911 release when add db_id to db set

* Improve: Add some comments
@xwjiang-ms xwjiang-ms deleted the db_dump_multi_asic branch September 7, 2022 01:36
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.

4 participants