(t *testing.T)
| 210 | } |
| 211 | |
| 212 | func TestInputFileCompressed(t *testing.T) { |
| 213 | rnd := rand.Int63() |
| 214 | |
| 215 | output := NewFileOutput(fmt.Sprintf("/tmp/%d_0.gz", rnd), &FileOutputConfig{FlushInterval: time.Minute, Append: true}) |
| 216 | for i := 0; i < 1000; i++ { |
| 217 | output.PluginWrite(&Message{Meta: []byte("1 1 1\r\n"), Data: []byte("test")}) |
| 218 | } |
| 219 | name1 := output.file.Name() |
| 220 | output.Close() |
| 221 | |
| 222 | output2 := NewFileOutput(fmt.Sprintf("/tmp/%d_1.gz", rnd), &FileOutputConfig{FlushInterval: time.Minute, Append: true}) |
| 223 | for i := 0; i < 1000; i++ { |
| 224 | output2.PluginWrite(&Message{Meta: []byte("1 1 1\r\n"), Data: []byte("test")}) |
| 225 | } |
| 226 | name2 := output2.file.Name() |
| 227 | output2.Close() |
| 228 | |
| 229 | input := NewFileInput(fmt.Sprintf("/tmp/%d*", rnd), false, 100, 0, false) |
| 230 | for i := 0; i < 2000; i++ { |
| 231 | input.PluginRead() |
| 232 | } |
| 233 | |
| 234 | os.Remove(name1) |
| 235 | os.Remove(name2) |
| 236 | } |
| 237 | |
| 238 | type CaptureFile struct { |
| 239 | msgs []*Message |
nothing calls this directly
no test coverage detected