Remove useless intermediate var
[FFMpeg-mirror/DVCPRO-HD.git] / tests / server-regression.sh
blobdfb9ed4c68007dab05efd3d9ef3a350f1cc3e71a
1 #!/bin/sh
3 # Make sure that the data directory exists
4 mkdir -p tests/data
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/test.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/test.conf
9 FILES=`sed -n 's/^[^#]*<Stream \(.*\)>.*/\1/p' $2 | grep -v html`
11 rm -f tests/feed1.ffm
12 ./ffserver -d -f tests/test.conf 2> /dev/null &
13 FFSERVER_PID=$!
14 echo "Waiting for feeds to startup..."
16 cd tests/data || exit $?
17 rm -f ff-*;
18 WGET_OPTIONS="--user-agent=NSPlayer -q --proxy=off -e verbose=off -e server_response=off"
19 for file in $FILES; do
20 if [ `expr $file : "a-*"` != 0 ]; then
21 wget $WGET_OPTIONS -O - http://localhost:9999/$file > ff-$file
22 else
23 wget $WGET_OPTIONS -O - http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=20000 > ff-$file 2>/dev/null
25 MDFILES="$MDFILES ff-$file"
26 done
27 wait
28 # the status page is always different
29 md5sum $MDFILES > ffserver.regression
31 kill $FFSERVER_PID
32 wait > /dev/null 2>&1
33 rm -f tests/feed1.ffm
34 if diff -u tests/data/ffserver.regression "$1" ; then
35 echo
36 echo Server regression test succeeded.
37 exit 0
38 else
39 echo
40 echo Server regression test: Error.
41 exit 1