]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - tools/testing/selftests/zram/zram.sh
scsi_dh: don't try to load a device handler during async probing
[karo-tx-linux.git] / tools / testing / selftests / zram / zram.sh
1 #!/bin/bash
2 TCID="zram.sh"
3
4 check_prereqs()
5 {
6         local msg="skip all tests:"
7
8         if [ $UID != 0 ]; then
9                 echo $msg must be run as root >&2
10                 exit 0
11         fi
12 }
13
14 run_zram () {
15 echo "--------------------"
16 echo "running zram tests"
17 echo "--------------------"
18 ./zram01.sh
19 echo ""
20 ./zram02.sh
21 }
22
23 check_prereqs
24
25 # check zram module exists
26 MODULE_PATH=/lib/modules/`uname -r`/kernel/drivers/block/zram/zram.ko
27 if [ -f $MODULE_PATH ]; then
28         run_zram
29 elif [ -b /dev/zram0 ]; then
30         run_zram
31 else
32         echo "$TCID : No zram.ko module or /dev/zram0 device file not found"
33         echo "$TCID : CONFIG_ZRAM is not set"
34         exit 1
35 fi