Permalink
Browse files

Testing

  • Loading branch information...
1 parent ff0186f commit d9da0062880168ec611544517aa63299ac5cfdd2 Peter B Clements committed May 26, 2003
Showing with 136 additions and 0 deletions.
  1. +6 −0 posttest
  2. +20 −0 pretest
  3. +17 −0 test1
  4. +17 −0 test2
  5. +19 −0 test3
  6. +19 −0 test4
  7. +17 −0 test5
  8. +21 −0 test6
View
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+rm -rf testdir
+
+exit 77;
+
View
@@ -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;
View
@@ -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;
+
View
@@ -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;
+
View
@@ -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;
+
View
@@ -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;
+
View
@@ -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;
+
View
@@ -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;
+

0 comments on commit d9da006

Please sign in to comment.