First shot at the ffserver regression tests. All feedback received with
[ffmpeg.git] / tests / server-regression.sh
1 #!/bin/bash
2
3 FILES=`perl -n -e 'print \$1, " " if /<stream\\s+(\\S+)>/i' test.conf`
4
5 rm -f /tmp/feed.ffm
6 ../ffserver -d -f test.conf 2> /dev/null &
7 FFSERVER_PID=$!
8 sleep 1
9 (
10     cd data
11     for file in $FILES; do
12         wget --user-agent=NSPlayer -q --output-document=- http://localhost:9999/$file?date=19700101T000000Z | head --bytes=100000 > $file &
13     done    
14     wait
15     # the status page is always different
16     md5sum $FILES | grep -v html > ffserver.regression
17 )
18 kill $FFSERVER_PID
19 wait > /dev/null 2>&1
20 if diff -u data/ffserver.regression $1 ; then
21     echo 
22     echo Server regression test succeeded.
23     exit 0
24 else
25     echo 
26     echo Server regression test: Error.
27     exit 1
28 fi