From 227ddfbe0f1e274b35652f81fe16cc3665580e11 Mon Sep 17 00:00:00 2001 From: Haywood Shannon <5781935+haywoodsh@users.noreply.github.com> Date: Fri, 17 Nov 2023 16:17:51 +0000 Subject: [PATCH] add test case Signed-off-by: Haywood Shannon <5781935+haywoodsh@users.noreply.github.com> --- .../validation/virtualserver_test.go | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkg/apis/configuration/validation/virtualserver_test.go b/pkg/apis/configuration/validation/virtualserver_test.go index 6d9dea84d4..d602588348 100644 --- a/pkg/apis/configuration/validation/virtualserver_test.go +++ b/pkg/apis/configuration/validation/virtualserver_test.go @@ -1774,6 +1774,27 @@ func TestValidateSplitsFails(t *testing.T) { }, msg: "invalid action with non-existing upstream", }, + { + splits: []v1.Split{ + { + Weight: 100, + Action: &v1.Action{ + Pass: "test-1", + }, + }, + { + Weight: -2, + Action: &v1.Action{ + Pass: "test-2", + }, + }, + }, + upstreamNames: map[string]sets.Empty{ + "test-1": {}, + "test-2": {}, + }, + msg: "invalid negative weight", + }, } vsv := &VirtualServerValidator{isPlus: false}