Statistics
| Branch: | Revision:

ffmpeg / tests / server-regression.sh @ 1cee4eaf

History | View | Annotate | Download (1.39 KB)

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