tests: fix possibly longer start of HTTP server
authorPetr Štetiar <ynezz@true.cz>
Mon, 22 Mar 2021 20:16:51 +0000 (21:16 +0100)
committerPetr Štetiar <ynezz@true.cz>
Mon, 22 Mar 2021 20:16:51 +0000 (21:16 +0100)
Seems like sometimes it can take some time to start HTTP server so let's
wait for the server becoming operating before executing test cases.

References: https://gitlab.com/openwrt/project/uclient/-/jobs/1118330555#L984
Signed-off-by: Petr Štetiar <ynezz@true.cz>
tests/cram/CMakeLists.txt

index ba75802ae21cd89f771d4615fc6137854f2ad82e..791cfd30ea3c973ead88b60ce52fe6589f4c7b83 100644 (file)
@@ -24,7 +24,8 @@ ADD_CUSTOM_TARGET(
 
 ADD_CUSTOM_TARGET(
        http-server ALL
 
 ADD_CUSTOM_TARGET(
        http-server ALL
-       COMMAND ${PYTHON_VENV_DIR}/bin/python3 -m http.server 1922 --bind 127.0.0.1 > /dev/null 2>&1 &
+       COMMAND ${PYTHON_VENV_DIR}/bin/python3 -m http.server 1922 --bind 127.0.0.1 > /dev/null 2>&1 & ;
+                       curl --silent --retry 3 --retry-delay 1 --retry-connrefused http://127.0.0.1:1922 > /dev/null
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/server
        DEPENDS http-server-kill
 )
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/server
        DEPENDS http-server-kill
 )