File: filesystem.test

package info (click to toggle)
genimage 16-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 808 kB
  • sloc: ansic: 4,721; sh: 1,006; makefile: 156
file content (68 lines) | stat: -rwxr-xr-x 2,055 bytes parent folder | download | duplicates (2)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
test_description="Filesystem Image Tests"

. "$(dirname "${0}")/test-setup.sh"

check_filelist() {
	test_cmp "${filelist_orig}" "${filelist_test}"
}

exec_test_set_prereq cpio
test_expect_success cpio "cpio" "
	run_genimage_root cpio.config test.cpio &&
	zcat images/test.cpio | cpio --extract -t | grep -v '^\.$'  | sort > '${filelist_test}' &&
	check_size_range images/test.cpio 400 550 &&
	check_filelist
"

exec_test_set_prereq mkcramfs
test_expect_success mkcramfs "cramfs" "
	run_genimage_root cramfs.config test.cramfs &&
	check_size images/test.cramfs 4096
"

exec_test_set_prereq genisoimage
test_expect_success genisoimage "iso" "
	run_genimage_root iso.config test.iso &&
	check_size_range images/test.iso 300000 400000
"

exec_test_set_prereq mkfs.f2fs
exec_test_set_prereq sload.f2fs
exec_test_set_prereq fsck.f2fs
test_expect_success mkfs_f2fs,sload_f2fs,fsck_f2fs "f2fs" "
	run_genimage_root f2fs.config test.f2fs &&
	fsck.f2fs images/test.f2fs
"

exec_test_set_prereq mksquashfs
test_expect_success mksquashfs "squashfs" "
	run_genimage_root squashfs.config test.squashfs &&
	check_size_range images/test.squashfs 4000 4100 &&
	unsquashfs -ls images/test.squashfs  | sed -n '/squashfs-root/s;squashfs-root/;;p' | sort > '${filelist_test}' &&
	check_filelist
"

exec_test_set_prereq tar
test_expect_success tar "tar" "
	run_genimage_root tar.config test.tar.gz &&
	check_size_range images/test.tar.gz 500 600 &&
	zcat images/test.tar.gz | tar -t | sed -n -e 's;/$;;' -e 's;^\./\(..*\)$;\1;p' | sort > '${filelist_test}' &&
	check_filelist
"

exec_test_set_prereq dd
exec_test_set_prereq mkdosfs
exec_test_set_prereq mcopy
test_expect_success dd,mkdosfs,mcopy "vfat" "
	run_genimage_root vfat.config test.vfat &&
	fsck.fat -p images/test.vfat | tee fsck.log &&
	test_must_fail grep -q 'Filesystem was changed' fsck.log &&
	check_size images/test.vfat 4193280 &&
	MTOOLS_SKIP_CHECK=1 mdir -/ -f -b -i images/test.vfat / | sed -e 's;^::/;;' -e 's;/$;;' | sort > '${filelist_test}' &&
	check_filelist
"

test_done

# vim: syntax=sh