diff --git a/gstreamer-buffering/automated/run-test.sh b/gstreamer-buffering/automated/run-test.sh
index 4890972f65d8ab202511572ec965f2859e7c07fb..e6ee1d775dc91b0a6f1ec221f332512043c190e9 100755
--- a/gstreamer-buffering/automated/run-test.sh
+++ b/gstreamer-buffering/automated/run-test.sh
@@ -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!"