Skip to content

Commit 43e00fb

Browse files
committedJul 5, 2024
Add Roman's test case.
Signed-off-by: Rodrigo Reis <rodrigo.gargravarr@gmail.com>
1 parent 515d26b commit 43e00fb

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
 

‎pkg/core/traffic_test.go

+26
Original file line numberDiff line numberDiff line change
@@ -1853,6 +1853,32 @@ func TestComputeTrafficSegments(t *testing.T) {
18531853
},
18541854
expectErr: false,
18551855
},
1856+
{
1857+
actualTrafficWeights: map[types.UID]float64{
1858+
"v1": 50.0,
1859+
"v2": 50.0,
1860+
},
1861+
ingressSegments: map[types.UID]string{
1862+
"v1": "TrafficSegment(0.0, 0.26)",
1863+
"v2": "TrafficSegment(0.24, 0.50)",
1864+
"v3": "TrafficSegment(0.50, 0.75)",
1865+
"v4": "TrafficSegment(0.75, 1.0)",
1866+
},
1867+
routeGroupSegments: map[types.UID]string{
1868+
"v1": "",
1869+
"v2": "",
1870+
},
1871+
expected: []types.UID{"v1", "v2"},
1872+
expectedLowerLimits: map[types.UID]float64{
1873+
"v2": 0.5,
1874+
"v1": 0.0,
1875+
},
1876+
expectedUpperLimits: map[types.UID]float64{
1877+
"v2": 1.0,
1878+
"v1": 0.5,
1879+
},
1880+
expectErr: false,
1881+
},
18561882
} {
18571883
stackContainers := map[types.UID]*StackContainer{}
18581884
for k, v := range tc.actualTrafficWeights {

0 commit comments

Comments
 (0)