-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Peter B Clements
committed
May 26, 2003
1 parent
ff0186f
commit d9da006
Showing
8 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
rm -rf testdir | ||
|
||
exit 77; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
rm -f test*.log | ||
rm -rf testdir | ||
mkdir testdir && cd testdir || { echo "ERROR: Could not change to test directory" ; exit 1; } >&2 | ||
|
||
gunzip -c ../$srcdir/testdata.tar.gz | tar xf - || { echo "ERROR: Could not extra test files" ; exit 1; } >&2 | ||
|
||
cp test-0.data test-0.data.orig | ||
cp test-1.data test-1.data.orig | ||
cp test-2.data test-2.data.orig | ||
cp test-3.data test-3.data.orig | ||
cp test-4.data test-4.data.orig | ||
cp test-5.data test-5.data.orig | ||
cp test-6.data test-6.data.orig | ||
cp test-7.data test-7.data.orig | ||
cp test-8.data test-8.data.orig | ||
cp test-9.data test-9.data.orig | ||
|
||
exit 77; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
cd testdir || { echo "ERROR: Could not change to test directory" ; exit 1; } >&2 | ||
|
||
banner="Verifying using PAR 1.0 data" | ||
dashes=`echo "$banner" | sed s/./-/g` | ||
|
||
echo $dashes | ||
echo $banner | ||
echo $dashes | ||
|
||
../par2 v testdata.par > ../test1.log || { echo "ERROR: Initial PAR 1.0 verification failed" ; exit 1; } >&2 | ||
|
||
rm -f ../test1.log | ||
|
||
exit 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
cd testdir || { echo "ERROR: Could not change to test directory" ; exit 1; } >&2 | ||
|
||
banner="Verifying using PAR 2.0 data" | ||
dashes=`echo "$banner" | sed s/./-/g` | ||
|
||
echo $dashes | ||
echo $banner | ||
echo $dashes | ||
|
||
../par2 v testdata.par2 > ../test2.log || { echo "ERROR: Initial PAR 2.0 verification failed" ; exit 1; } >&2 | ||
|
||
rm -f ../test2.log | ||
|
||
exit 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
cd testdir || { echo "ERROR: Could not change to test directory" ; exit 1; } >&2 | ||
|
||
banner="Repairing two files using PAR 1.0 data" | ||
dashes=`echo "$banner" | sed s/./-/g` | ||
|
||
echo $dashes | ||
echo $banner | ||
echo $dashes | ||
|
||
rm -f test-1.data test-3.data | ||
../par2 r testdata.par > ../test3.log || { echo "ERROR: Reconstruction of two files using PAR 1.0 failed" ; exit 1; } >&2 | ||
cmp -s test-1.data test-1.data.orig && cmp -s test-3.data test-3.data.orig || { echo "ERROR: Repaired files do not match originals" ; exit 1; } >&2 | ||
|
||
rm -f ../test3.log | ||
|
||
exit 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
cd testdir || { echo "ERROR: Could not change to test directory" ; exit 1; } >&2 | ||
|
||
banner="Repairing two files using PAR 2.0 data" | ||
dashes=`echo "$banner" | sed s/./-/g` | ||
|
||
echo $dashes | ||
echo $banner | ||
echo $dashes | ||
|
||
rm -f test-1.data test-3.data | ||
../par2 r testdata.par2 > ../test4.log || { echo "ERROR: Reconstruction of two files using PAR 2.0 failed" ; exit 1; } >&2 | ||
cmp -s test-1.data test-1.data.orig && cmp -s test-3.data test-3.data.orig || { echo "ERROR: Repaired files do not match originals" ; exit 1; } >&2 | ||
|
||
rm -f ../test4.log | ||
|
||
exit 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
cd testdir || { echo "ERROR: Could not change to test directory" ; exit 1; } >&2 | ||
|
||
banner="Creating 100% PAR 2.0 recovery data" | ||
dashes=`echo "$banner" | sed s/./-/g` | ||
|
||
echo $dashes | ||
echo $banner | ||
echo $dashes | ||
|
||
../par2 c -r100 -b190 newtest test-*.data > ../test5.log || { echo "ERROR: Creating PAR 2.0 data failed" ; exit 1; } >&2 | ||
|
||
rm -f ../test5.log | ||
|
||
exit 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
cd testdir || { echo "ERROR: Could not change to test directory" ; exit 1; } >&2 | ||
|
||
banner="Repairing 100% loss using PAR 2.0 data" | ||
dashes=`echo "$banner" | sed s/./-/g` | ||
|
||
echo $dashes | ||
echo $banner | ||
echo $dashes | ||
|
||
rm -f test-*.data | ||
|
||
../par2 r newtest > ../test6.log || { echo "ERROR: Full Repair using PAR 2.0 failed" ; exit 1; } >&2 | ||
|
||
cmp -s test-0.data test-0.data.orig && cmp -s test-1.data test-1.data.orig && cmp -s test-2.data test-2.data.orig && cmp -s test-3.data test-3.data.orig && cmp -s test-4.data test-4.data.orig && cmp -s test-5.data test-5.data.orig && cmp -s test-6.data test-6.data.orig && cmp -s test-7.data test-7.data.orig && cmp -s test-8.data test-8.data.orig && cmp -s test-9.data test-9.data.orig || { echo "ERROR: Repaired files do not match originals" ; exit 1 ; } >&2 | ||
|
||
rm -f ../test6.log | ||
|
||
exit 0; | ||
|