Skip to content

[Static DNS]fix static dns issue#11765

Merged
qiluo-msft merged 1 commit intosonic-net:masterfrom
nhe-NV:update_static_dns
Mar 8, 2024
Merged

[Static DNS]fix static dns issue#11765
qiluo-msft merged 1 commit intosonic-net:masterfrom
nhe-NV:update_static_dns

Conversation

@nhe-NV
Copy link
Contributor

@nhe-NV nhe-NV commented Feb 23, 2024

Need to check if the dhclient pid exist or not on the dut host.

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
  • 202205
  • 202305
  • 202311

Approach

What is the motivation for this PR?

How did you do it?

How did you verify/test it?

Any platform specific information?

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

Documentation

@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/dns/static_dns/test_static_dns.py:5:1: F401 'os' imported but unused

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

1. Need to check if the dhclient pid exist or not or the dut host.
2. Save the dhclient pid under the /run folder instead of the /tmp folder, When dhclient runs it drops the permissions to meet the required security level. With the dropped per in the Debian 12, it can’t create a PID file in a /tmp/ directory. Instead /run/ directory should be used.
@nhe-NV nhe-NV force-pushed the update_static_dns branch from 055cb7b to abbf97b Compare March 8, 2024 02:23
Copy link
Contributor

@ganglyu ganglyu left a comment

Choose a reason for hiding this comment

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

I have verified this PR.

@qiluo-msft qiluo-msft merged commit bbb06ce into sonic-net:master Mar 8, 2024
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Mar 22, 2024
Need to check if the dhclient pid exist or not on the dut host. 

## Type of change

- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] Test case(new/improvement)
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #12110

mssonicbld pushed a commit that referenced this pull request Mar 22, 2024
Need to check if the dhclient pid exist or not on the dut host. 

## Type of change

- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] Test case(new/improvement)
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.

5 participants