changed the way MaxScale starts when testing. Now the test times out but the executable is surely started.

This commit is contained in:
Markus Makela
2014-09-24 14:22:10 +03:00
parent 99cf637e03
commit e5ab9a2b9f
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
file(COPY MaxScale_test.cnf DESTINATION ${CMAKE_BINARY_DIR}/etc) file(COPY MaxScale_test.cnf DESTINATION ${CMAKE_BINARY_DIR}/etc)
file(RENAME ${CMAKE_BINARY_DIR}/etc/MaxScale_test.cnf ${CMAKE_BINARY_DIR}/etc/MaxScale.cnf) file(RENAME ${CMAKE_BINARY_DIR}/etc/MaxScale_test.cnf ${CMAKE_BINARY_DIR}/etc/MaxScale.cnf)
add_test(NAME RunExecutable COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/startmaxscale.sh "$<TARGET_FILE_DIR:maxscale>" "-c ${CMAKE_BINARY_DIR}") add_test(NAME RunExecutable COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/startmaxscale.sh "${CMAKE_BINARY_DIR}/bin/" "-c ${CMAKE_BINARY_DIR}")
set_tests_properties(RunExecutable PROPERTIES TIMEOUT 5) set_tests_properties(RunExecutable PROPERTIES TIMEOUT 2)
add_test(NAME KillExecutable COMMAND killall -KILL maxscale) add_test(NAME KillExecutable COMMAND killall -KILL maxscale)
set_tests_properties(KillExecutable PROPERTIES DEPENDS StackHintTest ) #this needs to be the last test that requires a running maxscale set_tests_properties(KillExecutable PROPERTIES DEPENDS StackHintTest ) #this needs to be the last test that requires a running maxscale

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
killall -KILL maxscale killall -KILL maxscale
sleep 1 sleep 1
/bin/sh $1/maxscale $2 & setsid $1/maxscale $2
exit 0 exit 0