seltests/zram: fix syntax error
authorZhang Zhen <zhenzhang.zhang@huawei.com>
Mon, 14 Sep 2015 04:13:27 +0000 (12:13 +0800)
committerShuah Khan <shuahkh@osg.samsung.com>
Mon, 14 Sep 2015 22:40:57 +0000 (16:40 -0600)
commit7ef7cc9fdf9853b3027c55b9481991695ad5e5b2
tree6a2c096cc22bad4058467118cbe6e7033f4b7629
parent6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f
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>
tools/testing/selftests/zram/zram.sh
tools/testing/selftests/zram/zram_lib.sh
This page took 0.026217 seconds and 5 git commands to generate.