Fix LTP skip test cases bug in WSL Env - #4540
Merged
Merged
Conversation
Root cause: WslShell.copy() creates the destination file but leaves it empty (0 bytes) on remote Azure WSL nodes. runltp then checks [ -r skipfile ] && [ -s skipfile ] and silently discards the -S argument, so ltp-pan sees '-S ' with no path. Fix: - skip_tests list path: use printf|tee to write directly on the remote node instead of shell.copy(), with test -s verification - user_input_skip_file path: after shell.copy(), verify the file is non-empty; if empty, fall back to reading the local file and writing via printf|tee - Extract shared helpers: _write_skip_tests_to_remote, _verify_or_rewrite_skip_file, _assert_skip_file_non_empty Verified on remote Azure VM WSL: - printf|tee produces 35-byte file with 5 skip test names - test -s confirms non-empty - runltp check ([ -r ] && [ -s ]) passes - ltp-pan receives '-S /opt/ltp/skipfile' (not empty) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The full skip list (300+ entries) in a single printf command exceeded SSH/WSL command-line length limits, causing SshSpawnTimeoutException. Split into batches of 50 test names, using tee for the first batch and tee -a for subsequent batches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the LTP runner helper (Ltp tool) to make skip-file handling more reliable in WSL environments by avoiding reliance on shell.copy() producing a valid, non-empty remote skip file, and by batching remote writes to reduce command-length/SSH-buffer issues.
Changes:
- Added helpers to write the skip list directly on the remote node via
printf | tee, with batching to avoid overly long commands. - Added a post-copy verification step for user-provided skip files and a fallback rewrite path if the remote file is empty.
❌ AI Test Selection — FAILED2 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
Test case details
|
❌ AI Test Selection — FAILED2 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
Test case details
|
LiliDeng
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
LTP has bug when parse in skipped cases in WSL env.
Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
Test Results