[dhcp_server_test] fix test failure due to lease was not updated to state db#14120
Merged
wangxin merged 8 commits intosonic-net:masterfrom Aug 19, 2024
Merged
[dhcp_server_test] fix test failure due to lease was not updated to state db#14120wangxin merged 8 commits intosonic-net:masterfrom
wangxin merged 8 commits intosonic-net:masterfrom
Conversation
yaqiangz
approved these changes
Aug 16, 2024
Member
Author
|
Hi @wangxin, cloud you help merge this PR? |
wangxin
approved these changes
Aug 19, 2024
Member
Author
|
Hi @yxieca and @bingwang-ms, cloud you help approve the backporting to 202405 and 202311? |
mssonicbld
pushed a commit
to mssonicbld/sonic-mgmt
that referenced
this pull request
Aug 19, 2024
…tate db (sonic-net#14120) When running nightly test, sometimes, there are test cases failed on verify lease in state db. After investigation, I found that it's because when ip assigned was expired it will be appended to the last line in lease file and dhcpservd will choice that line. When two tests randomly select the same port, and the previous test didn't release the ip, the next test may fail, because dhcpservd will only pick the last record of that mac in lease file. To fix that, we need to release ip assigned after test. What is the motivation for this PR? When running nightly test, sometimes, there are test cases failed on verify lease in state db. How did you do it? Release ip assigned after test. How did you verify/test it? Run tests on testbed and monitor lease file to make sure every lease was released after the test.
Collaborator
|
Cherry-pick PR to 202405: #14157 |
8 tasks
mssonicbld
pushed a commit
to mssonicbld/sonic-mgmt
that referenced
this pull request
Aug 19, 2024
…tate db (sonic-net#14120) When running nightly test, sometimes, there are test cases failed on verify lease in state db. After investigation, I found that it's because when ip assigned was expired it will be appended to the last line in lease file and dhcpservd will choice that line. When two tests randomly select the same port, and the previous test didn't release the ip, the next test may fail, because dhcpservd will only pick the last record of that mac in lease file. To fix that, we need to release ip assigned after test. What is the motivation for this PR? When running nightly test, sometimes, there are test cases failed on verify lease in state db. How did you do it? Release ip assigned after test. How did you verify/test it? Run tests on testbed and monitor lease file to make sure every lease was released after the test.
Collaborator
|
Cherry-pick PR to 202311: #14167 |
8 tasks
mssonicbld
pushed a commit
that referenced
this pull request
Aug 19, 2024
…tate db (#14120) When running nightly test, sometimes, there are test cases failed on verify lease in state db. After investigation, I found that it's because when ip assigned was expired it will be appended to the last line in lease file and dhcpservd will choice that line. When two tests randomly select the same port, and the previous test didn't release the ip, the next test may fail, because dhcpservd will only pick the last record of that mac in lease file. To fix that, we need to release ip assigned after test. What is the motivation for this PR? When running nightly test, sometimes, there are test cases failed on verify lease in state db. How did you do it? Release ip assigned after test. How did you verify/test it? Run tests on testbed and monitor lease file to make sure every lease was released after the test.
mssonicbld
pushed a commit
that referenced
this pull request
Aug 20, 2024
…tate db (#14120) When running nightly test, sometimes, there are test cases failed on verify lease in state db. After investigation, I found that it's because when ip assigned was expired it will be appended to the last line in lease file and dhcpservd will choice that line. When two tests randomly select the same port, and the previous test didn't release the ip, the next test may fail, because dhcpservd will only pick the last record of that mac in lease file. To fix that, we need to release ip assigned after test. What is the motivation for this PR? When running nightly test, sometimes, there are test cases failed on verify lease in state db. How did you do it? Release ip assigned after test. How did you verify/test it? Run tests on testbed and monitor lease file to make sure every lease was released after the test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
Fixes # (issue)
When running nightly test, sometimes, there are test cases failed on verify lease in state db.
After investigation, I found that it's because when ip assigned was expired it will be appended to the last line in lease file
and dhcpservd will choice that line. When two tests randomly select the same port, and the previous test didn't release the ip, the next test may fail, because dhcpservd will only pick the last record of that mac in lease file.
To fix that, we need to release ip assigned after test.
Type of change
Back port request
Approach
What is the motivation for this PR?
When running nightly test, sometimes, there are test cases failed on verify lease in state db.
How did you do it?
Release ip assigned after test.
How did you verify/test it?
Run tests on testbed and monitor lease file to make sure every lease was released after the test.

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