Statistics
| Branch: | Revision:

ffmpeg / tests / server-regression.sh @ 6b8bcd3e

History | View | Annotate | Download (1.77 KB)

1
#!/bin/bash
2
# Even in the 21st century some diffs are not supporting -u.
3
diff -u $0 $0 > /dev/null 2>&1
4
if [ $? -eq 0 ]; then
5
  diff_cmd="diff -u"
6
else
7
  diff_cmd="diff"
8
fi
9

    
10
# Make sure that the data directory exists
11
mkdir -p tests/data
12

    
13
#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
14
#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
15

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

    
18
rm -f tests/feed1.ffm
19
./ffserver -d -f tests/test.conf 2> /dev/null &
20
FFSERVER_PID=$!
21
sleep 2
22
echo "Waiting for feeds to startup..."
23
./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 &
24
FFMPEG_PID=$!
25
sleep 5
26
(
27
    cd tests/data || exit $?
28
    rm -f ff-*;
29
    WGET_OPTIONS="--user-agent=NSPlayer -q --proxy=off -e verbose=off -e server_response=off"
30
    for file in $FILES; do
31
        if [ `expr $file : "a-*"` != 0 ]; then
32
            wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file > ff-$file
33
        else
34
            wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=20000 > ff-$file 2>/dev/null
35
        fi
36
        MDFILES="$MDFILES ff-$file"
37
    done
38
    wait
39
    # the status page is always different
40
    md5sum $MDFILES > ffserver.regression
41
)
42
kill $FFMPEG_PID
43
kill $FFSERVER_PID
44
wait > /dev/null 2>&1
45
rm -f tests/feed1.ffm
46
if $diff_cmd tests/data/ffserver.regression "$1" ; then
47
    echo
48
    echo Server regression test succeeded.
49
    exit 0
50
else
51
    echo
52
    echo Server regression test: Error.
53
    exit 1
54
fi