[AI Generated] BugFix: find sshd_config on SUSE/SLES 16 without scanning entire root fs#4487
[AI Generated] BugFix: find sshd_config on SUSE/SLES 16 without scanning entire root fs#4487LiliDeng wants to merge 4 commits into
Conversation
On SUSE SLES 16 the vendor sshd_config ships under /usr/etc/ssh/sshd_config, not /etc/ssh/sshd_config. The previous fallback ran 'find / -name sshd_config -print0', which on minimal arm64 images exits non-zero due to permission-denied warnings on /proc, /sys, /run/user/* etc., causing Find.find_files()'s assert_exit_code() to fail and aborting tests like perf_udp_iperf_sriov. Check well-known candidate paths first (/etc/ssh, /usr/etc/ssh, /usr/local/etc/ssh), then fall back to a scoped find restricted to /etc, /usr/etc, /usr/local/etc with ignore_not_exist=True.
There was a problem hiding this comment.
Pull request overview
This PR updates LISA’s Ssh tool to locate sshd_config on newer SUSE/SLES images without falling back to a full-root filesystem traversal that can fail on minimal images due to find / permission-denied exit codes.
Changes:
- Add well-known
sshd_configcandidate paths (including/usr/etc/ssh/sshd_config) before falling back to searching. - Scope the
findfallback to/etc,/usr/etc, and/usr/local/etc, and useignore_not_exist=Trueto avoid failing on missing roots.
| # Fall back to a scoped find. Restrict to /etc and /usr/etc to avoid | ||
| # traversing /proc, /sys, /run/user/* etc. on minimal images where | ||
| # `find /` exits non-zero due to permission-denied warnings. |
| candidate_paths = [ | ||
| f"/etc/ssh/{file_name}", | ||
| f"/usr/etc/ssh/{file_name}", | ||
| f"/usr/local/etc/ssh/{file_name}", | ||
| ] |
| if result and result[0]: | ||
| return result[0] | ||
| raise LisaException("not find sshd_config") |
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: suse sles-15-sp6 gen2 latest
Test case details
|
|
Fix validated. Live run on
|
⏭️ AI Test Selection — SKIPPED1 test case(s) selected (view run) Marketplace image: suse sles-15-sp6 gen2 latest Selected test cases |
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: suse sles-15-sp6 gen2 latest
Test case details
|
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: suse sles-15-sp6 gen2 latest
Test case details
|
Problem
On SUSE SLES 16 (and other modern SUSE images) the vendor
sshd_configships under/usr/etc/ssh/sshd_configrather than/etc/ssh/sshd_config.Ssh.get_default_sshd_config_path()falls back tofind / -name sshd_config -print0when the default path is missing. On minimal arm64 images thisfindexits with code1(permission-denied warnings on/proc,/sys,/run/user/*, transient PIDs, etc.), soFind.find_files()'sassert_exit_code()raises and aborts the test.Failing test
suse sles-16-0-arm64 gen2 2026.02.05NetworkPerformace.perf_udp_iperf_sriovCall path:
performance/common.py:697 ssh.set_max_session()->ssh.py get_default_sshd_config_path()->find /.Fix
/etc/ssh,/usr/etc/ssh,/usr/local/etc/ssh) before falling back tofind.findfallback to/etc,/usr/etc,/usr/local/etc(instead of/) and passignore_not_exist=Trueso missing roots don't fail.This avoids both the SUSE path mismatch and the brittle full-filesystem traversal.
Validation
Live
perf_udp_iperf_sriovrun onsuse sles-16-0-arm64 gen2 2026.02.05/Standard_D8ps_v5is in progress; will update once complete.Linked ADO bug to follow.