Skip to content

Commit 5d434e0

Browse files
committed
Prevent hardcoding
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
1 parent c742c09 commit 5d434e0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/controller/telemetry/metric_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/stretchr/testify/assert"
2929

3030
"kmesh.net/kmesh/api/v2/workloadapi"
31+
"kmesh.net/kmesh/pkg/constants"
3132
"kmesh.net/kmesh/pkg/controller/workload/cache"
3233
"kmesh.net/kmesh/pkg/nets"
3334
)
@@ -1686,16 +1687,17 @@ func TestBuildV4Metric(t *testing.T) {
16861687
210, 202, 232, 184, 0, 0, 64, 30, 158, 31, 235, 184, 0, 0, 0, 0, 0, 0, 150, 158, 0, 0, 19, 0, 0, 0, 0, 0,
16871688
0, 0, 0, 0, 0, 0, 0, 0, 0, 0})
16881689
data := requestMetric{
1690+
16891691
conSrcDstInfo: connectionSrcDst{
16901692
src: [4]uint32{218231818, 0, 0, 0},
16911693
dst: [4]uint32{201454602, 0, 0, 0},
1692-
direction: 2,
1694+
direction: constants.OUTBOUND,
16931695
srcPort: 53282,
16941696
dstPort: 8080,
16951697
},
16961698
origDstAddr: [4]uint32{3761135626, 0, 0, 0},
16971699
origDstPort: 8080,
1698-
direction: 2,
1700+
direction: constants.OUTBOUND,
16991701
receivedBytes: 147,
17001702
sentBytes: 3,
17011703
state: 1,

0 commit comments

Comments
 (0)