Add historical journald and log export flags to operator debug command (#26410)

* Add -log-file-export and -log-lookback commands to add historical log to
debug capture
* use monitor.PrepFile() helper for other historical log tests
This commit is contained in:
tehut
2025-08-04 13:55:25 -07:00
committed by GitHub
parent 7c633f8109
commit 21841d3067
9 changed files with 259 additions and 48 deletions

View File

@@ -454,14 +454,7 @@ func TestMonitor_MonitorExport(t *testing.T) {
ci.Parallel(t)
// Create test file
dir := t.TempDir()
f, err := os.CreateTemp(dir, "log")
must.NoError(t, err)
for range 1000 {
_, _ = f.WriteString(fmt.Sprintf("%v [INFO] it's log, it's log, it's big it's heavy it's wood", time.Now()))
}
f.Close()
testFilePath := f.Name()
testFilePath := monitor.PrepFile(t).Name()
testFileContents, err := os.ReadFile(testFilePath)
must.NoError(t, err)