summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPo-Hsu Lin <po-hsu.lin@canonical.com>2017-06-27 14:17:13 +0800
committerShuah Khan <shuahkh@osg.samsung.com>2017-06-30 10:06:22 -0600
commit72441ea5886780d04ac96913e02dba9e84ea80e5 (patch)
tree9655d9130211b19c847f6e532e9437fba6fb56b8 /tools
parenta34b28c92ec8c92938de03c18c5fab32efd2e29a (diff)
downloadlinux-72441ea5886780d04ac96913e02dba9e84ea80e5.tar.gz
linux-72441ea5886780d04ac96913e02dba9e84ea80e5.tar.bz2
linux-72441ea5886780d04ac96913e02dba9e84ea80e5.zip
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 <po-hsu.lin@canonical.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/memory-hotplug/mem-on-off-test.sh4
1 files changed, 4 insertions, 0 deletions
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