Skip to content

[dhcp_server_test] fix test failure due to lease was not updated to state db#14120

Merged
wangxin merged 8 commits intosonic-net:masterfrom
w1nda:release_after_test
Aug 19, 2024
Merged

[dhcp_server_test] fix test failure due to lease was not updated to state db#14120
wangxin merged 8 commits intosonic-net:masterfrom
w1nda:release_after_test

Conversation

@w1nda
Copy link
Copy Markdown
Member

@w1nda w1nda commented Aug 14, 2024

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

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

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

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.
image

Any platform specific information?

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

Documentation

@w1nda w1nda requested a review from yaqiangz August 14, 2024 08:45
@w1nda
Copy link
Copy Markdown
Member Author

w1nda commented Aug 16, 2024

Hi @wangxin, cloud you help merge this PR?

@wangxin wangxin merged commit 9aa806e into sonic-net:master Aug 19, 2024
@w1nda
Copy link
Copy Markdown
Member Author

w1nda commented Aug 19, 2024

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.
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202405: #14157

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.
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202311: #14167

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.
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.

6 participants