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.

44 lines
1.4KB

  1. #!/bin/bash
  2. # Make sure that the data directory exists
  3. mkdir -p data
  4. cp test.conf data/test.conf
  5. perl -e 'chomp($wd = `pwd`); print map { s!data/!!; "<Stream $_>\nFile $wd/data/$_\n</Stream>\n\n" } @ARGV' data/a* >> data/test.conf
  6. perl -e 'chomp($wd = `pwd`); print map { s!data/!!; "<Stream $_.asf>\nFile $wd/data/$_\n</Stream>\n\n" } @ARGV' data/a* >> data/test.conf
  7. FILES=`perl -n -e 'print \$1, " " if /<stream\\s+(\\S+)>/i' data/test.conf`
  8. rm -f /tmp/feed.ffm
  9. ../ffserver -d -f data/test.conf 2> /dev/null &
  10. FFSERVER_PID=$!
  11. echo "Waiting for feeds to startup..."
  12. sleep 2
  13. (
  14. cd data || exit $?
  15. rm -f ff-*;
  16. WGET_OPTIONS="--user-agent=NSPlayer -q --proxy=off -e verbose=off -e debug=off -e server_response=off"
  17. for file in $FILES; do
  18. if [ `expr match $file "a-*"` -ne 0 ]; then
  19. wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file > ff-$file &
  20. else
  21. wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file?date=19700101T000000Z | head --bytes=100000 > ff-$file &
  22. fi
  23. MDFILES="$MDFILES ff-$file"
  24. done
  25. wait
  26. # the status page is always different
  27. md5sum $MDFILES | grep -v html > ffserver.regression
  28. )
  29. kill $FFSERVER_PID
  30. wait > /dev/null 2>&1
  31. if diff -u data/ffserver.regression $1 ; then
  32. echo
  33. echo Server regression test succeeded.
  34. exit 0
  35. else
  36. echo
  37. echo Server regression test: Error.
  38. exit 1
  39. fi