blob: 754de7da426a80a2ae386042d30a5904b44446e6 [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
Zhang Zhen7ef7cc92015-09-14 12:13:27 +08005. ./zram_lib.sh
Naresh Kamboju2dfb28e2015-08-31 17:11:55 +05306
Naresh Kambojuf21fb792015-08-18 12:31:59 +05307run_zram () {
8echo "--------------------"
9echo "running zram tests"
10echo "--------------------"
11./zram01.sh
12echo ""
13./zram02.sh
14}
15
Naresh Kamboju2dfb28e2015-08-31 17:11:55 +053016check_prereqs
17
Naresh Kambojuf21fb792015-08-18 12:31:59 +053018# check zram module exists
19MODULE_PATH=/lib/modules/`uname -r`/kernel/drivers/block/zram/zram.ko
20if [ -f $MODULE_PATH ]; then
21 run_zram
22elif [ -b /dev/zram0 ]; then
23 run_zram
24else
25 echo "$TCID : No zram.ko module or /dev/zram0 device file not found"
26 echo "$TCID : CONFIG_ZRAM is not set"
27 exit 1
28fi