e2e: node: {cpu,topo}mgr: don't assume cpu capacity >= 2

Even though CI machines _usually_ have at least two cpus,
let's rather not assume this holds true, and let's actually
check the allocatable CPUs, skipping even the simplest
tests if the assumption is broken, to avoid false negatives.

Signed-off-by: Francesco Romani <fromani@redhat.com>
This commit is contained in:
Francesco Romani 2022-02-02 13:59:20 +01:00
parent 2d1503dae3
commit c92d9f7974

View File

@ -342,6 +342,12 @@ func runTopologyManagerPolicySuiteTests(f *framework.Framework) {
cpuCap, cpuAlloc, _ = getLocalNodeCPUDetails(f)
ginkgo.By(fmt.Sprintf("checking node CPU capacity (%d) and allocatable CPUs (%d)", cpuCap, cpuAlloc))
// Albeit even the weakest CI machines usually have 2 cpus, let's be extra careful and
// check explicitly. We prefer to skip than a false negative (and a failed test).
if cpuAlloc < 1 {
e2eskipper.Skipf("Skipping basic CPU Manager tests since CPU capacity < 2")
}
ginkgo.By("running a non-Gu pod")
runNonGuPodTest(f, cpuCap)