ffserver-regression.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/sh
  2. #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/ffserver.conf
  3. #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/ffserver.conf
  4. . $(dirname $0)/md5.sh
  5. FILES=$(sed -n 's/^[^#]*<Stream \(.*\)>.*/\1/p' $2 | grep -v html)
  6. rm -f tests/feed1.ffm
  7. ./ffserver -d -f "$2" 2> /dev/null &
  8. FFSERVER_PID=$!
  9. echo "Waiting for feeds to startup..."
  10. sleep 2
  11. (
  12. cd tests/data || exit $?
  13. rm -f ff-* ffserver.regression
  14. WGET_OPTIONS="--user-agent=NSPlayer -q --proxy=off -e verbose=off -e server_response=off"
  15. for file in $FILES; do
  16. if [ $(expr $file : "a-*") != 0 ]; then
  17. wget $WGET_OPTIONS -O - http://localhost:9999/$file > ff-$file
  18. else
  19. wget $WGET_OPTIONS -O - http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=20000 > ff-$file 2>/dev/null
  20. fi
  21. do_md5sum ff-$file >>ffserver.regression
  22. done
  23. )
  24. kill $FFSERVER_PID
  25. wait > /dev/null 2>&1
  26. rm -f tests/feed1.ffm
  27. if diff -u "$1" tests/data/ffserver.regression; then
  28. echo
  29. echo Server regression test succeeded.
  30. exit 0
  31. else
  32. echo
  33. echo Server regression test: Error.
  34. exit 1
  35. fi