-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tests
51 lines (49 loc) · 2.24 KB
/
Tests
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# if ddrescue changes it's output logfile, ever, this fails.
need ddrescue
run dd if=/dev/urandom bs=10240 count=1024 of=TESTFILE status=noxfer
RUN 0 1024+0 records in@_1024+0 records out
run ddrescue -q TESTFILE TEST.img TEST.log
RUN 0
run sed -e 's/ ddrescue version [^[:space:]]*$//' -e '/^# [^[:space:]]* time: /d' -e '/^# Finished/d' TEST.log
RUN 0 # Rescue Logfile. Created by GNU@_# Command line: ddrescue -q TESTFILE TEST.img TEST.log@_# current_pos@+ current_status@_0x009F0000 @+ @+ +@_#@+ @+ @+ pos@+ @+ @+ @+ size@+ status@_0x00000000@+ 0x00A00000@+ +
run cmp -s TESTFILE TEST.img
RUN 0
run which ddrescue-verify
RUN 0 ../ddrescue-verify
run ddrescue-verify -q TEST.img TEST.log > TEST.verify
RUN 0
run wc -l TEST.verify
RUN 0 13 TEST.verify
run fgrep -v ' 0x100000 ' TEST.verify
RUN 0 # img:@+ TEST.img@_# list: TEST.log@_0x0 +
run ddrescue-verify -q TESTFILE TEST.verify > TEST.ok
RUN 0
run cat TEST.ok
RUN 0 # img:@+ TESTFILE@_# list: TEST.verify@_0x0 +@_0x0 0xa00000 +
run dd if=/dev/zero of=TESTFILE bs=10240 seek=200 count=10 status=noxfer conv=notrunc
RUN 0 10+0 records in@_10+0 records out
run cmp -s TESTFILE TEST.img
RUN 1
run ddrescue-verify -q TESTFILE TEST.verify > TEST.ko 2>TEST.err
RUN 1
run sed 's/=[a-f0-9]*/s=MD5SUM/g' TEST.err
RUN 0 error: TESTFILE at 100000(100000): md5sum mismatch: wanteds=MD5SUM gots=MD5SUM@_error: TESTFILE at 200000(100000): md5sum mismatch: wanteds=MD5SUM gots=MD5SUM
run grep -v '^#' TEST.ko
RUN 0 0x0 +@_0x0 0x100000 +@_0x100000 0x200000 ?@_0x300000 0x700000 +
run ddrescue -q TESTFILE TEST.img TEST.ko
run sed -e 's/ ddrescue version [^[:space:]]*$//' -e '/^# [^[:space:]]* time: /d' -e '/^# Finished/d' TEST.ko
RUN 0 # Rescue Logfile. Created by GNU@_# Command line: ddrescue -q TESTFILE TEST.img TEST.ko@_# current_pos@+ current_status@_0x002F0000 @+ @+ +@_#@+ @+ @+ pos@+ @+ @+ @+ size@+ status@_0x00000000@+ 0x00A00000@+ +
run ddrescue-verify -q TEST.img TEST.ko > TEST.verify2
RUN 0
run wc -l TEST.verify
RUN 0 13 TEST.verify
run fgrep -v ' 0x100000 ' TEST.verify
RUN 0 # img:@+ TEST.img@_# list: TEST.log@_0x0 +
run ddrescue-verify -q TESTFILE TEST.verify2 > TEST.ok2
RUN 0
run cat TEST.ok2
RUN 0 # img:@+ TESTFILE@_# list: TEST.verify2@_0x0 +@_0x0 0xa00000 +
run cmp -s TESTFILE TEST.img
RUN 0
run rm -f TESTFILE TEST.*
RUN 0