Commit | Line | Data |
---|---|---|
2ba45a60 DM |
1 | #!/bin/sh |
2 | ||
3 | #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 | |
4 | #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 | |
5 | ||
6 | . $(dirname $0)/md5.sh | |
7 | ||
8 | FILES=$(sed -n 's/^[^#]*<Stream \(.*\)>.*/\1/p' $2 | grep -v html) | |
9 | ||
10 | rm -f tests/feed1.ffm | |
11 | ./ffserver -d -f "$2" 2> /dev/null & | |
12 | FFSERVER_PID=$! | |
13 | echo "Waiting for feeds to startup..." | |
14 | sleep 2 | |
15 | ( | |
16 | cd tests/data || exit $? | |
17 | rm -f ff-* ffserver.regression | |
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 | |
24 | fi | |
25 | do_md5sum ff-$file >>ffserver.regression | |
26 | done | |
27 | ) | |
28 | kill $FFSERVER_PID | |
29 | wait > /dev/null 2>&1 | |
30 | rm -f tests/feed1.ffm | |
31 | if diff -u "$1" tests/data/ffserver.regression; then | |
32 | echo | |
33 | echo Server regression test succeeded. | |
34 | exit 0 | |
35 | else | |
36 | echo | |
37 | echo Server regression test: Error. | |
38 | exit 1 | |
39 | fi |