Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

tests: replace Windows-reserved nul.txt fixtures in tail and awk

Abierto Apto para principiantes
#676 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@matt-dz ya está trabajando en esto.

Desde el 23/10/2026.

  • #685 de @matt-dz — abierto

Evaluación

Dificultad
1/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
88/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
testing

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

pre-migration
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
Lenguaje dominante
Go
Estrellas
31
Forks
3
Merge medio
1 d 18 h
PR fusionados (30 d)
12

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DataDog/rshell

Todos los issues de DataDog/rshell

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.