sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

Validate interface name length in CLI

Open stepanblyschak opened this issue 1 year ago • 2 comments

This PR is accompanied by https://github.com/sonic-net/sonic-swss-common/pull/931 and https://github.com/sonic-net/sonic-buildimage/pull/20108

What I did

Validate interface name length does not exceed the limitation of IFNAMSIZ to align to kernel restrictions.

How I did it

Add validation checks in the relevant config functions for the following interface types:

vxlan vlan vrf loopback subinterface portchannel

How to verify it

UT tests added

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)

stepanblyschak avatar Oct 21 '24 10:10 stepanblyschak

/azp run Azure.sonic-utilities

qiluo-msft avatar Oct 26 '24 01:10 qiluo-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Oct 26 '24 01:10 azure-pipelines[bot]

/azpw run

stepanblyschak avatar Nov 10 '24 09:11 stepanblyschak

/AzurePipelines run

mssonicbld avatar Nov 10 '24 09:11 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 10 '24 09:11 azure-pipelines[bot]

/azpw run

stepanblyschak avatar Nov 14 '24 14:11 stepanblyschak

/AzurePipelines run

mssonicbld avatar Nov 14 '24 14:11 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 14 '24 14:11 azure-pipelines[bot]

/azpw run

stepanblyschak avatar Nov 16 '24 10:11 stepanblyschak

/AzurePipelines run

mssonicbld avatar Nov 16 '24 10:11 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 16 '24 10:11 azure-pipelines[bot]

Some git failure:

fatal: couldn't find remote ref refs/pull/3580/merge
##[warning]Git fetch failed with exit code 128, back off 2.513 seconds before retry.
git --config-env=http.extraheader=env_var_http.extraheader fetch --force --tags --prune --prune-tags --progress --no-recurse-submodules origin   +refs/heads/*:refs/remotes/origin/* +refs/pull/3580/merge:refs/remotes/pull/3580/merge
fatal: couldn't find remote ref refs/pull/3580/merge
##[warning]Git fetch failed with exit code 128, back off 5.95 seconds before retry.
git --config-env=http.extraheader=env_var_http.extraheader fetch --force --tags --prune --prune-tags --progress --no-recurse-submodules origin   +refs/heads/*:refs/remotes/origin/* +refs/pull/3580/merge:refs/remotes/pull/3580/merge
fatal: couldn't find remote ref refs/pull/3580/merge
##[error]Git fetch failed with exit code: 128

Will restart

stepanblyschak avatar Nov 19 '24 08:11 stepanblyschak

/azpw run

stepanblyschak avatar Nov 19 '24 08:11 stepanblyschak

/AzurePipelines run

mssonicbld avatar Nov 19 '24 08:11 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 19 '24 08:11 azure-pipelines[bot]

/azp run

wangxin avatar Nov 26 '24 08:11 wangxin

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 26 '24 08:11 azure-pipelines[bot]

@qiluo-msft @wangxin Could you please help with static analysis? Static analysis fails but I do not see a problem:

config/main.py:7937:21: E128 continuation line under-indented for visual indent

But line 7937 is not even in the diff.

And here I do not see any tabs on those lines in my diff:

tests/vxlan_test.py:374:1: E101 indentation contains mixed spaces and tabs
tests/vxlan_test.py:375:1: E101 indentation contains mixed spaces and tabs
tests/vxlan_test.py:376:1: E101 indentation contains mixed spaces and tabs
tests/vxlan_test.py:378:1: E101 indentation contains mixed spaces and tabs
tests/vxlan_test.py:379:1: E101 indentation contains mixed spaces and tabs
tests/vxlan_test.py:380:1: E101 indentation contains mixed spaces and tabs
tests/vxlan_test.py:384:1: E101 indentation contains mixed spaces and tabs
tests/vxlan_test.py:385:1: E101 indentation contains mixed spaces and tabs

image

stepanblyschak avatar Nov 26 '24 16:11 stepanblyschak