Skip to content

Commit a6df16a

Browse files
committed
node e2e test: exclude critical pods from swapping
Signed-off-by: Itamar Holder <[email protected]>
1 parent 6c1f14c commit a6df16a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/e2e_node/swap_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ var _ = SIGDescribe("Swap", "[LinuxOnly]", nodefeature.Swap, framework.WithSeria
8484
ginkgo.Entry("QOS Burstable with memory request equals to limit", v1.PodQOSBurstable, true),
8585
ginkgo.Entry("QOS Guaranteed", v1.PodQOSGuaranteed, false),
8686
)
87+
88+
ginkgo.It("with a critical pod - should avoid swap", func() {
89+
ginkgo.By("Creating a critical pod")
90+
const memoryRequestEqualLimit = false
91+
pod := getSwapTestPod(f, v1.PodQOSBurstable, memoryRequestEqualLimit)
92+
pod.Spec.PriorityClassName = "system-node-critical"
93+
94+
pod = runPodAndWaitUntilScheduled(f, pod)
95+
gomega.Expect(types.IsCriticalPod(pod)).To(gomega.BeTrueBecause("pod should be critical"))
96+
97+
ginkgo.By("expecting pod to not have swap access")
98+
expectNoSwap(f, pod)
99+
})
87100
})
88101

89102
f.Context(framework.WithSerial(), func() {

0 commit comments

Comments
 (0)