diff --git a/packetbeat/docs/packetbeat-options.asciidoc b/packetbeat/docs/packetbeat-options.asciidoc index f226f723a9fb..aaa598b612c3 100644 --- a/packetbeat/docs/packetbeat-options.asciidoc +++ b/packetbeat/docs/packetbeat-options.asciidoc @@ -465,7 +465,7 @@ disabled, flows are still reported once being timed out. The default value is ==== `enable_delta_flow_reports` Configure network.bytes and network.packets to be a delta -value instead of a cummlative sum for each flow period. The default value is false. +value instead of a cumlative sum for each flow period. The default value is false. [float] [[packetbeat-configuration-flows-fields]] diff --git a/packetbeat/flows/worker_test.go b/packetbeat/flows/worker_test.go index 7e835de2b44c..d6e371cad875 100644 --- a/packetbeat/flows/worker_test.go +++ b/packetbeat/flows/worker_test.go @@ -21,6 +21,7 @@ import ( "encoding/json" "flag" "os" + "reflect" "testing" "time" @@ -137,6 +138,11 @@ func TestCreateEvent(t *testing.T) { } expectbiFlow.stats[0] = &flowStats{uintFlags: []uint8{1, 1}, uints: []uint64{0, 0}} expectbiFlow.stats[1] = &flowStats{uintFlags: []uint8{1, 1}, uints: []uint64{0, 0}} + + // Assert the biflow is not 0 before the test + assert.Assert(t, !reflect.DeepEqual(expectbiFlow.stats[0].uints, bif.stats[0].uints)) + assert.Assert(t, !reflect.DeepEqual(expectbiFlow.stats[1].uints, bif.stats[1].uints)) + event = createEvent(&procs.ProcessesWatcher{}, time.Now(), bif, true, nil, []string{"bytes", "packets"}, nil, true) result = validate(event.Fields) if errs := result.Errors(); len(errs) > 0 { @@ -145,6 +151,8 @@ func TestCreateEvent(t *testing.T) { } t.FailNow() } + + // Assert the biflow is 0 after the test assert.DeepEqual(t, expectbiFlow.stats[0].uintFlags, bif.stats[0].uintFlags) assert.DeepEqual(t, expectbiFlow.stats[0].uints, bif.stats[0].uints) assert.DeepEqual(t, expectbiFlow.stats[1].uintFlags, bif.stats[1].uintFlags)