From: Po-Hsu Lin Date: Tue, 27 Jun 2017 06:17:13 +0000 (+0800) Subject: selftests: check percentage range for memory-hotplug test X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=72441ea5886780d04ac96913e02dba9e84ea80e5;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git selftests: check percentage range for memory-hotplug test Check the precentage range for -r flag in memory-hotplug test. Signed-off-by: Po-Hsu Lin Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh index 993ff2bcfc7b..c735ece968f8 100755 --- a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh +++ b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh @@ -136,6 +136,10 @@ while getopts e:hp:r: opt; do ;; r) ratio=$OPTARG + if [ "$ratio" -gt 100 ] || [ "$ratio" -lt 0 ]; then + echo "The percentage should be an integer within 0~100 range" + exit 1 + fi ;; esac done