File: script

package info (click to toggle)
e2fsprogs 1.47.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 44,040 kB
  • sloc: ansic: 132,791; sh: 7,273; makefile: 5,315; awk: 524; perl: 376; cpp: 207; sed: 186; python: 23
file content (36 lines) | stat: -rwxr-xr-x 933 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash

# Run this test with a specific time, because we're crosslinking an extent tree
# block with the inode table.  When fsck sets dtime to now, we want "now" to be
# our preprogrammed value.

FSCK_OPT=-fy
IMAGE=$test_dir/image.gz
E2FSCK_TIME=2147483646
export E2FSCK_TIME

gzip -d < $IMAGE > $TMPFILE

# Run fsck to fix things?
EXP1=$test_dir/expect.1
OUT1=$test_name.1.log

$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | tail -n +2 > $OUT1
echo "Exit status is $?" >> $OUT1

# Run a second time
EXP2=$test_dir/expect.2
OUT2=$test_name.2.log

$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | tail -n +2 > $OUT2
echo "Exit status is $?" >> $OUT2

# Figure out what happened
if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then
	echo "$test_name: $test_description: ok"
	touch $test_name.ok
else
	echo "$test_name: $test_description: failed"
	diff -u $EXP1 $OUT1 >> $test_name.failed
	diff -u $EXP2 $OUT2 >> $test_name.failed
fi