blob: 232e958ec454756501f2caa8eaf2133067fe10ac [file] [log] [blame]
Naresh Kambojuf21fb792015-08-18 12:31:59 +05301#!/bin/bash
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01002# SPDX-License-Identifier: GPL-2.0
Naresh Kambojuf21fb792015-08-18 12:31:59 +05303TCID="zram.sh"
4
Shuah Khan (Samsung OSG)68581442018-06-14 16:56:13 -06005# Kselftest framework requirement - SKIP code is 4.
6ksft_skip=4
7
Zhang Zhen7ef7cc92015-09-14 12:13:27 +08008. ./zram_lib.sh
Naresh Kamboju2dfb28e2015-08-31 17:11:55 +05309
Naresh Kambojuf21fb792015-08-18 12:31:59 +053010run_zram () {
11echo "--------------------"
12echo "running zram tests"
13echo "--------------------"
14./zram01.sh
15echo ""
16./zram02.sh
17}
18
Naresh Kamboju2dfb28e2015-08-31 17:11:55 +053019check_prereqs
20
Naresh Kambojuf21fb792015-08-18 12:31:59 +053021# check zram module exists
22MODULE_PATH=/lib/modules/`uname -r`/kernel/drivers/block/zram/zram.ko
23if [ -f $MODULE_PATH ]; then
24 run_zram
25elif [ -b /dev/zram0 ]; then
26 run_zram
27else
28 echo "$TCID : No zram.ko module or /dev/zram0 device file not found"
29 echo "$TCID : CONFIG_ZRAM is not set"
Shuah Khan (Samsung OSG)68581442018-06-14 16:56:13 -060030 exit $ksft_skip
Naresh Kambojuf21fb792015-08-18 12:31:59 +053031fi