Statistics
| Branch: | Revision:

ffmpeg / tests / server-regression.sh @ a98d3e82

History | View | Annotate | Download (1.54 KB)

1 e2b2851e Philip Gladstone
#!/bin/bash
2 8c0ff5d5 Roman Shaposhnik
# 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 115329f1 Diego Biurrun
10 d746f928 Philip Gladstone
# Make sure that the data directory exists
11
mkdir -p data
12
13 8ff7d1ad Fabrice Bellard
cp "$2" data/test.conf
14 2853e85c Fabrice Bellard
#perl -e 'chomp($wd = `pwd`); print map { s!data/!!; "<Stream $_>\nFile $wd/data/$_\n</Stream>\n\n" } @ARGV' data/a* >> data/test.conf
15
#perl -e 'chomp($wd = `pwd`); print map { s!data/!!; "<Stream $_.asf>\nFile $wd/data/$_\n</Stream>\n\n" } @ARGV' data/a* >> data/test.conf
16 d746f928 Philip Gladstone
17 59f45163 Aurelien Jacobs
FILES=`sed -n 's/^[^#]*<Stream \(.*\)>.*/\1/p' data/test.conf | grep -v html`
18 e2b2851e Philip Gladstone
19
rm -f /tmp/feed.ffm
20 d746f928 Philip Gladstone
../ffserver -d -f data/test.conf 2> /dev/null &
21 e2b2851e Philip Gladstone
FFSERVER_PID=$!
22 d746f928 Philip Gladstone
echo "Waiting for feeds to startup..."
23
sleep 2
24 e2b2851e Philip Gladstone
(
25 d746f928 Philip Gladstone
    cd data || exit $?
26
    rm -f ff-*;
27 bf40937b Alex Beregszaszi
    WGET_OPTIONS="--user-agent=NSPlayer -q --proxy=off -e verbose=off -e server_response=off"
28 e2b2851e Philip Gladstone
    for file in $FILES; do
29 d315ec5c Diego Biurrun
        if [ `expr $file : "a-*"` != 0 ]; then
30 d746f928 Philip Gladstone
            wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file > ff-$file &
31
        else
32 8c0ff5d5 Roman Shaposhnik
            wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=100000 > ff-$file 2>/dev/null &
33 d746f928 Philip Gladstone
        fi
34
        MDFILES="$MDFILES ff-$file"
35 115329f1 Diego Biurrun
    done
36 e2b2851e Philip Gladstone
    wait
37
    # the status page is always different
38 927e193d Aurelien Jacobs
    md5sum $MDFILES > ffserver.regression
39 e2b2851e Philip Gladstone
)
40
kill $FFSERVER_PID
41
wait > /dev/null 2>&1
42 997baf01 Måns Rullgård
if $diff_cmd data/ffserver.regression "$1" ; then
43 115329f1 Diego Biurrun
    echo
44 e2b2851e Philip Gladstone
    echo Server regression test succeeded.
45
    exit 0
46
else
47 115329f1 Diego Biurrun
    echo
48 e2b2851e Philip Gladstone
    echo Server regression test: Error.
49
    exit 1
50
fi