Skip to content
Snippets Groups Projects
Commit 2b9b080c authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

update win tests

parent 3cbb015a
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,8 @@ function(prepare_asapo)
configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/authorizer_settings.json.tpl.win authorizer.json.tpl COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/common_scripts/start_services.bat start_services.bat COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/common_scripts/stop_services.bat stop_services.bat COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/common_scripts/start_authorizer.bat start_authorizer.bat COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/common_scripts/stop_authorizer.bat stop_authorizer.bat COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/config/nomad/receiver_tcp.nmd.in receiver_tcp.nmd @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/config/nomad/nginx_kill_win.nmd nginx_kill.nmd @ONLY)
......
......@@ -7,10 +7,7 @@ echo db.data_default.insert({"_id":2}) | %mongo_exe% %database_name% || goto :e
set full_name="%1"
set short_name="%~nx1"
c:\opt\consul\nomad run authorizer.nmd
c:\opt\consul\nomad run nginx.nmd
ping 192.0.2.1 -n 1 -w 2000 > nul
call start_authorizer.bat
start /B "" "%full_name%" -config settings.json
......@@ -53,6 +50,4 @@ exit /b 1
Taskkill /IM "%short_name%" /F
echo db.dropDatabase() | %mongo_exe% %database_name%
del /f groupid
c:\opt\consul\nomad stop authorizer
c:\opt\consul\nomad stop nginx
c:\opt\consul\nomad run nginx_kill.nmd && c:\opt\consul\nomad stop -yes -purge nginx_kill
call stop_authorizer.bat
......@@ -6,10 +6,7 @@ echo db.meta.insert({"_id":0}) | %mongo_exe% %database_name% || goto :error
set full_name="%1"
set short_name="%~nx1"
c:\opt\consul\nomad run authorizer.nmd
c:\opt\consul\nomad run nginx.nmd
ping 192.0.2.1 -n 1 -w 2000 > nul
call start_authorizer.bat
start /B "" "%full_name%" -config settings.json
......@@ -32,6 +29,4 @@ exit /b 1
Taskkill /IM "%short_name%" /F
echo db.dropDatabase() | %mongo_exe% %database_name%
del /f groupid
c:\opt\consul\nomad stop authorizer
c:\opt\consul\nomad stop nginx
c:\opt\consul\nomad run nginx_kill.nmd && c:\opt\consul\nomad stop -yes -purge nginx_kill
call stop_authorizer.bat
......@@ -9,10 +9,7 @@ set short_name="%~nx1"
set token=%BT_DATA_TOKEN%
c:\opt\consul\nomad run authorizer.nmd
c:\opt\consul\nomad run nginx.nmd
ping 192.0.2.1 -n 1 -w 2000 > nul
call start_authorizer.bat
start /B "" "%full_name%" -config settings.json
......@@ -39,6 +36,4 @@ Taskkill /IM "%short_name%" /F
echo db.dropDatabase() | %mongo_exe% %database_name%
del /f token
del /f groupid
c:\opt\consul\nomad stop authorizer
c:\opt\consul\nomad stop nginx
c:\opt\consul\nomad run nginx_kill.nmd && c:\opt\consul\nomad stop -yes -purge nginx_kill
call stop_authorizer.bat
c:\opt\consul\nomad run authorizer.nmd
c:\opt\consul\nomad run nginx.nmd
ping 192.0.2.1 -n 1 -w 3000 > nul
set i=0
:repeat
set /a i=%i%+1
echo %i%
if %i% EQU 20 (
goto :error
)
ping 192.0.2.1 -n 1 -w 1000 >nul
curl --silent --data "" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | findstr /c:"Bad Request" || goto :repeat
echo asapo services ready
goto :clean
:error
echo error starting asapo services
call :clean
exit /b 1
:clean
......@@ -20,3 +20,11 @@ curl --silent --fail 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol
curl --silent --fail 127.0.0.1:8400/asapo-discovery/v0.1/asapo-broker?protocol=v0.1 --stderr - | findstr 127.0.0.1 || goto :repeat
curl --silent --fail 127.0.0.1:8400/asapo-discovery/v0.1/asapo-file-transfer?protocol=v0.1 --stderr - | findstr 127.0.0.1 || goto :repeat
echo discovery ready
goto :clean
:error
echo error starting asapo services
exit /b 1
:clean
c:\opt\consul\nomad stop authorizer
c:\opt\consul\nomad stop nginx
c:\opt\consul\nomad run nginx_kill.nmd && c:\opt\consul\nomad stop -yes -purge nginx_kill
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