~ubuntu-branches/ubuntu/edgy/e2fsprogs/edgy

« back to all changes in this revision

Viewing changes to tests/f_swapfs/script

  • Committer: Bazaar Package Importer
  • Author(s): Yann Dirson
  • Date: 2002-03-21 23:58:48 UTC
  • Revision ID: james.westby@ubuntu.com-20020321235848-cmmy98hy0nihp922
Tags: upstream-1.27
ImportĀ upstreamĀ versionĀ 1.27

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
IMAGE=$test_dir/image.gz
 
2
VERIFY_FSCK_OPT=-yf
 
3
SWAP_FSCK_OPT=-Sy
 
4
NATIVE_FSCK_OPT=-sy
 
5
OUT=$test_name.log
 
6
EXP=$test_dir/expect
 
7
 
 
8
gunzip < $IMAGE > $TMPFILE
 
9
 
 
10
echo "Swapfs test" > $OUT
 
11
 
 
12
echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
 
13
$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
 
14
status=$?
 
15
echo Exit status is $status >> $OUT.new
 
16
sed -e '2d' $OUT.new >> $OUT
 
17
 
 
18
echo e2fsck $SWAP_FSCK_OPT -N test_filesys > $OUT.new
 
19
$FSCK $SWAP_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
 
20
status=$?
 
21
echo Exit status is $status >> $OUT.new
 
22
sed -e '2d' $OUT.new >> $OUT
 
23
 
 
24
echo Running debugfs.... >> $OUT
 
25
$DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 
 
26
status=$?
 
27
echo Exit status is $status >> $OUT.new
 
28
sed -e '1d' $OUT.new >> $OUT
 
29
 
 
30
echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
 
31
$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
 
32
status=$?
 
33
echo Exit status is $status >> $OUT.new
 
34
sed -e '2d' $OUT.new >> $OUT
 
35
 
 
36
echo e2fsck $NATIVE_FSCK_OPT -N test_filesys > $OUT.new
 
37
$FSCK $NATIVE_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
 
38
status=$?
 
39
echo Exit status is $status >> $OUT.new
 
40
sed -e '2d' $OUT.new >> $OUT
 
41
 
 
42
echo Running debugfs.... >> $OUT
 
43
$DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 
 
44
status=$?
 
45
echo Exit status is $status >> $OUT.new
 
46
sed -e '1d' $OUT.new >> $OUT
 
47
 
 
48
echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
 
49
$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
 
50
status=$?
 
51
echo Exit status is $status >> $OUT.new
 
52
sed -e '2d' $OUT.new >> $OUT
 
53
rm -f $OUT.new
 
54
 
 
55
rm $TMPFILE
 
56
 
 
57
#
 
58
# Do the verification
 
59
#
 
60
 
 
61
rm -f $test_name.ok $test_name.failed
 
62
cmp -s $OUT $EXP
 
63
status=$?
 
64
 
 
65
if [ "$status" = 0 ] ; then
 
66
        echo "ok"
 
67
        touch $test_name.ok
 
68
else
 
69
        echo "failed"
 
70
        diff -c $EXP $OUT > $test_name.failed
 
71
fi
 
72
 
 
73
unset IMAGE VERIFY_FSCK_OPT SWAP_FSCK_OPT NATIVE_FSCK_OPT OUT EXP