Rename server-regression.sh --> ffserver-regression.sh for consistency.
[libav.git] / tests / ffserver-regression.sh
CommitLineData
2d83fe90 1#!/bin/sh
115329f1 2
d746f928 3# Make sure that the data directory exists
4fbd52f0 4mkdir -p tests/data
d746f928 5
688a4773
DB
6#perl -e 'chomp($wd = `pwd`); print map { s!tests/data/!!; "<Stream $_>\nFile $wd/tests/data/$_\n</Stream>\n\n" } @ARGV' tests/data/a* >> tests/data/ffserver.conf
7#perl -e 'chomp($wd = `pwd`); print map { s!tests/data/!!; "<Stream $_.asf>\nFile $wd/tests/data/$_\n</Stream>\n\n" } @ARGV' tests/data/a* >> tests/data/ffserver.conf
d746f928 8
46076a95 9FILES=`sed -n 's/^[^#]*<Stream \(.*\)>.*/\1/p' $2 | grep -v html`
e2b2851e 10
4fbd52f0 11rm -f tests/feed1.ffm
968ae1d9 12./ffserver -d -f "$2" 2> /dev/null &
e2b2851e 13FFSERVER_PID=$!
508826f9 14echo "Waiting for feeds to startup..."
626932fd 15sleep 2
e2b2851e 16(
4fbd52f0 17 cd tests/data || exit $?
d746f928 18 rm -f ff-*;
bf40937b 19 WGET_OPTIONS="--user-agent=NSPlayer -q --proxy=off -e verbose=off -e server_response=off"
e2b2851e 20 for file in $FILES; do
d315ec5c 21 if [ `expr $file : "a-*"` != 0 ]; then
fd83ad7f 22 wget $WGET_OPTIONS -O - http://localhost:9999/$file > ff-$file
d746f928 23 else
fd83ad7f 24 wget $WGET_OPTIONS -O - http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=20000 > ff-$file 2>/dev/null
d746f928
PG
25 fi
26 MDFILES="$MDFILES ff-$file"
115329f1 27 done
e2b2851e
PG
28 wait
29 # the status page is always different
927e193d 30 md5sum $MDFILES > ffserver.regression
e2b2851e
PG
31)
32kill $FFSERVER_PID
33wait > /dev/null 2>&1
4fbd52f0 34rm -f tests/feed1.ffm
989bbe62 35if diff -u tests/data/ffserver.regression "$1" ; then
115329f1 36 echo
e2b2851e
PG
37 echo Server regression test succeeded.
38 exit 0
39else
115329f1 40 echo
e2b2851e
PG
41 echo Server regression test: Error.
42 exit 1
43fi