]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
selftests: check percentage range for memory-hotplug test
authorPo-Hsu Lin <po-hsu.lin@canonical.com>
Thu, 10 Aug 2017 06:32:00 +0000 (08:32 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 24 Aug 2017 16:34:47 +0000 (18:34 +0200)
BugLink: http://bugs.launchpad.net/bugs/1710868
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>
(cherry picked from commit 72441ea5886780d04ac96913e02dba9e84ea80e5)
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
tools/testing/selftests/memory-hotplug/mem-on-off-test.sh

index 993ff2bcfc7b9d0910403eadebe77b2022288449..c735ece968f862805ad26df1d1c7772c40059811 100755 (executable)
@@ -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