Naresh Kamboju | f21fb79 | 2015-08-18 12:31:59 +0530 | [diff] [blame] | 1 | #!/bin/bash |
Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame^] | 2 | # SPDX-License-Identifier: GPL-2.0 |
Naresh Kamboju | f21fb79 | 2015-08-18 12:31:59 +0530 | [diff] [blame] | 3 | TCID="zram.sh" |
| 4 | |
Zhang Zhen | 7ef7cc9 | 2015-09-14 12:13:27 +0800 | [diff] [blame] | 5 | . ./zram_lib.sh |
Naresh Kamboju | 2dfb28e | 2015-08-31 17:11:55 +0530 | [diff] [blame] | 6 | |
Naresh Kamboju | f21fb79 | 2015-08-18 12:31:59 +0530 | [diff] [blame] | 7 | run_zram () { |
| 8 | echo "--------------------" |
| 9 | echo "running zram tests" |
| 10 | echo "--------------------" |
| 11 | ./zram01.sh |
| 12 | echo "" |
| 13 | ./zram02.sh |
| 14 | } |
| 15 | |
Naresh Kamboju | 2dfb28e | 2015-08-31 17:11:55 +0530 | [diff] [blame] | 16 | check_prereqs |
| 17 | |
Naresh Kamboju | f21fb79 | 2015-08-18 12:31:59 +0530 | [diff] [blame] | 18 | # check zram module exists |
| 19 | MODULE_PATH=/lib/modules/`uname -r`/kernel/drivers/block/zram/zram.ko |
| 20 | if [ -f $MODULE_PATH ]; then |
| 21 | run_zram |
| 22 | elif [ -b /dev/zram0 ]; then |
| 23 | run_zram |
| 24 | else |
| 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 |
| 28 | fi |