From 72441ea5886780d04ac96913e02dba9e84ea80e5 Mon Sep 17 00:00:00 2001 From: Po-Hsu Lin Date: Tue, 27 Jun 2017 14:17:13 +0800 Subject: 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 --- tools/testing/selftests/memory-hotplug/mem-on-off-test.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/testing/selftests/memory-hotplug/mem-on-off-test.sh') 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 -- cgit v1.2.3-59-g8ed1b