]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - tests/f_itable_collision/script
Fix 32-bit build and test failures
[thirdparty/e2fsprogs.git] / tests / f_itable_collision / script
CommitLineData
35c8faaf
DW
1#!/bin/bash
2
3# Run this test with a specific time, because we're crosslinking an extent tree
4# block with the inode table. When fsck sets dtime to now, we want "now" to be
5# our preprogrammed value.
6
7FSCK_OPT=-fy
8IMAGE=$test_dir/image.gz
5b599a32 9E2FSCK_TIME=2147483646
35c8faaf
DW
10export E2FSCK_TIME
11
12gzip -d < $IMAGE > $TMPFILE
35c8faaf
DW
13
14# Run fsck to fix things?
15EXP1=$test_dir/expect.1
16OUT1=$test_name.1.log
35c8faaf 17
63a801de 18$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | tail -n +2 > $OUT1
35c8faaf
DW
19echo "Exit status is $?" >> $OUT1
20
21# Run a second time
22EXP2=$test_dir/expect.2
23OUT2=$test_name.2.log
24
63a801de 25$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | tail -n +2 > $OUT2
35c8faaf
DW
26echo "Exit status is $?" >> $OUT2
27
28# Figure out what happened
29if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then
30 echo "$test_name: $test_description: ok"
31 touch $test_name.ok
32else
33 echo "$test_name: $test_description: failed"
34 diff -u $EXP1 $OUT1 >> $test_name.failed
35 diff -u $EXP2 $OUT2 >> $test_name.failed
36fi