From fdff1e6ef0422ba23343e63cf144eb1b34f5b446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20M=C3=A9ndez=20Hern=C3=A1ndez?= Date: Tue, 26 Mar 2024 20:29:28 +0100 Subject: [PATCH] fix(storage-benchmark): Fix RAMGB calculation The previous calculation not always resulted in an integer, which wasn't what it was expected, and failed with some locales. - Fixes: https://github.com/RedHatSatellite/satellite-support/issues/80 - Based on input from https://github.com/RedHatSatellite/satellite-support/pull/82 and https://github.com/RedHatSatellite/satellite-support/pull/88. --- storage-benchmark | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/storage-benchmark b/storage-benchmark index 0088e9f..9e245e1 100755 --- a/storage-benchmark +++ b/storage-benchmark @@ -65,9 +65,7 @@ then exit 1 fi -RAMGB=`grep MemTotal /proc/meminfo | awk '{s+=$2} END {print s / 1000000}'` -# Convert to integer -RAMGB=`printf "%.0f\n" "$RAMGB"` +RAMGB=$(awk '/^MemTotal:/ {printf "%d\n", $2 / 1024 / 1024}' /proc/meminfo) FILEGB="$(($RAMGB * 2))" TESTDIRECTORY=$TESTPATH/storage-benchmark