cpuset_memory_testset.sh: Fix syntax error when hugepages not supported
PATCH 1/1 cpuset_memory_testset.sh: Fix syntax error when hugepages not supported
The initial hugepage size calculation can result in multiplication of empty string on machines which don't support hugepages. Make sure that empty string is converted to zero.
--- .../cpuset/cpuset_memory_test/cpuset_memory_testset.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh +1 -1
@@ -41,7 +41,7 @@ mems_all="$(seq -s, 0 $((nr_mems-1)))" cpu_of_node0=0 HUGEPAGESIZE=$(awk '/Hugepagesize/{ print $2 }' /proc/meminfo) -HUGEPAGESIZE=$(($HUGEPAGESIZE * 1024)) +HUGEPAGESIZE=$((${HUGEPAGESIZE:-0} * 1024)) MEMORY_RESULT="$CPUSET_TMP/memory_result"
Signature · 5 lines
2.41.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 6 lines · Martin Doucha
The initial hugepage size calculation can result in multiplication of empty string on machines which don't support hugepages. Make sure that empty string is converted to zero.
Signed-off-by Martin Doucha <[email protected]>
Quoted 29 lines
--- .../cpuset/cpuset_memory_test/cpuset_memory_testset.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git
a/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.shb/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.shindexcb7dbd867..c1e7cea8f100755
---a/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
+++b/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.shtestcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh +1
-2@@ -41,7 +41,7 @@ mems_all="$(seq -s, 0 $((nr_mems-1)))" cpu_of_node0=0 HUGEPAGESIZE=$(awk '/Hugepagesize/{ print $2 }' /proc/meminfo) -HUGEPAGESIZE=$(($HUGEPAGESIZE * 1024)) +HUGEPAGESIZE=$((${HUGEPAGESIZE:-0} * 1024)) MEMORY_RESULT="$CPUSET_TMP/memory_result" --2.41.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Patch merged, thanks!
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp