summaryrefslogtreecommitdiff
path: root/tests/fs/squashfs.ktest
blob: ed53f6147c6417d0c439b418213145ac6a8463bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash

. $(dirname $(readlink -e "${BASH_SOURCE[0]}"))/../test-libs.sh

require-kernel-config MISC_FILESYSTEMS
require-kernel-config SQUASHFS
require-kernel-config SQUASHFS_ZLIB
require-kernel-config SQUASHFS_LZO
require-kernel-config SQUASHFS_LZ4
require-kernel-config SQUASHFS_XZ
require-kernel-config SQUASHFS_ZSTD

config-timeout $(stress_timeout)

config-image /home/kent/squashfs-test-images/file.sqsh
config-image /home/kent/squashfs-test-images/bcachefs-tools.gzip.sqfs
config-image /home/kent/squashfs-test-images/bcachefs-tools.lz4.sqfs
config-image /home/kent/squashfs-test-images/bcachefs-tools.lzo.sqfs
config-image /home/kent/squashfs-test-images/bcachefs-tools.xz.sqfs
config-image /home/kent/squashfs-test-images/bcachefs-tools.zstd.sqfs

case $1 in
    prep)
	for c in gzip lzo lz4 xz zstd lzma; do
	    mksquashfs . bcachefs-tools.$c.sqfs -comp $c
	done
	;;
esac

test_squashfs()
{
    for dev in /dev/vdb; do
	echo "testing image $dev"

	mount -t squashfs $dev /mnt
	find /mnt -type f -print|xargs cat > /dev/null
	umount /mnt
    done
}

main "$@"