tests: replace Windows-reserved nul.txt fixtures in tail and awk
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Đọc ba bài kiểm thử được nêu trong builtins/tail/tail_test.go và builtins/tests/awk/awk_test.go. Đổi tên các tệp fixture và toán hạng lệnh từ nul.txt thành một tên có tính di động như records.txt, đồng thời giữ nguyên các byte NUL, tùy chọn và khẳng định. Chạy TestTailZeroTerminatedLines, TestTailZeroTerminatedOffsetMode và TestAwkSingleCharacterRecordSeparator trên Windows và Linux hoặc macOS; hoàn tất khi cả ba đều đạt trên mỗi hệ thống.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 31
- Fork
- 3
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DataDog/rshell
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[correctness][confirmed-defect][builtins/wc] wc pads regular-file stdin as though it were a pipeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DataDog/rshell
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
praetorianer777/Dynamo#53 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/engineering pulumi/pulumi-terraform Task Workflow Failure
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
pulumi/pulumi-terraform#1261 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Controllers integration tests fail when port 8080 is in useCó thể đã có người làm @noahnut đã nhận hôm nay. Đang mởarea/cluster-autoscaler kind/bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
kubernetes-sigs/cluster-autoscaler#236 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày