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

[Bug]: [202405][multi-asic] test_passw_hardening.py fails with: libyang[0]: Missing required element \"lanes\" in \"PORT_LIST\" #14583

Closed
arista-nwolfe opened this issue Sep 13, 2024 · 3 comments
Assignees
Labels

Comments

@arista-nwolfe
Copy link
Contributor

Issue Description

When running test_passw_hardening.py on a multi-asic system it will try to run sudo config passw-hardening policies expiration 100 in the global netns which fails with the following lines:

> sudo config passw-hardening policies expiration 100
libyang[0]: Missing required element "lanes" in "PORT_LIST". (path: /sonic-port:sonic-port/PORT/PORT_LIST[name='Ethernet1/1'])
sonic_yang(3):Data Loading Failed:Missing required element "lanes" in "PORT_LIST".
Data Loading Failed
Missing required element "lanes" in "PORT_LIST".
Error: Failed to validate configuration: ConfigMgmt Class creation failed
Aborted!

Here is where that error is emitted:
https://github.com/sonic-net/sonic-utilities/blob/2cb8cc65b6dc57d9613ce271a681743aa4fa0f3c/config/plugins/sonic-passwh_yang.py#L35

I think the problem is it's expecting ports in that namespace but because all the ports are in the per-asic namespace there won't be any in the global namespace.

If I run this same command in the asic namespace it passes:

> sonic-netns-exec asic0 sudo config passw-hardening policies expiration 100

And I can see it update the config_db in the asic namespace:

> sonic-db-cli -n asic0 CONFIG_DB hgetall "PASSW_HARDENING|POLICIES"
{'digits_class': 'true', 'expiration': '100', 'expiration_warning': '15', 'history_cnt': '10', 'len_min': '8', 'lower_class': 'true', 'reject_user_passw_match': 'true', 'special_class': 'true', 'state': 'disabled', 'upper_class': 'true'}

Results you see

Listed above

Results you expected to see

The question I'm unsure of is if we can just change this test to run all the commands in the asic namespace or the yang model needs to be fixed to allow this command to run in the global namespace.

Is it platform specific

generic

Relevant log output

No response

Output of show version

No response

Attach files (if any)

No response

@arista-nwolfe
Copy link
Contributor Author

@arlakshm is this the same yang model issue you saw with passw_hardening?

@arista-nwolfe
Copy link
Contributor Author

arista-nwolfe commented Sep 23, 2024

sonic-net/sonic-buildimage#19968 is intended to fix this, I'll patch and confirm.

@abdosi
Copy link
Contributor

abdosi commented Oct 23, 2024

fixed

@abdosi abdosi closed this as completed Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

4 participants