File: script

package info (click to toggle)
e2fsprogs 1.47.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie, trixie-proposed-updates
  • 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 (34 lines) | stat: -rwxr-xr-x 1,529 bytes parent folder | download | duplicates (5)
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
test_description="mke2fs with offset option (-E offset=N)"
OUT="$test_name.log"

echo "testing mke2fs with -E offset=524288 option (no fssize)" > "$OUT"
yes a | $DD of="$TMPFILE" bs=1k count=2048 iflag=fullblock 2>>"$OUT"
$MKE2FS -F -b 1024 -E offset=524288 "$TMPFILE" >> "$OUT" 2>&1
# compute crc of the first 512 1k blocks
crc_first1=`$DD if="$TMPFILE" bs=1k count=512 2>/dev/null | $CRCSUM`

echo "testing mke2fs with -E offset=524288 option (explicit fssize)" >> "$OUT"
yes a | $DD of="$TMPFILE" bs=1k count=2048 iflag=fullblock 2>>"$OUT"
$MKE2FS -F -b 1024 -E offset=524288 "$TMPFILE" 1024 >> "$OUT" 2>&1
# compute crc of the first and last 512 1k blocks
crc_first2=`$DD if="$TMPFILE" bs=1k count=512 2>/dev/null | $CRCSUM`
crc_last2=`$DD if="$TMPFILE" bs=1k count=512 skip=1536 2>/dev/null | $CRCSUM`
crc_exp=`yes a | $DD bs=1k count=512 2>/dev/null | $CRCSUM`
# a warning should be only emitted by the first mke2fs call
warning=`grep -c "offset specified without an explicit file system size." \
	"$OUT"`

if [ "$warning" -eq 1 -a \
	 "$crc_first1" = "$crc_first2" -a \
	 "$crc_first2" = "$crc_last2" -a \
	 "$crc_first2" = "$crc_exp" ]; then
	echo "$test_name: $test_description: ok"
	touch "$test_name.ok"
else
	echo "$test_name: $test_description: failed"
	echo "warning: $warning" > "$test_name.failed"
	echo "crc_first1: $crc_first1" >> "$test_name.failed"
	echo "crc_first2: $crc_first2" >> "$test_name.failed"
	echo "crc_last2: $crc_last2" >> "$test_name.failed"
	echo "crc_exp: $crc_exp" >> "$test_name.failed"
fi