1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3TCID="zram.sh"
4
5. ./zram_lib.sh
6
7run_zram () {
8echo "--------------------"
9echo "running zram tests"
10echo "--------------------"
11./zram01.sh
12echo ""
13./zram02.sh
14}
15
16check_prereqs
17
18# 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
29