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

Added cisco config platform commands #2242

Merged
merged 47 commits into from
Sep 29, 2022

Conversation

yucgu
Copy link
Contributor

@yucgu yucgu commented Jun 30, 2022

Signed-off-by: Yucai Gu yucgu@cisco.com

What I did

Add cisco sub-command option under 'config platform' command

How I did it

In config/main.py, check the platform type and import the cisco.py file under cisco platform code when it's cisco-8000.

How to verify it

Run config platform -h to see all commands. We will be able to see config platform cisco. This is only available on cisco devices.

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

Signed-off-by: Yucai Gu <yucgu@cisco.com>
kevinskwang
kevinskwang previously approved these changes Jun 30, 2022
@kevinskwang
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 4, 2022

yucgu and others added 19 commits August 3, 2022 17:55
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
@lgtm-com
Copy link

lgtm-com bot commented Aug 10, 2022

This pull request introduces 1 alert when merging 9a8d9e3 into 14c483f - view on LGTM.com

new alerts:

  • 1 for Unreachable code

yucgu added 18 commits August 16, 2022 14:45
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
Signed-off-by: Yucai Gu <yucgu@cisco.com>
@yxieca
Copy link
Contributor

yxieca commented Sep 28, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yxieca
Copy link
Contributor

yxieca commented Sep 28, 2022

@yucgu can you add a unit test to cover this simple change?

@yucgu
Copy link
Contributor Author

yucgu commented Sep 28, 2022

@yucgu can you add a unit test to cover this simple change?
Hi Ying,
thanks for looking at it. I tried various changes, includes adding the test cases or calling the function directly, but still not able to make the UT coverage pass.
Probably the UT infra doesn't support this kind of coverage by now, there are two reasons:
1) the parent function where I added those 3 lines of new codes is a main entry point of a command chain, it's not called/covered, I checked other main entry points of other command chains, all are not called/covered, looks like the UT infra doesn't support that coverage.
2) even there is some way to make it called, and we use mock to make asic_type as cisco-8000, the code will still not be tested because the cisco.py is in the platform code repo, the UT of sonic-utilities doesn't have that file.

@yxieca yxieca merged commit 7419c67 into sonic-net:master Sep 29, 2022
yucgu added a commit to yucgu/sonic-utilities that referenced this pull request Sep 30, 2022
What I did
Add cisco sub-command option under 'config platform' command

How I did it
In config/main.py, check the platform type and import the cisco.py file under cisco platform code when it's cisco-8000.

How to verify it
Run config platform -h to see all commands. We will be able to see config platform cisco. This is only available on cisco devices.

Signed-off-by: Yucai Gu yucgu@cisco.com
yxieca pushed a commit that referenced this pull request Oct 3, 2022
What I did
Add cisco sub-command option under 'config platform' command

How I did it
In config/main.py, check the platform type and import the cisco.py file under cisco platform code when it's cisco-8000.

How to verify it
Run config platform -h to see all commands. We will be able to see config platform cisco. This is only available on cisco devices.

Signed-off-by: Yucai Gu yucgu@cisco.com

Signed-off-by: Yucai Gu yucgu@cisco.com
EdenGri pushed a commit to EdenGri/sonic-utilities that referenced this pull request Oct 12, 2022
What I did
Add cisco sub-command option under 'config platform' command

How I did it
In config/main.py, check the platform type and import the cisco.py file under cisco platform code when it's cisco-8000.

How to verify it
Run config platform -h to see all commands. We will be able to see config platform cisco. This is only available on cisco devices.

Signed-off-by: Yucai Gu yucgu@cisco.com
mdanish-kh pushed a commit to hamnarauf/sonic-utilities that referenced this pull request Oct 22, 2022
What I did
Add cisco sub-command option under 'config platform' command

How I did it
In config/main.py, check the platform type and import the cisco.py file under cisco platform code when it's cisco-8000.

How to verify it
Run config platform -h to see all commands. We will be able to see config platform cisco. This is only available on cisco devices.

Signed-off-by: Yucai Gu yucgu@cisco.com
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Nov 21, 2022
What I did
Add cisco sub-command option under 'config platform' command

How I did it
In config/main.py, check the platform type and import the cisco.py file under cisco platform code when it's cisco-8000.

How to verify it
Run config platform -h to see all commands. We will be able to see config platform cisco. This is only available on cisco devices.

Signed-off-by: Yucai Gu yucgu@cisco.com
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