selftests/zram: must be run as root

Adding new functionality check_prereqs() to check test must be run as root

Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
This commit is contained in:
Naresh Kamboju
2015-08-31 17:11:55 +05:30
committed by Shuah Khan
parent 9fae100cbd
commit 2dfb28e341
4 changed files with 24 additions and 0 deletions

View File

@@ -20,6 +20,16 @@ dev_mounted=-1
trap INT
check_prereqs()
{
local msg="skip all tests:"
if [ $UID != 0 ]; then
echo $msg must be run as root >&2
exit 0
fi
}
zram_cleanup()
{
echo "zram cleanup"