From c8054b83fbbd5fbb8eefb5e5e1d5aea513b87424 Mon Sep 17 00:00:00 2001 From: Antti Kervinen Date: Mon, 30 Sep 2024 12:43:57 +0300 Subject: [PATCH] e2e: add test for ignoring a container in the balloons policy Signed-off-by: Antti Kervinen --- test/e2e/policies.test-suite/balloons/match-config.yaml | 9 +++++++++ .../balloons/n4c16/test11-match-expression/code.var.sh | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/test/e2e/policies.test-suite/balloons/match-config.yaml b/test/e2e/policies.test-suite/balloons/match-config.yaml index 29d68649e..b941959fa 100644 --- a/test/e2e/policies.test-suite/balloons/match-config.yaml +++ b/test/e2e/policies.test-suite/balloons/match-config.yaml @@ -5,6 +5,15 @@ config: pinMemory: true idleCPUClass: normal allocatorTopologyBalancing: true + ignore: + matchExpressions: + - key: name + operator: In + values: + - pod1cX + - pod2c1 + - pod2c2 + - pod3cX balloonTypes: - name: special matchExpressions: diff --git a/test/e2e/policies.test-suite/balloons/n4c16/test11-match-expression/code.var.sh b/test/e2e/policies.test-suite/balloons/n4c16/test11-match-expression/code.var.sh index 70b065532..c3268d384 100644 --- a/test/e2e/policies.test-suite/balloons/n4c16/test11-match-expression/code.var.sh +++ b/test/e2e/policies.test-suite/balloons/n4c16/test11-match-expression/code.var.sh @@ -21,4 +21,12 @@ CONTCOUNT=1 create balloons-busybox report allowed verify 'len(cpus["pod1c0"]) == 1' +# pod2: run ordinary workload where pod2c1 and pod2c2 match ignore expression +CONTCOUNT=4 create balloons-busybox +report allowed +verify 'len(cpus["pod2c0"]) == 1' \ + 'len(cpus["pod2c1"]) == 16' \ + 'len(cpus["pod2c2"]) == 16' \ + 'len(cpus["pod2c3"]) == 1' + cleanup