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 when test failed #5197

Merged
merged 8 commits into from
Feb 24, 2022
Merged

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

Approach

What is the motivation for this PR?

Collect DB dump when test failed

How did you do it?

Add a common fixture collect_db_dump set as autouse. When test failed, all of the DBs will be dumped, collected and sent to the test server

How did you verify/test it?

Failed a test and check the collection

Any platform specific information?

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

Documentation

xwjiang2021 and others added 7 commits February 18, 2022 09:11
What is the motivation for this PR?
Need new test: Inject route flapping and instability

How did you do it?
1.choose one route, and ping it continiously
2.withdraw announce some other routes at the same time, to see whether
the route stable or not
3. add the completeness level to set loop time

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?
What is the motivation for this PR?
Need new test: Inject route flapping and instability

How did you do it?
1.choose one route, and ping it continiously
2.withdraw announce some other routes at the same time, to see whether
the route stable or not
3. add the completeness level to set loop time

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?
This reverts commit 70e753e.

Do not sync code from branches
This reverts commit 61e7cd5.

Do not sync code from branches
What is the motivation for this PR?
Collect DB dump when test failed

How did you do it?
Add a common fixture collect_db_dump set as autouse. When test failed,
all of the DBs will be dumped, collected and sent to the test server

How did you verify/test it?
Failed a test and check the collection

Any platform specific information?
Supported testbed topology if it's a new test case?
1. fetch to tests/logs/
2. rm whole log document
@xwjiang-ms xwjiang-ms requested a review from a team as a code owner February 22, 2022 15:49
# Collect DB dump
duthosts.file(path=db_dump_path, state="directory")
for i in dbs:
duthosts.shell("redis-dump -d {} -y -o {}/{}".format(i, db_dump_path, i))
Copy link
Collaborator

Choose a reason for hiding this comment

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

On duthost, it would be better to generate the dump files to "/tmp".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK,I will change the path

When test failed, teardown of this fixture will dump all the DB and collect to the test servers
'''
yield
collect_db_dump_on_duts(request, duthosts)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Usually we add a new line at the end of a file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

1. dut file path: /tmp/db_dump
2. clean .tar.gz in dut
@xwjiang-ms xwjiang-ms merged commit cae6b53 into sonic-net:master Feb 24, 2022
@smaheshm
Copy link
Contributor

this is erroring out in multi-ASIC platform. created #5251

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.

3 participants