aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/zram (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-09-20selftests/zram: replace ZRAM_LZ4_COMPRESSFabian Frederick1-1/+1
Since commit ce1ed9f98e88 ("zram: delete custom lzo/lz4") we need CONFIG_CRYPTO_LZ4=y instead of CONFIG_ZRAM_LZ4_COMPRESS Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-02-25selftests: create test-specific kconfig fragmentsBamvor Jian Zhang1-0/+2
Create the config file in each directory of testcase which need more kernel configuration than the default defconfig. User could use these configs with merge_config.sh script: Enable config for specific testcase: (export ARCH=xxx #for cross compiling) ./scripts/kconfig/merge_config.sh .config \ tools/testing/selftests/xxx/config Enable configs for all testcases: (export ARCH=xxx #for cross compiling) ./scripts/kconfig/merge_config.sh .config \ tools/testing/selftests/*/config Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-09-14seltests/zram: fix syntax errorZhang Zhen2-10/+3
Not all shells define a variable UID. This is a bash and zsh feature only. In other shells, the UID variable is not defined, so here test command expands to [ != 0 ] which is a syntax error. Without this patch: root@HGH1000007090:/opt/work/linux/tools/testing/selftests/zram# sh zram.sh zram.sh: 8: [: !=: unexpected operator zram.sh : No zram.ko module or /dev/zram0 device file not found zram.sh : CONFIG_ZRAM is not set With this patch: root@HGH1000007090:/opt/work/linux/tools/testing/selftests/zram# sh ./zram.sh zram.sh : No zram.ko module or /dev/zram0 device file not found zram.sh : CONFIG_ZRAM is not set Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-09-01selftests/zram: Makefile fixNaresh Kamboju1-3/+0
Do not override run_tests, The default rule will just run TEST_PROGS Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org> Acked-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-09-01selftests/zram: must be run as rootNaresh Kamboju4-0/+24
Adding new functionality check_prereqs() to check test must be run as root Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-08-27selftests/zram: Adding zram testsNaresh Kamboju6-0/+448
zram: Compressed RAM based block devices ---------------------------------------- The zram module creates RAM based block devices named /dev/zram<id> (<id> = 0, 1, ...). Pages written to these disks are compressed and stored in memory itself. These disks allow very fast I/O and compression provides good amounts of memory savings. Some of the usecases include /tmp storage, use as swap disks, various caches under /var and maybe many more :) Statistics for individual zram devices are exported through sysfs nodes at /sys/block/zram<id>/ This patch is to validate the zram functionality. Test interacts with block device /dev/zram<id> and sysfs nodes /sys/block/zram<id>/ zram.sh: sanity check of CONFIG_ZRAM and to run zram01 and zram02 tests zram01.sh: creates general purpose ram disks with different filesystems zram02.sh: creates block device for swap zram_lib.sh: create library with initialization/cleanup functions README: ZRAM introduction and Kconfig required. Makefile: To run zram tests zram test output ----------------- ./zram.sh -------------------- running zram tests -------------------- /dev/zram0 device file found: OK set max_comp_streams to zram device(s) /sys/block/zram0/max_comp_streams = '2' (1/1) zram max streams: OK test that we can set compression algorithm supported algs: [lzo] lz4 /sys/block/zram0/comp_algorithm = 'lzo' (1/1) zram set compression algorithm: OK set disk size to zram device(s) /sys/block/zram0/disksize = '2097152' (1/1) zram set disksizes: OK set memory limit to zram device(s) /sys/block/zram0/mem_limit = '2M' (1/1) zram set memory limit: OK make ext4 filesystem on /dev/zram0 zram mkfs.ext4: OK mount /dev/zram0 zram mount of zram device(s): OK fill zram0... zram0 can be filled with '1932' KB zram used 3M, zram disk sizes 2097152M zram compression ratio: 699050.66:1: OK zram cleanup zram01 : [PASS] /dev/zram0 device file found: OK set max_comp_streams to zram device(s) /sys/block/zram0/max_comp_streams = '2' (1/1) zram max streams: OK set disk size to zram device(s) /sys/block/zram0/disksize = '1048576' (1/1) zram set disksizes: OK set memory limit to zram device(s) /sys/block/zram0/mem_limit = '1M' (1/1) zram set memory limit: OK make swap with zram device(s) done with /dev/zram0 zram making zram mkswap and swapon: OK zram swapoff: OK zram cleanup zram02 : [PASS] CC: Shuah Khan <shuahkh@osg.samsung.com> CC: Tyler Baker <tyler.baker@linaro.org> CC: Milosz Wasilewski <milosz.wasilewski@linaro.org> CC: Alexey Kodanev <alexey.kodanev@oracle.com> Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com> Reviewed-By: Tyler Baker <tyler.baker@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>