tests: replace Windows-reserved nul.txt fixtures in tail and awk
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
builtins/tail/tail_test.go と builtins/tests/awk/awk_test.go にある、指定された3つのテストを読みます。NULバイト、オプション、アサーションを維持しながら、それらのfixtureファイルとコマンドオペランドの名前を nul.txt から records.txt などのポータブルな名前に変更します。Windows と Linux または macOS で TestTailZeroTerminatedLines、TestTailZeroTerminatedOffsetMode、TestAwkSingleCharacterRecordSeparator を実行します。各システムですべてのテストが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 31
- フォーク
- 3
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DataDog/rshell のほかの issue
-
tests: TestCheckRemoteNoHostIO/stat-canary misses ARM64 fstatat対応中かも @matt-dz が 1 日前に担当しました。 オープンpre-migration
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
[correctness][confirmed-defect][builtins/wc] wc pads regular-file stdin as though it were a pipeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
Project submission:オープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
slavakurilyak/awesome-ai-agents#845 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
JakeChampion/lang#13132 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] deploy.restart_policy without condition drops the restart policy対応中かも @akshat-lakhera が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
docker/compose#14383 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信