You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.6KB

  1. #!/bin/sh
  2. # Make sure that the data directory exists
  3. mkdir -p tests/data
  4. #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
  5. #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
  6. FILES=`sed -n 's/^[^#]*<Stream \(.*\)>.*/\1/p' $2 | grep -v html`
  7. rm -f tests/feed1.ffm
  8. ./ffserver -d -f tests/test.conf 2> /dev/null &
  9. FFSERVER_PID=$!
  10. sleep 2
  11. echo "Waiting for feeds to startup..."
  12. ./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 &
  13. FFMPEG_PID=$!
  14. sleep 5
  15. (
  16. cd tests/data || exit $?
  17. rm -f ff-*;
  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 --output-document=- http://localhost:9999/$file > ff-$file
  22. else
  23. wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=20000 > ff-$file 2>/dev/null
  24. fi
  25. MDFILES="$MDFILES ff-$file"
  26. done
  27. wait
  28. # the status page is always different
  29. md5sum $MDFILES > ffserver.regression
  30. )
  31. kill $FFMPEG_PID
  32. kill $FFSERVER_PID
  33. wait > /dev/null 2>&1
  34. rm -f tests/feed1.ffm
  35. if diff -u tests/data/ffserver.regression "$1" ; then
  36. echo
  37. echo Server regression test succeeded.
  38. exit 0
  39. else
  40. echo
  41. echo Server regression test: Error.
  42. exit 1
  43. fi