File: script

package info (click to toggle)
e2fsprogs 1.47.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 43,236 kB
  • sloc: ansic: 134,194; sh: 7,343; makefile: 5,324; awk: 524; perl: 376; cpp: 207; sed: 186; python: 23
file content (36 lines) | stat: -rwxr-xr-x 873 bytes parent folder | download | duplicates (6)
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

if ! test -x $DEBUGFS_EXE; then
	echo "$test_name: $test_description: skipped (no debugfs)"
	return 0
fi
FSCK_OPT=-fy
IMAGE=$test_dir/image.gz

gzip -d < $IMAGE > $TMPFILE
#e2label $TMPFILE test_filesys

# Run fsck to fix things?
EXP=$test_dir/expect
OUT=$test_name.log

$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
echo "Exit status is $?" >> $OUT.new

echo "debugfs cat uninit file" >> $OUT.new
echo "ex /a" > $TMPFILE.cmd
echo "cat /a" >> $TMPFILE.cmd
$DEBUGFS -w -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1
echo >> $OUT.new
sed -f $cmd_dir/filter.sed < $OUT.new > $OUT
rm -f $OUT.new $TMPFILE $TMPFILE.cmd

# Figure out what happened
if cmp -s $EXP $OUT; then
	echo "$test_name: $test_description: ok"
	touch $test_name.ok
else
	echo "$test_name: $test_description: failed"
	diff -u $EXP $OUT >> $test_name.failed
fi
unset EXP OUT FSCK_OPT IMAGE