<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/tools/testing/selftests/zram, branch v4.4.232</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.232</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.232'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2018-08-24T11:26:54Z</updated>
<entry>
<title>selftests: zram: return Kselftest Skip code for skipped tests</title>
<updated>2018-08-24T11:26:54Z</updated>
<author>
<name>Shuah Khan (Samsung OSG)</name>
<email>shuah@kernel.org</email>
</author>
<published>2018-06-14T22:56:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8e54d87ffc5170acfe72b371198ddcb685f88e63'/>
<id>urn:sha1:8e54d87ffc5170acfe72b371198ddcb685f88e63</id>
<content type='text'>
[ Upstream commit 685814466bf8398192cf855415a0bb2cefc1930e ]

When zram test is skipped because of unmet dependencies and/or
unsupported configuration, it exits with error which is treated as
a fail by the Kselftest framework. This leads to false negative result
even when the test could not be run.

Change it to return kselftest skip code when a test gets skipped to
clearly report that the test could not be run.

Kselftest framework SKIP code is 4 and the framework prints appropriate
messages to indicate that the test is skipped.

Signed-off-by: Shuah Khan (Samsung OSG) &lt;shuah@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>seltests/zram: fix syntax error</title>
<updated>2015-09-14T22:40:57Z</updated>
<author>
<name>Zhang Zhen</name>
<email>zhenzhang.zhang@huawei.com</email>
</author>
<published>2015-09-14T04:13:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7ef7cc9fdf9853b3027c55b9481991695ad5e5b2'/>
<id>urn:sha1:7ef7cc9fdf9853b3027c55b9481991695ad5e5b2</id>
<content type='text'>
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 &lt;zhenzhang.zhang@huawei.com&gt;
Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
</content>
</entry>
<entry>
<title>selftests/zram: Makefile fix</title>
<updated>2015-09-01T16:52:25Z</updated>
<author>
<name>Naresh Kamboju</name>
<email>naresh.kamboju@linaro.org</email>
</author>
<published>2015-08-31T11:41:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7eba7d90d48217a97afc171a311b386bde965f39'/>
<id>urn:sha1:7eba7d90d48217a97afc171a311b386bde965f39</id>
<content type='text'>
Do not override run_tests, The default rule will just run TEST_PROGS

Signed-off-by: Naresh Kamboju &lt;naresh.kamboju@linaro.org&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
</content>
</entry>
<entry>
<title>selftests/zram: must be run as root</title>
<updated>2015-09-01T16:51:32Z</updated>
<author>
<name>Naresh Kamboju</name>
<email>naresh.kamboju@linaro.org</email>
</author>
<published>2015-08-31T11:41:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2dfb28e3410d775a687d429f5cadf88e795e7eb6'/>
<id>urn:sha1:2dfb28e3410d775a687d429f5cadf88e795e7eb6</id>
<content type='text'>
Adding new functionality check_prereqs() to check test must be run as root

Signed-off-by: Naresh Kamboju &lt;naresh.kamboju@linaro.org&gt;
Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
</content>
</entry>
<entry>
<title>selftests/zram: Adding zram tests</title>
<updated>2015-08-27T22:02:01Z</updated>
<author>
<name>Naresh Kamboju</name>
<email>naresh.kamboju@linaro.org</email>
</author>
<published>2015-08-18T07:01:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f21fb798fe38cf87b177d45820991f0e315c0ba8'/>
<id>urn:sha1:f21fb798fe38cf87b177d45820991f0e315c0ba8</id>
<content type='text'>
zram: Compressed RAM based block devices
----------------------------------------
The zram module creates RAM based block devices named /dev/zram&lt;id&gt;
(&lt;id&gt; = 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&lt;id&gt;/

This patch is to validate the zram functionality. Test interacts with block
device /dev/zram&lt;id&gt; and sysfs nodes /sys/block/zram&lt;id&gt;/

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 &lt;shuahkh@osg.samsung.com&gt;
CC: Tyler Baker &lt;tyler.baker@linaro.org&gt;
CC: Milosz Wasilewski &lt;milosz.wasilewski@linaro.org&gt;
CC: Alexey Kodanev &lt;alexey.kodanev@oracle.com&gt;
Signed-off-by: Naresh Kamboju &lt;naresh.kamboju@linaro.org&gt;
Signed-off-by: Alexey Kodanev &lt;alexey.kodanev@oracle.com&gt;
Reviewed-By: Tyler Baker &lt;tyler.baker@linaro.org&gt;
Signed-off-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
</content>
</entry>
</feed>
