]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - tests/m_roottar/script
mke2fs: the -d option can now handle tarball input
[thirdparty/e2fsprogs.git] / tests / m_roottar / script
CommitLineData
7e3a4f0a
JSMR
1# vim: filetype=sh
2
3test_description="create fs image from tarball"
4if ! test -x "$DEBUGFS_EXE"; then
5 echo "$test_name: $test_description: skipped (no debugfs)"
6 return 0
7fi
8if [ "$(grep -c 'define HAVE_ARCHIVE_H' ../lib/config.h)" -eq 0 ]; then
9 echo "$test_name: skipped (no libarchive)"
10 exit 0
11fi
12
13OUT="$test_name.log"
14EXP="$test_dir/expect"
15
16perl "$test_dir/mktar.pl" \
17 | $MKE2FS -q -F -o Linux -T ext4 -O metadata_csum,64bit -E lazy_itable_init=1 -b 1024 -d - "$TMPFILE" 16384 > "$OUT" 2>&1
18
19$DUMPE2FS "$TMPFILE" >> "$OUT" 2>&1
20cat > "$TMPFILE.cmd" << 'ENDL'
21stat /dev/
22stat /dev/console
23stat /dev/fd
24stat /dev/full
25stat /dev/null
26stat /dev/ptmx
27stat /dev/pts/
28stat /dev/random
29stat /dev/shm/
30stat /dev/stderr
31stat /dev/stdin
32stat /dev/stdout
33stat /dev/tty
34stat /dev/urandom
35stat /dev/zero
36ENDL
37$DEBUGFS -f "$TMPFILE.cmd" "$TMPFILE" 2>&1 | grep -E -v "(time|checksum):" >> "$OUT"
38
39$FSCK -f -n "$TMPFILE" >> "$OUT" 2>&1
40
41sed -f "$cmd_dir/filter.sed" -f "$test_dir/output.sed" -e "s;$TMPFILE;test.img;" < "$OUT" > "$OUT.tmp"
42mv "$OUT.tmp" "$OUT"
43
44# Do the verification
45cmp -s "$OUT" "$EXP"
46status=$?
47
48if [ "$status" = 0 ] ; then
49 echo "$test_name: $test_description: ok"
50 touch "$test_name.ok"
51else
52 echo "$test_name: $test_description: failed"
53 diff $DIFF_OPTS "$EXP" "$OUT" > "$test_name.failed"
54fi
55
56rm -rf "$TMPFILE.cmd"
57unset OUT EXP