Skip to content

Commit 5f734aa

Browse files
committed
e2e: add test for exhausting idle shared pools.
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
1 parent 62cb27f commit 5f734aa

File tree

1 file changed

+47
-0
lines changed
  • test/e2e/policies.test-suite/topology-aware/n4c16/test16-idle-shared-pools

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
vm-command "kubectl delete pods --all --now"
2+
helm-terminate
3+
4+
helm_config=$(COLOCATE_PODS=false instantiate helm-config.yaml) helm-launch topology-aware
5+
6+
# Test that we allow slicing idle shared pools empty.
7+
CPU=4 MEM=100M CONTCOUNT=3 create guaranteed
8+
verify 'disjoint_sets(cpus["pod0c0"],cpus["pod0c1"],cpus["pod0c2"])'
9+
verify 'len(cpus["pod0c0"]) == 4' \
10+
'len(cpus["pod0c1"]) == 4' \
11+
'len(cpus["pod0c2"]) == 4'
12+
13+
verify 'disjoint_sets(nodes["pod0c0"],nodes["pod0c1"],nodes["pod0c2"])'
14+
verify 'len(nodes["pod0c0"]) == 1' \
15+
'len(nodes["pod0c1"]) == 1' \
16+
'len(nodes["pod0c2"]) == 1'
17+
18+
# Test that BestEffort and Burstable containers are now placed in the only
19+
# remaining pool with free CPU.
20+
CONTCOUNT=4 create besteffort
21+
verify 'cpus["pod1c0"] == cpus["pod1c1"]' \
22+
'cpus["pod1c0"] == cpus["pod1c2"]' \
23+
'cpus["pod1c0"] == cpus["pod1c3"]'
24+
25+
CONTCOUNT=4 CPUREQ=100m CPULIM=150m create burstable
26+
verify 'cpus["pod2c0"] == cpus["pod2c1"]' \
27+
'cpus["pod2c0"] == cpus["pod2c2"]' \
28+
'cpus["pod2c0"] == cpus["pod2c3"]' \
29+
'cpus["pod2c0"] == cpus["pod1c0"]'
30+
verify 'disjoint_sets(nodes["pod0c0"],nodes["pod0c1"],nodes["pod0c2"],nodes["pod1c0"])'
31+
32+
vm-command "kubectl delete pods --all --now"
33+
34+
# Now test the other way around. First spread 2 besteffort containers
35+
# around NUMA nodes. Then create a guaranteed one with 4 CPUs and check
36+
# that it gets allocated to a full NUMA node.
37+
CONTCOUNT=2 create besteffort
38+
verify 'disjoint_sets(cpus["pod3c0"],cpus["pod3c1"])'
39+
40+
CPU=4 MEM=100M CONTCOUNT=1 create guaranteed
41+
verify 'disjoint_sets(cpus["pod4c0"],cpus["pod3c0"],cpus["pod3c1"])'
42+
verify 'len(cpus["pod4c0"]) == 4' \
43+
'len(nodes["pod4c0"]) == 1'
44+
verify 'disjoint_sets(nodes["pod3c0"],nodes["pod3c1"],nodes["pod4c0"])'
45+
46+
vm-command "kubectl delete pods --all --now"
47+
helm-terminate

0 commit comments

Comments
 (0)