tests: integration: Use hugepage size to calculate the number of pages

The tests require a fixed amount of huge page memory to run, rather than
encode that as fixed number of huge pages it should be calculated from
the size of memory required and the huge page size

Signed-off-by: Dom <peng6662001@163.com>
This commit is contained in:
Dom
2023-03-07 14:28:02 +08:00
committed by Rob Bradford
parent 961319d8ad
commit b35a94d83c
5 changed files with 15 additions and 5 deletions

View File

@@ -89,7 +89,9 @@ fi
cargo build --no-default-features --features "kvm,mshv" --all --release --target $BUILD_TARGET
# Test ovs-dpdk relies on hugepages
echo 6144 | sudo tee /proc/sys/vm/nr_hugepages
HUGEPAGESIZE=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`
PAGE_NUM=`echo $((12288 * 1024 / $HUGEPAGESIZE))`
echo $PAGE_NUM | sudo tee /proc/sys/vm/nr_hugepages
sudo chmod a+rwX /dev/hugepages
export RUST_BACKTRACE=1