summaryrefslogtreecommitdiffstats
path: root/testcases/testcase.py
diff options
context:
space:
mode:
authorChristian Trautman <ctrautma@redhat.com>2016-08-11 12:34:07 -0400
committerChristian Trautman <ctrautma@redhat.com>2016-08-11 12:34:07 -0400
commitcc4667ef7310b300cdf40202a2de0e19e85fa800 (patch)
tree20a4cdda64fe663cf9eead0f6603d0461b01be0d /testcases/testcase.py
parent5a0c6772d255aeb0ab1e6246c91bbeb56bb3a239 (diff)
hugepage_fix: Fix free hugepage calcluation
Fixes hugepage free calculation when hugepage size is not 1GB. Calculation previously assumed 1GB in size. This change allows for all sizes to be calculated properly. Change-Id: Ib05800f51992e9757c412a66296a47ad29e88a3b Signed-off-by: Christian Trautman <ctrautma@redhat.com>
Diffstat (limited to 'testcases/testcase.py')
-rw-r--r--testcases/testcase.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/testcases/testcase.py b/testcases/testcase.py
index d88840d7..0123b305 100644
--- a/testcases/testcase.py
+++ b/testcases/testcase.py
@@ -439,8 +439,8 @@ class TestCase(object):
'-socket-mem\s+(\d+),(\d+)',
''.join(S.getValue('VSWITCHD_DPDK_ARGS')))
if match:
- sock0_mem, sock1_mem = (int(match.group(1)) / 1024,
- int(match.group(2)) / 1024)
+ sock0_mem, sock1_mem = (int(match.group(1)) * 1024 / hugepage_size,
+ int(match.group(2)) * 1024 / hugepage_size)
else:
logging.info(
'Could not parse socket memory config in dpdk params.')
@@ -448,8 +448,8 @@ class TestCase(object):
sock0_mem, sock1_mem = (
S.getValue(
'VSWITCHD_DPDK_CONFIG')['dpdk-socket-mem'].split(','))
- sock0_mem, sock1_mem = (int(sock0_mem) / 1024,
- int(sock1_mem) / 1024)
+ sock0_mem, sock1_mem = (int(sock0_mem) * 1024 / hugepage_size,
+ int(sock1_mem) * 1024 / hugepage_size)
# If hugepages needed, verify the amounts are free
if any([hugepages_needed, sock0_mem, sock1_mem]):