Skip to content

Commit f82d8b0

Browse files
test: ensure hugepages allocated
When deploying a kind cluster, ensure we allocate the requested hugepages. Signed-off-by: Tiago Castro <[email protected]>
1 parent 37218a0 commit f82d8b0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/k8s-ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: K8s CI
22
on:
33
workflow_call:
4+
push:
5+
branches:
6+
- pytest
47

58
jobs:
69
k8s-ci:

scripts/k8s/setup-io-prereq.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ die() {
3535
}
3636

3737
setup_hugepages() {
38-
$SYSCTL -w vm.nr_hugepages="$1"
38+
local wanted="$1"
39+
$SYSCTL -w vm.nr_hugepages="$wanted"
40+
local actual
41+
actual=$($SYSCTL -b vm.nr_hugepages)
42+
if [ "$actual" != "$wanted" ]; then
43+
die "Wanted $wanted hugepages, but only allocated $actual hugepages"
44+
fi
3945
}
4046

4147
modprobe_nvme_tcp() {
@@ -99,7 +105,7 @@ while [ "$#" -gt 0 ]; do
99105
done
100106

101107
if [ -n "$HUGE_PAGES" ]; then
102-
pages=$(sysctl -b vm.nr_hugepages)
108+
pages=$($SYSCTL -b vm.nr_hugepages)
103109

104110
if [ "$HUGE_PAGES" -gt "$pages" ]; then
105111
setup_hugepages "$HUGE_PAGES"

0 commit comments

Comments
 (0)