File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
microsoft/testsuites/dpdk Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 44from enum import Enum
55from typing import Any , Set
66
7- from assertpy import assert_that
8-
97from lisa .executable import Tool
108from lisa .tools .free import Free
119from lisa .tools .ls import Ls
@@ -84,10 +82,12 @@ def _enable_hugepages(
8482 )
8583 total_request_pages = request_space_kb // hugepage_size_kb .value
8684 pages_per_numa_node = total_request_pages // numa_nodes
87- assert_that (pages_per_numa_node ).described_as (
88- "Must request huge page count > 0. Verify this system has enough "
89- "free memory to allocate ~2GB of hugepages"
90- ).is_greater_than (0 )
85+ if pages_per_numa_node <= 0 :
86+ raise NotEnoughMemoryException (
87+ "Must request huge page count > 0. Verify this system has enough "
88+ "free memory to allocate ~2GB of hugepages"
89+ )
90+
9191 for i in range (numa_nodes ):
9292 # nr_hugepages will be written with the number calculated
9393 # based on 2MB hugepages if not specified, subject to change
Original file line number Diff line number Diff line change @@ -346,7 +346,10 @@ def initialize_node_resources(
346346
347347 # init and enable hugepages (required by dpdk)
348348 hugepages = node .tools [Hugepages ]
349- hugepages .init_hugepages (hugepage_size , minimum_gb = 4 )
349+ try :
350+ hugepages .init_hugepages (hugepage_size , minimum_gb = 4 )
351+ except NotEnoughMemoryException as err :
352+ raise SkippedException (err )
350353
351354 assert_that (len (node .nics )).described_as (
352355 "Test needs at least 1 NIC on the test node."
You can’t perform that action at this time.
0 commit comments