Skip to content
Snippets Groups Projects
Commit d7e88eca authored by Guillaume Desmottes's avatar Guillaume Desmottes
Browse files

gstreamer-buffering: display simple-httpd logs if test is failing


Hopefully this should help debugging T2504 by telling us what's going on
in the http server.

Need to run the test with DEBUG=2 to have these extra debug info.

Signed-off-by: default avatarGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Reviewed-by: default avatarJustin Kim <justin.kim@collabora.com>
Differential Revision: https://phabricator.apertis.org/D4354
parent a435d28d
No related branches found
Tags apertis/1%0.20160928.0
No related merge requests found
......@@ -46,16 +46,14 @@ _setup_qdiscs() {
_setup_http_server() {
local www_root=$1
TMPLOGFILE=`mktemp`
HTTPD_LOG_FILE=`mktemp`
echo "simple-httpd log file:" $HTTPD_LOG_FILE
cd "${www_root}" || setup_failure
/usr/lib/libsoup2.4/simple-httpd > ${TMPLOGFILE} &
/usr/lib/libsoup2.4/simple-httpd > ${HTTPD_LOG_FILE} &
# Running HTTP servers used for network cgroup test
HTTP_SERVER_PID=$!
HTTP_SERVER_PORT=$(grep -m1 "Listening" <( tail -f ${TMPLOGFILE} --pid ${HTTP_SERVER_PID}) | cut -d ':' -f 3 | sed "s/\///g")
# Remove a temporary file
rm -f ${TMPLOGFILE}
HTTP_SERVER_PORT=$(grep -m1 "Listening" <( tail -f ${HTTPD_LOG_FILE} --pid ${HTTP_SERVER_PID}) | cut -d ':' -f 3 | sed "s/\///g")
}
_wipe_qdiscs() {
......@@ -64,6 +62,9 @@ _wipe_qdiscs() {
_cleanup() {
kill -9 ${HTTP_SERVER_PID}
if [ -n "$HTTPD_LOG_FILE" ]; then
rm $HTTPD_LOG_FILE
fi
_wipe_qdiscs
}
......@@ -88,6 +89,15 @@ fi
setup_success
# used the display the simple-httpd logs if the test failed to help debugging
display_httpd_log_file() {
if [ -n "$HTTPD_LOG_FILE" ]; then
echo "------------- simple-httpd logs -------------"
cat $HTTPD_LOG_FILE
echo "---------------------------------------------"
fi
}
###########
# Execute #
###########
......@@ -111,6 +121,7 @@ test_gstreamer_download_buffering() {
if [[ $ret -gt 0 ]]; then
echo "Unable to start the http server properly!"
display_httpd_log_file
_cleanup
return $ret
fi
......@@ -121,6 +132,7 @@ test_gstreamer_download_buffering() {
ret=$?
if [[ $ret -gt 0 ]]; then
display_httpd_log_file
echo "Test failed!"
else
echo "Test passed!"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment