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 | |
Shuah Khan (Samsung OSG) | 6858144 | 2018-06-14 16:56:13 -0600 | [diff] [blame] | 5 | # Kselftest framework requirement - SKIP code is 4. |
| 6 | ksft_skip=4 |
| 7 | |
Zhang Zhen | 7ef7cc9 | 2015-09-14 12:13:27 +0800 | [diff] [blame] | 8 | . ./zram_lib.sh |
Naresh Kamboju | 2dfb28e | 2015-08-31 17:11:55 +0530 | [diff] [blame] | 9 | |
Naresh Kamboju | f21fb79 | 2015-08-18 12:31:59 +0530 | [diff] [blame] | 10 | run_zram () { |
| 11 | echo "--------------------" |
| 12 | echo "running zram tests" |
| 13 | echo "--------------------" |
| 14 | ./zram01.sh |
| 15 | echo "" |
| 16 | ./zram02.sh |
| 17 | } |
| 18 | |
Naresh Kamboju | 2dfb28e | 2015-08-31 17:11:55 +0530 | [diff] [blame] | 19 | check_prereqs |
| 20 | |
Naresh Kamboju | f21fb79 | 2015-08-18 12:31:59 +0530 | [diff] [blame] | 21 | # check zram module exists |
| 22 | MODULE_PATH=/lib/modules/`uname -r`/kernel/drivers/block/zram/zram.ko |
| 23 | if [ -f $MODULE_PATH ]; then |
| 24 | run_zram |
| 25 | elif [ -b /dev/zram0 ]; then |
| 26 | run_zram |
| 27 | else |
| 28 | echo "$TCID : No zram.ko module or /dev/zram0 device file not found" |
| 29 | echo "$TCID : CONFIG_ZRAM is not set" |
Shuah Khan (Samsung OSG) | 6858144 | 2018-06-14 16:56:13 -0600 | [diff] [blame] | 30 | exit $ksft_skip |
Naresh Kamboju | f21fb79 | 2015-08-18 12:31:59 +0530 | [diff] [blame] | 31 | fi |