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

Validate interface name length #23

Closed
wants to merge 14 commits into from

Conversation

arfeigin
Copy link
Owner

@arfeigin arfeigin commented Mar 18, 2024

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)

@arfeigin arfeigin changed the title Validate iface name length in cli Validate interface name length Mar 27, 2024
config/main.py Show resolved Hide resolved
config/main.py Show resolved Hide resolved
config/main.py Outdated Show resolved Hide resolved
config/main.py Outdated Show resolved Hide resolved
config/vxlan.py Show resolved Hide resolved
tests/subintf_test.py Show resolved Hide resolved
tests/subintf_test.py Show resolved Hide resolved
tests/vrf_test.py Show resolved Hide resolved
config/main.py Outdated Show resolved Hide resolved
arfeigin and others added 11 commits April 2, 2024 16:34
…atchdog arm before the reboot (sonic-net#3203)

Signed-off-by: vadymhlushko-mlnx <[email protected]>
Basically port2alias Cli became broken on multi-asic platforms after introduction of sonic-net/sonic-buildimage#10960 which removed the initialization of global DB config from portconfig.py (library side) and expects application to do it, but here application side (port2alias) was not updated accordingly.

How I did it
Add load_db_config call to port2alias for initialization
### What I did
Enhanced route_check.py script to cover multi-asic platforms.
Accordingly enhanced the test files as well.

MSFT ADO: 25416673

#### How I did it
Enhanced the route_check.py script to take additional optional parameter(--n/namespace). Without this parameter, the check will be run on all asics in multi-asic platforms.
Different connections to DBs are modified accordingly to connect to relevant ns dbs.
Result will be encapsulated under different namespace. For single asic, results will be displayed under Default-Namespace("").

testData and the testfiles are enhanced accordinly.

#### How to verify it
1. Verified that all pytest UT cases are passing.
2. Verified the route_check_test.sh script on single asic and multi-asic platforms.
3. Verified Monit routecheck outputs by simulating a failure scenario on both single asic and multi-asic platforms.


output from Monit Check:
**Single Asic:**
xxx/usr/local/bin# monit status routecheck
Monit 5.20.0 uptime: 1d 20h 32m

Program 'routeCheck'
  status                       Status failed
  monitoring status            Monitored
  monitoring mode              active
  on reboot                    start
  last exit value              255
  last output                  Failure results: {{
                                   "": {
                                       "missed_ROUTE_TABLE_routes": [
                                           "20c0:d9b8:99:80::/64"
                                       ]
                                   }
                               }}
                               Failed. Look at reported mismatches above
                               add: {
                                   "": []
                               }
                               del: {
                                   "": []
                               }
  data collected               Tue, 12 Dec 2023 20:30:11

'''
**Multi Asic:**
'''
/bin# monit status routecheck
Monit 5.20.0 uptime: 1d 23h 51m

Program 'routeCheck'
  status                       Status failed
  monitoring status            Monitored
  monitoring mode              active
  on reboot                    start
  last exit value              255
  last output                  Failure results: {{
                                   "asic0": {
                                       "missed_ROUTE_TABLE_routes": [
                                           "1.0.0.0/16"
                                       ]
                                   },
                                   "asic1": {
                                       "missed_ROUTE_TABLE_routes": [
                                           "1.0.0.0/16"
                                       ]
                                   },
                                   "asic2": {
                                       "missed_ROUTE_TABLE_routes": [
                                           "1.0.0.0/16"
                                       ]
                                   }
                               }}
                               Failed. Look at reported mismatches above
                               add: {
                                   "asic0": [],
                                   "asic1": [],
                                   "asic2": []
                               }
                               del: {
                                   "asic0": [],
                                   "asic1": [],
                                   "asic2": []
                               }
  data collected               Tue, 12 Dec 2023 23:54:23
'''
…ature (sonic-net#2932)

* Add "state" field in CONFIG_DB fabric_monitor table as a toggle of the
fabric port monitoring feature. The command to set this is "config
fabric port monitor state <enable/disable>"
---------
Signed-off-by: Jie Feng <[email protected]>
)

What I did
Fix sonic-net/sonic-buildimage#17200

Microsoft ADO (number only): 27317600
Upon advanced-reboot, the Lua script is flushed, so the EVALSHA command
might suffer from the script not-existed issue. Let's check if the
script exists before calling EVALSHA.

Signed-off-by: Longxiang Lyu [email protected]

How I did it
As the above.

How to verify it
UT and verify on dualtor testbed.

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)
@arfeigin
Copy link
Owner Author

arfeigin commented Apr 2, 2024

Hi @nazariig please review the latest changes, some commits to the repo caused conflicts with the code so they are included although not relevant.

@arfeigin arfeigin changed the base branch from master to master_2 April 3, 2024 14:32
@arfeigin arfeigin changed the base branch from master_2 to master April 3, 2024 14:36
@arfeigin arfeigin changed the base branch from master to 201709 April 3, 2024 14:46
@arfeigin arfeigin changed the base branch from 201709 to master April 3, 2024 14:46
@arfeigin arfeigin closed this Apr 3, 2024
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.