Added example test script with sanitized test data
This commit is contained in:
Родитель
98e247a665
Коммит
f6197f5f4c
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Number of rows counted
|
||||
rows=0;
|
||||
|
||||
# Read stdin line by line
|
||||
while read -r line; do
|
||||
|
||||
# Skip empty-lines, last line may be empty
|
||||
if [ "$line" == "" ]; then
|
||||
continue;
|
||||
fi;
|
||||
|
||||
# Split input
|
||||
prefix=`echo "$line" | cut -f 1`;
|
||||
path=`echo "$line" | cut -f 2`;
|
||||
|
||||
# Count number of rows
|
||||
new_rows=`xz -dc $path | wc -l`;
|
||||
rows=$(($rows + $new_rows));
|
||||
|
||||
# Delete input file
|
||||
rm $path;
|
||||
done;
|
||||
|
||||
# Output aggregated values to files in folder provided as first argument
|
||||
echo "$rows" > $1/rows_counted.txt;
|
|
@ -0,0 +1,2 @@
|
|||
saved_session/Firefox/nightly/22.0a1/20130226031002.20131011.v2.log.e28a4032eb744f089a1828ac7399e5d8.lzma input/ss-ff-n-22.lzma
|
||||
saved_session/Firefox/nightly/28.0a1/20131029030201.20131029.v2.log.0ab8723b6fb3455bb34b04d97482fda2.lzma input/ss-ff-n-28.lzma
|
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# This tests a processor, and takes a processor job_bundle as input argument
|
||||
# that is a tarball containing a script called `processor` which is to be given
|
||||
# files as input and output results into a single file
|
||||
|
||||
echo "### Setting up test environment";
|
||||
|
||||
# Create test-folders
|
||||
mkdir -p test-folder/input;
|
||||
mkdir -p test-folder/output;
|
||||
|
||||
# Copy in job_bundle
|
||||
cp $1 test-folder/job_bundle.tar.gz
|
||||
|
||||
# Copy in test files
|
||||
cp $DIR/ss-ff-n-22.lzma test-folder/input/ss-ff-n-22.lzma
|
||||
cp $DIR/ss-ff-n-28.lzma test-folder/input/ss-ff-n-28.lzma
|
||||
|
||||
# Extract job_bundle
|
||||
cd test-folder;
|
||||
tar -xzf job_bundle.tar.gz;
|
||||
|
||||
# Run tests
|
||||
echo "### Running processor";
|
||||
cat $DIR//input.txt | ./processor output/;
|
||||
|
||||
echo "### Files produced";
|
||||
find output/;
|
||||
|
||||
if [ `ls input/ | wc -l` -ne "0" ]; then
|
||||
echo "### WARNING";
|
||||
echo "Input files where not deleted, please do this as they are consumed.";
|
||||
fi;
|
Загрузка…
Ссылка в новой задаче