]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - tests/m_rootpaxtar/script
mke2fs: the -d option can now handle tarball input
[thirdparty/e2fsprogs.git] / tests / m_rootpaxtar / script
CommitLineData
7e3a4f0a
JSMR
1# vim: filetype=sh
2
3test_description="create fs image from pax tarball with xattrs"
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/mkpaxtar.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 /file
22ea_list /file
23ENDL
24$DEBUGFS -f $TMPFILE.cmd $TMPFILE 2>&1 | egrep -v '^(crtime|Inode checksum):' >> $OUT
25
26$FSCK -f -n $TMPFILE >> $OUT 2>&1
27
28sed -f $cmd_dir/filter.sed -f $test_dir/output.sed -e "s;$TMPFILE;test.img;" < $OUT > $OUT.tmp
29mv $OUT.tmp $OUT
30
31# Do the verification
32cmp -s $OUT $EXP
33status=$?
34
35if [ "$status" = 0 ] ; then
36 echo "$test_name: $test_description: ok"
37 touch $test_name.ok
38else
39 echo "$test_name: $test_description: failed"
40 diff $DIFF_OPTS $EXP $OUT > $test_name.failed
41fi
42
43rm -rf $TMPFILE.cmd
44unset OUT EXP