summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/zram/zram.sh
diff options
context:
space:
mode:
authorZhang Zhen <zhenzhang.zhang@huawei.com>2015-09-14 12:13:27 +0800
committerShuah Khan <shuahkh@osg.samsung.com>2015-09-14 16:40:57 -0600
commit7ef7cc9fdf9853b3027c55b9481991695ad5e5b2 (patch)
tree6a2c096cc22bad4058467118cbe6e7033f4b7629 /tools/testing/selftests/zram/zram.sh
parent6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff)
downloadop-kernel-dev-7ef7cc9fdf9853b3027c55b9481991695ad5e5b2.zip
op-kernel-dev-7ef7cc9fdf9853b3027c55b9481991695ad5e5b2.tar.gz
seltests/zram: fix syntax error
Not all shells define a variable UID. This is a bash and zsh feature only. In other shells, the UID variable is not defined, so here test command expands to [ != 0 ] which is a syntax error. Without this patch: root@HGH1000007090:/opt/work/linux/tools/testing/selftests/zram# sh zram.sh zram.sh: 8: [: !=: unexpected operator zram.sh : No zram.ko module or /dev/zram0 device file not found zram.sh : CONFIG_ZRAM is not set With this patch: root@HGH1000007090:/opt/work/linux/tools/testing/selftests/zram# sh ./zram.sh zram.sh : No zram.ko module or /dev/zram0 device file not found zram.sh : CONFIG_ZRAM is not set Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing/selftests/zram/zram.sh')
-rwxr-xr-xtools/testing/selftests/zram/zram.sh10
1 files changed, 1 insertions, 9 deletions
diff --git a/tools/testing/selftests/zram/zram.sh b/tools/testing/selftests/zram/zram.sh
index 20de9a7..683a292 100755
--- a/tools/testing/selftests/zram/zram.sh
+++ b/tools/testing/selftests/zram/zram.sh
@@ -1,15 +1,7 @@
#!/bin/bash
TCID="zram.sh"
-check_prereqs()
-{
- local msg="skip all tests:"
-
- if [ $UID != 0 ]; then
- echo $msg must be run as root >&2
- exit 0
- fi
-}
+. ./zram_lib.sh
run_zram () {
echo "--------------------"
OpenPOWER on IntegriCloud