diff options
author | Theodore Ts'o <tytso@mit.edu> | 2003-03-06 11:09:18 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2003-03-06 11:09:18 -0500 |
commit | ed78c021c3b111d8ab9a51aef5d5156e3004083f (patch) | |
tree | 8d9e92fb9a9bdb535ed06e67bc8981f63e56d67f /tests | |
parent | 94ba8c750604d8d2487841a06cb930dd5f3bb43b (diff) | |
download | e2fsprogs-ed78c021c3b111d8ab9a51aef5d5156e3004083f.tar.gz |
Fix up lots of portability problems that caused e2fsprogs not to build successfully
under Solaris.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 8 | ||||
-rw-r--r-- | tests/defaults/e_script | 2 | ||||
-rw-r--r-- | tests/f_swapfs/script | 153 | ||||
-rw-r--r-- | tests/run_e2fsck | 2 |
4 files changed, 86 insertions, 79 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index e6cb884a..e25843d8 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,11 @@ +2003-03-06 Theodore Tso <tytso@mit.edu> + + * run_e2fsck, defaults/e_script: Solaris doesn't support "tr -d \r", + so use "tr -d \015" instead. + + * tests/f_swapfs/script: Avoid bash'ism; Solaris doesn't support + put a ! character in a "if ! cmd ; then .. fi" construct. + 2002-11-09 Theodore Ts'o <tytso@mit.edu> * Release of E2fsprogs 1.32 diff --git a/tests/defaults/e_script b/tests/defaults/e_script index 4f88e23e..3318ae71 100644 --- a/tests/defaults/e_script +++ b/tests/defaults/e_script @@ -29,7 +29,7 @@ else fi cat $SRCDIR/progs/test_data/$instance.setup $SRCDIR/progs/test_data/test.$class \ - | $TEST_PROG -f - 2>&1 | tr -d '\r' > $OUT + | $TEST_PROG -f - 2>&1 | tr -d \\015 > $OUT cmp -s $EXPECT $OUT status=$? diff --git a/tests/f_swapfs/script b/tests/f_swapfs/script index 9d3033da..c41bec7e 100644 --- a/tests/f_swapfs/script +++ b/tests/f_swapfs/script @@ -1,80 +1,79 @@ -if ! $FSCK -SV > /dev/null 2>&1 ; then - rm -f $test_name.ok $test_name.failed - echo "skipped" -else - -IMAGE=$test_dir/image.gz -VERIFY_FSCK_OPT=-yf -SWAP_FSCK_OPT=-Sy -NATIVE_FSCK_OPT=-sy -OUT=$test_name.log -EXP=$test_dir/expect - -gunzip < $IMAGE > $TMPFILE - -echo "Swapfs test" > $OUT - -echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new -$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '2d' $OUT.new >> $OUT - -echo e2fsck $SWAP_FSCK_OPT -N test_filesys > $OUT.new -$FSCK $SWAP_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '2d' $OUT.new >> $OUT - -echo Running debugfs.... >> $OUT -$DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '1d' $OUT.new >> $OUT - -echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new -$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '2d' $OUT.new >> $OUT - -echo e2fsck $NATIVE_FSCK_OPT -N test_filesys > $OUT.new -$FSCK $NATIVE_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '2d' $OUT.new >> $OUT +if $FSCK -SV > /dev/null 2>&1 ; then + IMAGE=$test_dir/image.gz + VERIFY_FSCK_OPT=-yf + SWAP_FSCK_OPT=-Sy + NATIVE_FSCK_OPT=-sy + OUT=$test_name.log + EXP=$test_dir/expect + + gunzip < $IMAGE > $TMPFILE + + echo "Swapfs test" > $OUT + + echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new + $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '2d' $OUT.new >> $OUT + + echo e2fsck $SWAP_FSCK_OPT -N test_filesys > $OUT.new + $FSCK $SWAP_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '2d' $OUT.new >> $OUT + + echo Running debugfs.... >> $OUT + $DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '1d' $OUT.new >> $OUT + + echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new + $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '2d' $OUT.new >> $OUT + + echo e2fsck $NATIVE_FSCK_OPT -N test_filesys > $OUT.new + $FSCK $NATIVE_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '2d' $OUT.new >> $OUT + + echo Running debugfs.... >> $OUT + $DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '1d' $OUT.new >> $OUT + + echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new + $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '2d' $OUT.new >> $OUT + rm -f $OUT.new + + rm $TMPFILE + + # + # Do the verification + # + + rm -f $test_name.ok $test_name.failed + cmp -s $OUT $EXP + status=$? + + if [ "$status" = 0 ] ; then + echo "ok" + touch $test_name.ok + else + echo "failed" + diff -c $EXP $OUT > $test_name.failed + fi + + unset IMAGE VERIFY_FSCK_OPT SWAP_FSCK_OPT NATIVE_FSCK_OPT OUT EXP -echo Running debugfs.... >> $OUT -$DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '1d' $OUT.new >> $OUT - -echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new -$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '2d' $OUT.new >> $OUT -rm -f $OUT.new - -rm $TMPFILE - -# -# Do the verification -# - -rm -f $test_name.ok $test_name.failed -cmp -s $OUT $EXP -status=$? - -if [ "$status" = 0 ] ; then - echo "ok" - touch $test_name.ok else - echo "failed" - diff -c $EXP $OUT > $test_name.failed -fi - -unset IMAGE VERIFY_FSCK_OPT SWAP_FSCK_OPT NATIVE_FSCK_OPT OUT EXP - + rm -f $test_name.ok $test_name.failed + echo "skipped" fi diff --git a/tests/run_e2fsck b/tests/run_e2fsck index 44cc2852..2797ae9a 100644 --- a/tests/run_e2fsck +++ b/tests/run_e2fsck @@ -33,7 +33,7 @@ eval $PREP_CMD $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT1.new 2>&1 status=$? echo Exit status is $status >> $OUT1.new -sed -e '1d' $OUT1.new | sed -e '/^JFS DEBUG:/d' | tr -d '\r' > $OUT1 +sed -e '1d' $OUT1.new | sed -e '/^JFS DEBUG:/d' | tr -d \\015 > $OUT1 rm -f $OUT1.new if [ "$ONE_PASS_ONLY" != "true" ]; then |