Skip to content

[portconfig] Validate duplicate speed value and interface type value#1745

Merged
qiluo-msft merged 2 commits intosonic-net:masterfrom
Junchao-Mellanox:validate-auto-neg
Sep 14, 2021
Merged

[portconfig] Validate duplicate speed value and interface type value#1745
qiluo-msft merged 2 commits intosonic-net:masterfrom
Junchao-Mellanox:validate-auto-neg

Conversation

@Junchao-Mellanox
Copy link
Copy Markdown
Collaborator

What I did

Validate input parameter for command config interface advertised-speeds and config interface advertised-types, make sure there is no duplicate speeds or types

How I did it

Split input speeds/types with "," and check if there is a duplication, if yes, print an error.

How to verify it

  1. new unit test case
  2. manual test

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)

admin@sonice:$ sudo config interface advertised-speeds Ethernet4 100000,25000,100000
Invalid speed specified: 100000,25000,100000
Please remove duplicate speed
admin@sonic:$ sudo config interface advertised-types Ethernet4 CR,CR4,CR4
Invalid interface type specified: CR,CR4,CR4
Please remove duplicate interface type

@Junchao-Mellanox
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 1745 in repo Azure/sonic-utilities

keboliu
keboliu previously approved these changes Aug 16, 2021
@liat-grozovik
Copy link
Copy Markdown
Collaborator

@keboliu can you please signoff?

@qiluo-msft qiluo-msft merged commit 47a9a0f into sonic-net:master Sep 14, 2021
@Junchao-Mellanox Junchao-Mellanox deleted the validate-auto-neg branch September 14, 2021 10:22
judyjoseph pushed a commit that referenced this pull request Sep 14, 2021
…1745)

#### What I did

Validate input parameter for command `config interface advertised-speeds` and `config interface advertised-types`, make sure there is no duplicate speeds or types

#### How I did it

Split input speeds/types with "," and check if there is a duplication, if yes, print an error.

#### How to verify it

1. new unit test case
2. manual 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.

5 participants