node: e2e: topology-mgr: Determine threads per core

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
This commit is contained in:
Swati Sehgal
2023-10-23 12:01:28 +01:00
parent 145b84b0b1
commit e1f5eb3f14
2 changed files with 17 additions and 4 deletions

View File

@@ -88,6 +88,16 @@ func detectCoresPerSocket() int {
return coreCount
}
func detectThreadPerCore() int {
outData, err := exec.Command("/bin/sh", "-c", "lscpu | grep \"Thread(s) per core:\" | cut -d \":\" -f 2").Output()
framework.ExpectNoError(err)
threadCount, err := strconv.Atoi(strings.TrimSpace(string(outData)))
framework.ExpectNoError(err)
return threadCount
}
func makeContainers(ctnCmd string, ctnAttributes []tmCtnAttribute) (ctns []v1.Container) {
for _, ctnAttr := range ctnAttributes {
ctn := v1.Container{