Skip to content

Commit 27b52da

Browse files
committed
fix test
1 parent 849986d commit 27b52da

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

cmd/display_loop_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
)
88

99
func TestDisplayLoop(t *testing.T) {
10+
enrichment.current = 0
1011
assert.Equal(t, []string{"None"}, enrichment.getNames())
1112
assert.Equal(t, []string{"SrcAddr", "SrcPort", "DstAddr", "DstPort"}, enrichment.getCols())
1213

cmd/flow_capture.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var (
3535
lastFlows = []config.GenericMap{}
3636

3737
features = displayLoop{
38-
current: 6,
38+
current: featureDefaultIndex,
3939
all: []displayLoopItem{
4040
{name: "Raw"},
4141
{name: "Standard", columns: []string{"Dir", "Interfaces", "Proto", "Dscp", "Bytes", "Packets"}},
@@ -48,7 +48,7 @@ var (
4848
}
4949

5050
enrichment = displayLoop{
51-
current: 4,
51+
current: enrichmentDefaultIndex,
5252
all: []displayLoopItem{
5353
{name: "None", columns: []string{"SrcAddr", "SrcPort", "DstAddr", "DstPort"}},
5454
{name: "Zone", columns: []string{"SrcZone", "DstZone"}},
@@ -60,6 +60,11 @@ var (
6060
}
6161
)
6262

63+
const (
64+
featureDefaultIndex = 6 // All feats.
65+
enrichmentDefaultIndex = 4 // Resources
66+
)
67+
6368
func runFlowCapture(_ *cobra.Command, _ []string) {
6469
go func() {
6570
scanner()

cmd/flow_capture_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func TestFlowTableMultipleFlows(t *testing.T) {
5454

5555
// set display to standard without enrichment
5656
features.current = 1
57+
enrichment.current = 0
5758

5859
// set time and bytes per flow
5960
flowTime := 1704063600000

cmd/root_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ func setup() {
8383
// clear filters and previous flows
8484
regexes = []string{}
8585
lastFlows = []config.GenericMap{}
86+
features.current = featureDefaultIndex
87+
enrichment.current = enrichmentDefaultIndex
8688
}
8789

8890
func resetTime() {

0 commit comments

Comments
 (0)