Statistics
| Branch: | Revision:

ffmpeg / tests / server-regression.sh @ 38baa83c

History | View | Annotate | Download (1.6 KB)

1
#!/bin/sh
2

    
3
# Make sure that the data directory exists
4
mkdir -p tests/data
5

    
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
8

    
9
FILES=`sed -n 's/^[^#]*<Stream \(.*\)>.*/\1/p' $2 | grep -v html`
10

    
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..."
15
./ffmpeg -loop_input -flags +bitexact -dct fastint -idct simple -y -f pgmyuv -i tests/vsynth1/%02d.pgm http://localhost:9999/feed1.ffm 2> /dev/null &
16
FFMPEG_PID=$!
17
(
18
    cd tests/data || exit $?
19
    rm -f ff-*;
20
    WGET_OPTIONS="--user-agent=NSPlayer -q --proxy=off -e verbose=off -e server_response=off"
21
    for file in $FILES; do
22
        if [ `expr $file : "a-*"` != 0 ]; then
23
            wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file > ff-$file
24
        else
25
            wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=20000 > ff-$file 2>/dev/null
26
        fi
27
        MDFILES="$MDFILES ff-$file"
28
    done
29
    wait
30
    # the status page is always different
31
    md5sum $MDFILES > ffserver.regression
32
)
33
kill $FFMPEG_PID
34
kill $FFSERVER_PID
35
wait > /dev/null 2>&1
36
rm -f tests/feed1.ffm
37
if diff -u tests/data/ffserver.regression "$1" ; then
38
    echo
39
    echo Server regression test succeeded.
40
    exit 0
41
else
42
    echo
43
    echo Server regression test: Error.
44
    exit 1
45
fi