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

Add gnmi client cname authorize test case #13133

Merged
merged 11 commits into from
Sep 10, 2024

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Jun 5, 2024

Add gnmi client cname authorize test case

Why I did it

GNMI add client cert cname validation feature, to protect this feature, add this test case.

Work item tracking
  • Microsoft ADO: 25226269

How I did it

Create cert with cname and validate GNMI service can accept/reject cert with cert cname config.

How to verify it

Pass all test case.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Add gnmi client cname authorize test case.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@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.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/gnmi/helper.py

fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/gnmi/test_gnmi.py

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
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

@liuh-80 liuh-80 changed the title []POC Add gnmi client cname authorize test case [POC] Add gnmi client cname authorize test case Jun 5, 2024
@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.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/gnmi/helper.py

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/gnmi/helper.py:58:121: E501 line too long (131 > 120 characters)
tests/gnmi/test_gnmi.py:13:1: E302 expected 2 blank lines, found 1
tests/gnmi/test_gnmi.py:39:121: E501 line too long (127 > 120 characters)

flake8...............................................(no files to check)Skipped
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

@liuh-80 liuh-80 changed the title [POC] Add gnmi client cname authorize test case Add gnmi client cname authorize test case Aug 23, 2024
@liuh-80 liuh-80 marked this pull request as ready for review September 6, 2024 05:00
@liuh-80 liuh-80 requested a review from ganglyu September 6, 2024 05:00
@qiluo-msft qiluo-msft merged commit b7462fc into sonic-net:master Sep 10, 2024
16 checks passed
hdwhdw pushed a commit to hdwhdw/sonic-mgmt that referenced this pull request Sep 20, 2024
Add gnmi client cname authorize test case 

#### Why I did it
GNMI add client cert cname validation feature, to protect this feature, add this test case.

### How I did it
Create cert with cname and validate GNMI service can accept/reject cert with cert cname config.

#### How to verify it
Pass all test case.

### Description for the changelog
Add gnmi client cname authorize test case.
arista-hpandya pushed a commit to arista-hpandya/sonic-mgmt that referenced this pull request Oct 2, 2024
Add gnmi client cname authorize test case 

#### Why I did it
GNMI add client cert cname validation feature, to protect this feature, add this test case.

### How I did it
Create cert with cname and validate GNMI service can accept/reject cert with cert cname config.

#### How to verify it
Pass all test case.

### Description for the changelog
Add gnmi client cname authorize test case.
vikshaw-Nokia pushed a commit to vikshaw-Nokia/sonic-mgmt that referenced this pull request Oct 23, 2024
Add gnmi client cname authorize test case 

#### Why I did it
GNMI add client cert cname validation feature, to protect this feature, add this test case.

### How I did it
Create cert with cname and validate GNMI service can accept/reject cert with cert cname config.

#### How to verify it
Pass all test case.

### Description for the changelog
Add gnmi client cname authorize test case.
@liuh-80
Copy link
Contributor Author

liuh-80 commented Nov 15, 2024

the build image PR cherry-picked to 202311 and 202405, will add cherry-pick label later after new image ready.

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Nov 21, 2024
Add gnmi client cname authorize test case 

#### Why I did it
GNMI add client cert cname validation feature, to protect this feature, add this test case.

### How I did it
Create cert with cname and validate GNMI service can accept/reject cert with cert cname config.

#### How to verify it
Pass all test case.

### Description for the changelog
Add gnmi client cname authorize test case.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #15677

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Nov 21, 2024
Add gnmi client cname authorize test case 

#### Why I did it
GNMI add client cert cname validation feature, to protect this feature, add this test case.

### How I did it
Create cert with cname and validate GNMI service can accept/reject cert with cert cname config.

#### How to verify it
Pass all test case.

### Description for the changelog
Add gnmi client cname authorize test case.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #15678

mssonicbld pushed a commit that referenced this pull request Nov 21, 2024
Add gnmi client cname authorize test case 

#### Why I did it
GNMI add client cert cname validation feature, to protect this feature, add this test case.

### How I did it
Create cert with cname and validate GNMI service can accept/reject cert with cert cname config.

#### How to verify it
Pass all test case.

### Description for the changelog
Add gnmi client cname authorize test case.
mssonicbld pushed a commit that referenced this pull request Nov 21, 2024
Add gnmi client cname authorize test case 

#### Why I did it
GNMI add client cert cname validation feature, to protect this feature, add this test case.

### How I did it
Create cert with cname and validate GNMI service can accept/reject cert with cert cname config.

#### How to verify it
Pass all test case.

### Description for the changelog
Add gnmi client cname authorize test case.
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