tests: replace Windows-reserved nul.txt fixtures in tail and awk
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 88/100
Línea de trabajo
Lee las tres pruebas mencionadas en builtins/tail/tail_test.go y builtins/tests/awk/awk_test.go. Cambia el nombre de sus archivos de fixture y de los operandos de los comandos de nul.txt a un nombre portable como records.txt, conservando los bytes NUL, las opciones y las aserciones. Ejecuta TestTailZeroTerminatedLines, TestTailZeroTerminatedOffsetMode y TestAwkSingleCharacterRecordSeparator en Windows y Linux o macOS; se considera terminado cuando las tres pasan en cada sistema.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 31
- Forks
- 3
- Merge medio
- 1 d 18 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DataDog/rshell
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
[correctness][confirmed-defect][builtins/wc] wc pads regular-file stdin as though it were a pipeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
Todos los issues de DataDog/rshell
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
FiloSottile/age#758 ·
-
nginx configAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 2 días
-
fix: the buttons mock cannot take back the match point -- its undo looks only for the running matchAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
stuttgart-things/zaehlwerk#168 ·
Los mantenedores suelen responder en 1 día