Skip to content

[AI Generated] BugFix: find sshd_config on SUSE/SLES 16 without scanning entire root fs#4487

Open
LiliDeng wants to merge 4 commits into
mainfrom
bugfix/sshd-config-find-sles16_160526
Open

[AI Generated] BugFix: find sshd_config on SUSE/SLES 16 without scanning entire root fs#4487
LiliDeng wants to merge 4 commits into
mainfrom
bugfix/sshd-config-find-sles16_160526

Conversation

@LiliDeng
Copy link
Copy Markdown
Collaborator

Problem

On SUSE SLES 16 (and other modern SUSE images) the vendor sshd_config ships under /usr/etc/ssh/sshd_config rather than /etc/ssh/sshd_config. Ssh.get_default_sshd_config_path() falls back to find / -name sshd_config -print0 when the default path is missing. On minimal arm64 images this find exits with code 1 (permission-denied warnings on /proc, /sys, /run/user/*, transient PIDs, etc.), so Find.find_files()'s assert_exit_code() raises and aborts the test.

Failing test

  • Image: suse sles-16-0-arm64 gen2 2026.02.05
  • Test: NetworkPerformace.perf_udp_iperf_sriov
  • Error:
    AssertionError: [Get unexpected exit code on cmd 3377 ['sudo', 'sh', '-c', `find / \( -name 'sshd_config' \) -print0`]]
      Expected <[0]> to contain item <1>, but did not.
    

Call path: performance/common.py:697 ssh.set_max_session() -> ssh.py get_default_sshd_config_path() -> find /.

Fix

  1. Check well-known candidate paths first (/etc/ssh, /usr/etc/ssh, /usr/local/etc/ssh) before falling back to find.
  2. Restrict the find fallback to /etc, /usr/etc, /usr/local/etc (instead of /) and pass ignore_not_exist=True so missing roots don't fail.

This avoids both the SUSE path mismatch and the brittle full-filesystem traversal.

Validation

Live perf_udp_iperf_sriov run on suse sles-16-0-arm64 gen2 2026.02.05 / Standard_D8ps_v5 is in progress; will update once complete.

Linked ADO bug to follow.

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.
Copilot AI review requested due to automatic review settings May 16, 2026 15:47
@LiliDeng LiliDeng requested a review from johnsongeorge-w as a code owner May 16, 2026 15:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_config candidate paths (including /usr/etc/ssh/sshd_config) before falling back to searching.
  • Scope the find fallback to /etc, /usr/etc, and /usr/local/etc, and use ignore_not_exist=True to avoid failing on missing roots.

Comment thread lisa/tools/ssh.py Outdated
Comment on lines +64 to +66
# 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.
Comment thread lisa/tools/ssh.py
Comment on lines +56 to +60
candidate_paths = [
f"/etc/ssh/{file_name}",
f"/usr/etc/ssh/{file_name}",
f"/usr/local/etc/ssh/{file_name}",
]
Comment thread lisa/tools/ssh.py Outdated
Comment on lines +75 to +77
if result and result[0]:
return result[0]
raise LisaException("not find sshd_config")
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: suse sles-15-sp6 gen2 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
verify_client_active_interval (lisa_0_0) ✅ PASSED 10.600

@LiliDeng
Copy link
Copy Markdown
Collaborator Author

LiliDeng commented May 16, 2026

Fix validated.

Live run on suse sles-16-0-arm64 gen2 2026.02.05 / Standard_D8ps_v5 with commit 1964ba3f6 -> PASSED in 1206.5s.

set_max_session() now resolves /usr/etc/ssh/sshd_config directly without falling back to find /.

Copilot AI review requested due to automatic review settings May 17, 2026 12:32
@github-actions
Copy link
Copy Markdown

⏭️ AI Test Selection — SKIPPED

1 test case(s) selected (view run)

Marketplace image: suse sles-15-sp6 gen2 latest

Selected test cases
verify_client_active_interval

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread lisa/tools/ssh.py
Comment thread lisa/tools/ssh.py
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: suse sles-15-sp6 gen2 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
verify_client_active_interval (lisa_0_0) ✅ PASSED 6.778

@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: suse sles-15-sp6 gen2 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
verify_client_active_interval (lisa_0_0) ✅ PASSED 6.547

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.

2 participants