1#!/bin/bash
2TCID="zram.sh"
3
4. ./zram_lib.sh
5
6run_zram () {
7echo "--------------------"
8echo "running zram tests"
9echo "--------------------"
10./zram01.sh
11echo ""
12./zram02.sh
13}
14
15check_prereqs
16
17# check zram module exists
18MODULE_PATH=/lib/modules/`uname -r`/kernel/drivers/block/zram/zram.ko
19if [ -f $MODULE_PATH ]; then
20	run_zram
21elif [ -b /dev/zram0 ]; then
22	run_zram
23else
24	echo "$TCID : No zram.ko module or /dev/zram0 device file not found"
25	echo "$TCID : CONFIG_ZRAM is not set"
26	exit 1
27fi
28