e2e: node: bootstrap podresources tests

Start e2e tests for the existing List() API.

Signed-off-by: Francesco Romani <fromani@redhat.com>
This commit is contained in:
Francesco Romani
2020-08-21 15:09:56 +02:00
parent 9780d88cb6
commit 4e7434028c
3 changed files with 308 additions and 11 deletions

View File

@@ -89,13 +89,17 @@ func detectCoresPerSocket() int {
return coreCount
}
func detectSRIOVDevices() int {
func countSRIOVDevices() (int, error) {
outData, err := exec.Command("/bin/sh", "-c", "ls /sys/bus/pci/devices/*/physfn | wc -w").Output()
framework.ExpectNoError(err)
if err != nil {
return -1, err
}
return strconv.Atoi(strings.TrimSpace(string(outData)))
}
devCount, err := strconv.Atoi(strings.TrimSpace(string(outData)))
func detectSRIOVDevices() int {
devCount, err := countSRIOVDevices()
framework.ExpectNoError(err)
return devCount
}
@@ -434,7 +438,7 @@ func runTopologyManagerPositiveTest(f *framework.Framework, numPods int, ctnAttr
pod := pods[podID]
framework.Logf("deleting the pod %s/%s and waiting for container removal",
pod.Namespace, pod.Name)
deletePods(f, []string{pod.Name})
deletePodSyncByName(f, pod.Name)
waitForAllContainerRemoval(pod.Name, pod.Namespace)
}
}
@@ -462,7 +466,7 @@ func runTopologyManagerNegativeTest(f *framework.Framework, ctnAttrs, initCtnAtt
framework.Failf("pod %s failed for wrong reason: %q", pod.Name, pod.Status.Reason)
}
deletePods(f, []string{pod.Name})
deletePodSyncByName(f, pod.Name)
}
func isTopologyAffinityError(pod *v1.Pod) bool {