tests: replace Windows-reserved nul.txt fixtures in tail and awk
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Read the three named tests in builtins/tail/tail_test.go and builtins/tests/awk/awk_test.go. Rename their fixture files and command operands from nul.txt to a portable name such as records.txt, preserving the NUL bytes, options, and assertions. Run TestTailZeroTerminatedLines, TestTailZeroTerminatedOffsetMode, and TestAwkSingleCharacterRecordSeparator on Windows and Linux or macOS; done means all three pass on each.
Written by the indexing model from the issue text.
Description
Describe the bug
Three record-separator tests use nul.txt as a fixture filename. Windows reserves NUL, including names with extensions such as nul.txt, so rshell's confined filesystem access rejects the path before the intended NUL-delimited input can be processed.
Pre-migration work: Fix these fixtures in rshell before migrating the tests into datadog-agent. This is a test portability issue; the failures do not establish a defect in tail/awk record parsing.
Affected tests, still present on rshell main at 7d23f9f1d22cae7f3f581efb03ba02fc1ed4717e:
Steps to reproduce
Run these three tests on Windows. The tail fixtures contain alpha\x00beta\x00gamma\x00; the awk fixture contains alpha\x00beta\x00. Each command opens the fixture using the name nul.txt.
Expected behavior
The tests should open ordinary temporary files and verify their existing record-separator assertions on Windows as well as Linux/macOS.
Actual behavior
The tail tests return exit code 1 and empty stdout rather than the expected beta\x00gamma\x00.
The awk test reports:
awk: fatal: cannot open file `nul.txt' for reading: openat nul.txt: path escapes from parent
The NUL-delimited records are missing from its output; the subsequent comma-delimited command still produces output. The error is the filesystem API rejecting a reserved Windows path, not evidence that the test attempted directory traversal.
Proposed fix and validation
Rename the affected fixtures and command operands to a portable filename such as records.txt. Preserve the NUL bytes, command options, and existing assertions. Validate all three tests on Windows and retain Linux/macOS coverage; no change to filesystem restrictions or command parsing is needed for the fixture fix.
Environment and evidence
- Windows x64, observed during Agent migration PR #58502, commit
f18800b0686644b613d2e2c00d65283a538582fc. - Windows test job with all three failures.
- Microsoft's reserved filename documentation.
- Dominant language
- Go
- Stars
- 31
- Forks
- 3
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 12
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataDog/rshell
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[correctness][confirmed-defect][builtins/wc] wc pads regular-file stdin as though it were a pipeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
Similar issues
-
client.HTTPFetcher doesn't close non-200 response bodies, so connections leakPossibly taken @grempe claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
transparency-dev/tessera#1245 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
bug e2e
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
shaiknoorullah/hg-mono#1086 ·
Maintainers usually reply within 1 day
-
native
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
prime-radiant-inc/evener#4839 ·
Maintainers usually reply within 1 day
-
area: records bug priority: normal
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day