diff --git a/tests/automatic/consumer/consumer_api/CMakeLists.txt b/tests/automatic/consumer/consumer_api/CMakeLists.txt index f31804954685641b614a0ac0c8f38d53f2a984ca..d7f451aa2b93cbdb99a6d5d38fea3df90190df84 100644 --- a/tests/automatic/consumer/consumer_api/CMakeLists.txt +++ b/tests/automatic/consumer/consumer_api/CMakeLists.txt @@ -11,7 +11,6 @@ target_link_libraries(${TARGET_NAME} test_common asapo-consumer) ################################ # Testing ################################ -prepare_asapo() add_script_test("${TARGET_NAME}" "$<TARGET_FILE:${TARGET_NAME}>" ) diff --git a/tests/automatic/consumer/consumer_api/check_linux.sh b/tests/automatic/consumer/consumer_api/check_linux.sh index ceb0979c90aecfd9942195d7c02906c3b60be526..c5c7151808d9adcad8315d07c9e856880d8d3e96 100644 --- a/tests/automatic/consumer/consumer_api/check_linux.sh +++ b/tests/automatic/consumer/consumer_api/check_linux.sh @@ -6,30 +6,16 @@ database_name=${beamtime_id}_${data_source} token_test_run=$BT_TEST_RUN_RW_TOKEN - set -e trap Cleanup EXIT Cleanup() { set +e - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop discovery - nomad stop authorizer - nomad stop broker echo "db.dropDatabase()" | mongo ${database_name} rm -f 1_1 1 } - -nomad run nginx.nmd -nomad run discovery.nmd -nomad run authorizer.nmd -nomad run broker.nmd - -sleep 1 - for i in `seq 1 10`; do echo 'db.data_default.insert({"_id":'$i',"size":6,"name":"'$i'","timestamp":0,"source":"none","buf_id":0,"dataset_substream":0,"meta":{"test":10}})' | mongo ${database_name} @@ -53,7 +39,6 @@ echo hello1 > 1 $@ 127.0.0.1:8400 $beamtime_id $token_test_run single - #check datasets echo "db.dropDatabase()" | mongo ${database_name} diff --git a/tests/automatic/consumer/consumer_api/check_windows.bat b/tests/automatic/consumer/consumer_api/check_windows.bat index 57eac5617585d641650da85d44c1de3bb6c46a00..040bd17ee328222f9f5d468abbe1a7549edeeea5 100644 --- a/tests/automatic/consumer/consumer_api/check_windows.bat +++ b/tests/automatic/consumer/consumer_api/check_windows.bat @@ -6,8 +6,6 @@ SET database_name=%beamtime_id%_%data_source% SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" set token_test_run=%BT_TEST_RUN_RW_TOKEN% -call start_services.bat - for /l %%x in (1, 1, 10) do echo db.data_default.insert({"_id":%%x,"size":6,"name":"%%x","timestamp":0,"source":"none","buf_id":0,"dataset_substream":0,"meta":{"test":10}}) | %mongo_exe% %database_name% || goto :error for /l %%x in (1, 1, 5) do echo db.data_stream1.insert({"_id":%%x,"size":6,"name":"1%%x","timestamp":1000,"source":"none","buf_id":0,"dataset_substream":0,"meta":{"test":10}}) | %mongo_exe% %database_name% || goto :error @@ -39,7 +37,6 @@ call :clean exit /b 1 :clean -call stop_services.bat echo db.dropDatabase() | %mongo_exe% %database_name% del "1 1_1" diff --git a/tests/automatic/consumer/consumer_api_python/CMakeLists.txt b/tests/automatic/consumer/consumer_api_python/CMakeLists.txt index a4afb1b75bf222278f2a302e1af70ce133eadf03..c5c60edc09412b9e6308f0ab884678f1e582f3f4 100644 --- a/tests/automatic/consumer/consumer_api_python/CMakeLists.txt +++ b/tests/automatic/consumer/consumer_api_python/CMakeLists.txt @@ -1,16 +1,10 @@ set(TARGET_NAME consumer_api_python) - -prepare_asapo() - if (UNIX) get_target_property(PYTHON_LIBS python-lib-consumer BINARY_DIR) else() get_target_property(PYTHON_LIBS asapo_consumer BINARY_DIR) endif() -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/authorizer_settings.json.tpl.in authorizer.json.tpl @ONLY) - - add_script_test("${TARGET_NAME}" "${PYTHON_LIBS} ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}" nomem) diff --git a/tests/automatic/consumer/consumer_api_python/authorizer_settings.json.tpl.in b/tests/automatic/consumer/consumer_api_python/authorizer_settings.json.tpl.in deleted file mode 100644 index 611bdefecbc64cd2c976e69593975c81eaf57b13..0000000000000000000000000000000000000000 --- a/tests/automatic/consumer/consumer_api_python/authorizer_settings.json.tpl.in +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Port": {{ env "NOMAD_PORT_authorizer" }}, - "LogLevel":"debug", - "RootBeamtimesFolder":"@ASAP3_FOLDER@", - "CurrentBeamlinesFolder":"@CURRENT_BEAMLINES_FOLDER@", - "UserSecretFile":"auth_secret.key", - "AdminSecretFile":"auth_secret_admin.key", - "TokenDurationMin":600, - "Ldap": - { - "Uri" : "ldap://localhost:389", - "BaseDn" : "ou=rgy,o=desy,c=de", - "FilterTemplate" : "(cn=a3__BEAMLINE__-hosts)" - } -} diff --git a/tests/automatic/consumer/consumer_api_python/check_linux.sh b/tests/automatic/consumer/consumer_api_python/check_linux.sh index c927068adc53270c02648f545f5a7337ca4897da..85fb840de7746600ec25e512a8af8dc50c0d2919 100644 --- a/tests/automatic/consumer/consumer_api_python/check_linux.sh +++ b/tests/automatic/consumer/consumer_api_python/check_linux.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash beamtime_id=test_run -source_path=`pwd`/asap3/petra3/gpfs/p01/2019/data/$beamtime_id +source_path=/tmp/asapo/asap3/petra3/gpfs/p01/2019/data/$beamtime_id data_source=detector database_name=${beamtime_id}_${data_source} token_test_run=$BT_TEST_RUN_RW_TOKEN @@ -11,22 +11,10 @@ trap Cleanup EXIT Cleanup() { set +e - nomad stop nginx >/dev/null - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop discovery >/dev/null - nomad stop broker >/dev/null - nomad stop file_transfer >/dev/null - nomad stop authorizer >/dev/null echo "db.dropDatabase()" | mongo ${database_name} >/dev/null rm $source_path/1 $source_path/1_1 } -nomad run nginx.nmd -nomad run discovery.nmd -nomad run broker.nmd -nomad run file_transfer.nmd -nomad run authorizer.nmd - mkdir -p $source_path echo -n hello1 > $source_path/1 diff --git a/tests/automatic/consumer/consumer_api_python/check_windows.bat b/tests/automatic/consumer/consumer_api_python/check_windows.bat index e584db3026a8ce80bb65a0dc1d876b4426044f2c..68824528f2e442d9d63594785785a7e0b38ea9cf 100644 --- a/tests/automatic/consumer/consumer_api_python/check_windows.bat +++ b/tests/automatic/consumer/consumer_api_python/check_windows.bat @@ -1,6 +1,6 @@ setlocal SET beamtime_id=test_run -SET source_path=%cd%\asap3\petra3\gpfs\p01\2019\data\%beamtime_id% +SET source_path=c:\tmp\asapo\asap3\petra3\gpfs\p01\2019\data\%beamtime_id% set source_path=%source_path:\=\\% SET data_source=detector @@ -9,7 +9,6 @@ SET database_name=%beamtime_id%_%data_source% SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" set token_test_run=%BT_TEST_RUN_RW_TOKEN% -call start_services.bat for /l %%x in (1, 1, 5) do echo db.data_default.insert({"_id":%%x,"size":6,"name":"%%x","timestamp":0,"source":"none","buf_id":0,"dataset_substream":0,"meta":{"test":10}}) | %mongo_exe% %database_name% || goto :error @@ -49,9 +48,9 @@ call :clean exit /b 1 :clean -call stop_services.bat echo db.dropDatabase() | %mongo_exe% %database_name% del c:\tmp\asapo\consumer_test\files\1 del c:\tmp\asapo\consumer_test\files\1_1 +rmdir /S /Q %source_path% diff --git a/tests/automatic/consumer/next_multithread_broker/CMakeLists.txt b/tests/automatic/consumer/next_multithread_broker/CMakeLists.txt index cb89f1c4f5f9f2c1272ea9aa72f0c5b9dc1d4e2c..8225e3c881e9afb68abcc8529edef98c6f854970 100644 --- a/tests/automatic/consumer/next_multithread_broker/CMakeLists.txt +++ b/tests/automatic/consumer/next_multithread_broker/CMakeLists.txt @@ -12,7 +12,6 @@ target_link_libraries(${TARGET_NAME} test_common asapo-consumer) ################################ if (UNIX) - prepare_asapo() add_script_test("${TARGET_NAME}" "$<TARGET_FILE:${TARGET_NAME}>") endif() diff --git a/tests/automatic/consumer/next_multithread_broker/check_linux.sh b/tests/automatic/consumer/next_multithread_broker/check_linux.sh index d507f1e9fc261b660e7a5a77cd32eff4868c7436..02e48655045cd8e9b824f709a28616775546f997 100644 --- a/tests/automatic/consumer/next_multithread_broker/check_linux.sh +++ b/tests/automatic/consumer/next_multithread_broker/check_linux.sh @@ -8,22 +8,9 @@ trap Cleanup EXIT Cleanup() { set +e - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop discovery - nomad stop authorizer - nomad stop broker - echo "db.dropDatabase()" | mongo ${database_name} + echo "db.dropDatabase()" | mongo ${database_name} } - -nomad run nginx.nmd -nomad run discovery.nmd -nomad run authorizer.nmd -nomad run broker.nmd - -sleep 1 - for i in `seq 1 10`; do echo 'db.data_default.insert({"_id":'$i',"size":100,"name":"'$i'","timestamp":0,"source":"none","buf_id":0,"dataset_substream":0,"meta":{"test":10}})' | mongo ${database_name} diff --git a/tests/automatic/curl_http_client/curl_http_client_command/CMakeLists.txt b/tests/automatic/curl_http_client/curl_http_client_command/CMakeLists.txt index 506902ea3b035cda2fe255ef5606afd12d1f518a..64ea405e71835cdc34a265cb0ad90cf2b0ee0e2b 100644 --- a/tests/automatic/curl_http_client/curl_http_client_command/CMakeLists.txt +++ b/tests/automatic/curl_http_client/curl_http_client_command/CMakeLists.txt @@ -18,8 +18,4 @@ target_link_libraries(${TARGET_NAME} test_common asapo-consumer) # Testing ################################ -prepare_asapo() - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/authorizer_settings.json.tpl.in authorizer.json.tpl @ONLY) - add_script_test("${TARGET_NAME}" "$<TARGET_FILE:${TARGET_NAME}>" nomem) diff --git a/tests/automatic/curl_http_client/curl_http_client_command/authorizer_settings.json.tpl.in b/tests/automatic/curl_http_client/curl_http_client_command/authorizer_settings.json.tpl.in deleted file mode 100644 index 611bdefecbc64cd2c976e69593975c81eaf57b13..0000000000000000000000000000000000000000 --- a/tests/automatic/curl_http_client/curl_http_client_command/authorizer_settings.json.tpl.in +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Port": {{ env "NOMAD_PORT_authorizer" }}, - "LogLevel":"debug", - "RootBeamtimesFolder":"@ASAP3_FOLDER@", - "CurrentBeamlinesFolder":"@CURRENT_BEAMLINES_FOLDER@", - "UserSecretFile":"auth_secret.key", - "AdminSecretFile":"auth_secret_admin.key", - "TokenDurationMin":600, - "Ldap": - { - "Uri" : "ldap://localhost:389", - "BaseDn" : "ou=rgy,o=desy,c=de", - "FilterTemplate" : "(cn=a3__BEAMLINE__-hosts)" - } -} diff --git a/tests/automatic/curl_http_client/curl_http_client_command/check_linux.sh b/tests/automatic/curl_http_client/curl_http_client_command/check_linux.sh index 406b111aa9a3989178fd6451b3bbd9d24f39b50e..44935e94bf1500affbda8f15f8cdfda719ed959c 100644 --- a/tests/automatic/curl_http_client/curl_http_client_command/check_linux.sh +++ b/tests/automatic/curl_http_client/curl_http_client_command/check_linux.sh @@ -5,19 +5,13 @@ set -e trap Cleanup EXIT beamtime_id=aaa -file_transfer_folder=`pwd`/asap3/petra3/gpfs/p01/2019/data/$beamtime_id +file_transfer_folder=/tmp/asapo/asap3/petra3/gpfs/p01/2019/data/$beamtime_id Cleanup() { echo cleanup - nomad stop authorizer - nomad stop file_transfer rm -rf $file_transfer_folder bbb random } -nomad run authorizer.nmd -nomad run file_transfer.nmd -sleep 1 - mkdir -p $file_transfer_folder echo -n hello > $file_transfer_folder/aaa diff --git a/tests/automatic/curl_http_client/curl_http_client_command/check_windows.bat b/tests/automatic/curl_http_client/curl_http_client_command/check_windows.bat index a9382c3c97cc68cd38b4e5aecb0ce2b641ed6531..802493da0984d2b54312c21600c8247c9aa83f69 100644 --- a/tests/automatic/curl_http_client/curl_http_client_command/check_windows.bat +++ b/tests/automatic/curl_http_client/curl_http_client_command/check_windows.bat @@ -1,15 +1,8 @@ setlocal SET beamtime_id=aaa -SET file_transfer_folder=%cd%\asap3\petra3\gpfs\p01\2019\data\%beamtime_id% +SET file_transfer_folder=c:\tmp\asapo\asap3\petra3\gpfs\p01\2019\data\%beamtime_id% set file_transfer_folder=%file_transfer_folder:\=\\% - - -c:\opt\consul\nomad run authorizer.nmd -c:\opt\consul\nomad run file_transfer.nmd - -ping 192.0.2.1 -n 1 -w 1000 > nul - mkdir %file_transfer_folder% echo | set /p dummyName="hello" > %file_transfer_folder%\aaa @@ -26,8 +19,6 @@ call :clean exit /b 1 :clean -c:\opt\consul\nomad stop authorizer -c:\opt\consul\nomad stop file_transfer rmdir /S /Q %file_transfer_folder% del /f bbb random diff --git a/tests/automatic/file_transfer_service/rest_api/CMakeLists.txt b/tests/automatic/file_transfer_service/rest_api/CMakeLists.txt index 7ead397a72d3fdf0c9d4dca1b8701a22b29e281f..89ec088316da8161a12ffe3cf0b7d7424a664947 100644 --- a/tests/automatic/file_transfer_service/rest_api/CMakeLists.txt +++ b/tests/automatic/file_transfer_service/rest_api/CMakeLists.txt @@ -3,7 +3,5 @@ set(TARGET_NAME file_transfer_rest_api) ################################ # Testing ################################ -prepare_asapo() -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/authorizer_settings.json.tpl.in authorizer.json.tpl @ONLY) add_script_test("${TARGET_NAME}" "" nomem) diff --git a/tests/automatic/file_transfer_service/rest_api/authorizer_settings.json.tpl.in b/tests/automatic/file_transfer_service/rest_api/authorizer_settings.json.tpl.in deleted file mode 100644 index 611bdefecbc64cd2c976e69593975c81eaf57b13..0000000000000000000000000000000000000000 --- a/tests/automatic/file_transfer_service/rest_api/authorizer_settings.json.tpl.in +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Port": {{ env "NOMAD_PORT_authorizer" }}, - "LogLevel":"debug", - "RootBeamtimesFolder":"@ASAP3_FOLDER@", - "CurrentBeamlinesFolder":"@CURRENT_BEAMLINES_FOLDER@", - "UserSecretFile":"auth_secret.key", - "AdminSecretFile":"auth_secret_admin.key", - "TokenDurationMin":600, - "Ldap": - { - "Uri" : "ldap://localhost:389", - "BaseDn" : "ou=rgy,o=desy,c=de", - "FilterTemplate" : "(cn=a3__BEAMLINE__-hosts)" - } -} diff --git a/tests/automatic/file_transfer_service/rest_api/check_linux.sh b/tests/automatic/file_transfer_service/rest_api/check_linux.sh index a1d034a96fa53935198eba0321a139045d414321..fa404b575a2034e88c4dfa0f3498091433831c35 100644 --- a/tests/automatic/file_transfer_service/rest_api/check_linux.sh +++ b/tests/automatic/file_transfer_service/rest_api/check_linux.sh @@ -4,21 +4,14 @@ set -e trap Cleanup EXIT -file_transfer_folder=`pwd`/asap3/petra3/gpfs/p01/2019/data/aaa +file_transfer_folder=/tmp/asapo/asap3/petra3/gpfs/p01/2019/data/aaa Cleanup() { echo cleanup - nomad stop authorizer - nomad stop file_transfer rm -rf $file_transfer_folder aaa big_file } -nomad run authorizer.nmd -nomad run file_transfer.nmd - -sleep 1 - mkdir -p $file_transfer_folder token=$BT_AAA_TOKEN diff --git a/tests/automatic/file_transfer_service/rest_api/check_windows.bat b/tests/automatic/file_transfer_service/rest_api/check_windows.bat index f34c5ac4ad95bb05b5d802d95b331ae5985db9c9..047b29362cc612dfcf2e0644bd46d098d34994cd 100644 --- a/tests/automatic/file_transfer_service/rest_api/check_windows.bat +++ b/tests/automatic/file_transfer_service/rest_api/check_windows.bat @@ -1,14 +1,8 @@ setlocal SET beamtime_id=aaa -SET file_transfer_folder=%cd%\asap3\petra3\gpfs\p01\2019\data\%beamtime_id% +SET file_transfer_folder=c:\tmp\asapo\asap3\petra3\gpfs\p01\2019\data\%beamtime_id% set file_transfer_folder=%file_transfer_folder:\=\\% - -c:\opt\consul\nomad run authorizer.nmd -c:\opt\consul\nomad run file_transfer.nmd - -ping 192.0.2.1 -n 1 -w 1000 > nul - set token=%BT_AAA_TOKEN% mkdir %file_transfer_folder% @@ -29,6 +23,4 @@ call :clean exit /b 1 :clean -c:\opt\consul\nomad stop authorizer -c:\opt\consul\nomad stop file_transfer rmdir /S /Q %file_transfer_folder% diff --git a/tests/automatic/full_chain/send_recv_streams/CMakeLists.txt b/tests/automatic/full_chain/send_recv_streams/CMakeLists.txt index 0a2ab15e89032a5278cf4376ede48c82c140b041..8a6144bf2077da532e89a80c393d0b89499b4d49 100644 --- a/tests/automatic/full_chain/send_recv_streams/CMakeLists.txt +++ b/tests/automatic/full_chain/send_recv_streams/CMakeLists.txt @@ -9,7 +9,5 @@ set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}$<$<CONFIG:Debug>:> ) -prepare_asapo() - add_script_test("${TARGET_NAME}-tcp" "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME} tcp" nomem) diff --git a/tests/automatic/full_chain/send_recv_streams/check_linux.sh b/tests/automatic/full_chain/send_recv_streams/check_linux.sh index 49aaba84a8a519ed586a6107df83ef75d830dadb..d1e48ef1f0f726694ac5ae067b5e5dc3f932717b 100644 --- a/tests/automatic/full_chain/send_recv_streams/check_linux.sh +++ b/tests/automatic/full_chain/send_recv_streams/check_linux.sh @@ -19,21 +19,8 @@ network_type=$2 Cleanup() { set +e - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop discovery - nomad stop broker - nomad stop receiver - nomad stop authorizer echo "db.dropDatabase()" | mongo ${indatabase_name} } -nomad run nginx.nmd -nomad run discovery.nmd -nomad run broker.nmd -nomad run receiver_tcp.nmd -nomad run authorizer.nmd - - $1 127.0.0.1:8400 $beamtime_id $token | tee out diff --git a/tests/automatic/full_chain/send_recv_streams/check_windows.bat b/tests/automatic/full_chain/send_recv_streams/check_windows.bat index e4c54b28b3878f3cceee27f1fb41993e9747f798..38a7bfb1f5e72ea7c5cdfc9c81f1b91e2b01c8fe 100644 --- a/tests/automatic/full_chain/send_recv_streams/check_windows.bat +++ b/tests/automatic/full_chain/send_recv_streams/check_windows.bat @@ -10,8 +10,6 @@ SET beamline=test SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" -call start_services.bat - "%1" 127.0.0.1:8400 %beamtime_id% %token% goto :clean @@ -21,6 +19,5 @@ call :clean exit /b 1 :clean -call stop_services.bat echo db.dropDatabase() | %mongo_exe% %indatabase_name% diff --git a/tests/automatic/full_chain/send_recv_streams_python/CMakeLists.txt b/tests/automatic/full_chain/send_recv_streams_python/CMakeLists.txt index f592e6f8b6b992a4f2d75125a53453d06a880719..2029410c912dc075a124886c18b81232a0e1b8fc 100644 --- a/tests/automatic/full_chain/send_recv_streams_python/CMakeLists.txt +++ b/tests/automatic/full_chain/send_recv_streams_python/CMakeLists.txt @@ -1,5 +1,4 @@ set(TARGET_NAME send_recv_streams_python) -prepare_asapo() if (UNIX) get_target_property(PYTHON_LIBS_CONSUMER python-lib-consumer BINARY_DIR) diff --git a/tests/automatic/full_chain/send_recv_streams_python/check_linux.sh b/tests/automatic/full_chain/send_recv_streams_python/check_linux.sh index 490f7cd40bdf1aa801454845dcfdbd865b84fbec..7e9b4f3db1fc1c8868bfef0a128df7ed97fc7029 100644 --- a/tests/automatic/full_chain/send_recv_streams_python/check_linux.sh +++ b/tests/automatic/full_chain/send_recv_streams_python/check_linux.sh @@ -14,22 +14,10 @@ set -e trap Cleanup EXIT Cleanup() { - set +e - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop discovery - nomad stop broker - nomad stop receiver - nomad stop authorizer + set +e echo "db.dropDatabase()" | mongo ${indatabase_name} } -nomad run nginx.nmd -nomad run discovery.nmd -nomad run broker.nmd -nomad run receiver_tcp.nmd -nomad run authorizer.nmd - export PYTHONPATH=$2:$3:${PYTHONPATH} diff --git a/tests/automatic/full_chain/send_recv_streams_python/check_windows.bat b/tests/automatic/full_chain/send_recv_streams_python/check_windows.bat index 8df8923517b5058397c4e7f8d5cdeed9fdb60679..0c0dc6a869df601d09ac4d6336e3ab77e4159de3 100644 --- a/tests/automatic/full_chain/send_recv_streams_python/check_windows.bat +++ b/tests/automatic/full_chain/send_recv_streams_python/check_windows.bat @@ -9,8 +9,6 @@ SET beamline=test SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" -call start_services.bat - "%1" 127.0.0.1:8400 %beamtime_id% %token% goto :clean @@ -20,5 +18,4 @@ call :clean exit /b 1 :clean -call stop_services.bat echo db.dropDatabase() | %mongo_exe% %indatabase_name% diff --git a/tests/automatic/full_chain/simple_chain/CMakeLists.txt b/tests/automatic/full_chain/simple_chain/CMakeLists.txt index 84ddc34f2943138033ed6e7f531435994ebc76d0..39feaf30f7f9b3aac33249751f8d348a9e9bd8f9 100644 --- a/tests/automatic/full_chain/simple_chain/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain/CMakeLists.txt @@ -3,5 +3,5 @@ set(TARGET_NAME full_chain_simple_chain) ################################ # Testing ################################ -prepare_asapo() +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) diff --git a/tests/automatic/full_chain/simple_chain/check_linux.sh b/tests/automatic/full_chain/simple_chain/check_linux.sh index 0baea68ff6ff629c0b1ab4881e1440edba4e9782..396e7ae32fc72ce522df7b25d43c81a48e990ffd 100755 --- a/tests/automatic/full_chain/simple_chain/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain/check_linux.sh @@ -23,40 +23,22 @@ receiver_folder=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/dat Cleanup() { echo cleanup rm -rf ${receiver_root_folder} - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer rm -rf out - # kill $producerid echo "db.dropDatabase()" | mongo ${beamtime_id}_detector influx -execute "drop database ${monitor_database_name}" } echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector - echo "db.dropDatabase()" | mongo ${beamtime_id}_detector - -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_tcp.nmd # Only use TCP because the consumer will only use metadata anyways -nomad run discovery.nmd -nomad run broker.nmd - -sleep 1 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` echo "Start producer" mkdir -p ${receiver_folder} $producer_bin localhost:8400 ${beamtime_id} 100 1000 4 0 100 -#producerid=`echo $!` echo "Start consumer in metadata only mode" -$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 5000 1 | tee out +$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 2000 1 | tee out grep "Processed 1000 file(s)" out grep -i "Using connection type: No connection" out diff --git a/tests/automatic/full_chain/simple_chain/check_windows.bat b/tests/automatic/full_chain/simple_chain/check_windows.bat index f6a7cb7925c6b75fbf2cbb36e18a4b039731740f..8ce75eb68b45b6ebcbe7b1ab9381cc18169046f9 100644 --- a/tests/automatic/full_chain/simple_chain/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain/check_windows.bat @@ -9,7 +9,6 @@ set proxy_address="127.0.0.1:8400" echo db.%beamtime_id%_detector.insert({dummy:1}) | %mongo_exe% %beamtime_id%_detector -call start_services.bat "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id% > token set /P token=< token @@ -31,7 +30,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% del /f token echo db.dropDatabase() | %mongo_exe% %beamtime_id%_detector diff --git a/tests/automatic/full_chain/simple_chain_dataset/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_dataset/CMakeLists.txt index c6014bf7bc53c44f5ae3fcb6b64a44878008d387..2c35556c965adb678c2ce06240882e983cfb99b5 100644 --- a/tests/automatic/full_chain/simple_chain_dataset/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_dataset/CMakeLists.txt @@ -3,5 +3,5 @@ set(TARGET_NAME full_chain_simple_chain_dataset) ################################ # Testing ################################ -prepare_asapo() +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) diff --git a/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh b/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh index 93f9960a88f635916d0717f2ee42c27112dd4706..48b6d86d3d585211c3d5906f427cf3b2f63a73b7 100644 --- a/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh @@ -24,12 +24,6 @@ receiver_folder=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/dat Cleanup() { echo cleanup rm -rf ${receiver_root_folder} - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer rm -rf out echo "db.dropDatabase()" | mongo ${beamtime_id}_detector influx -execute "drop database ${monitor_database_name}" @@ -37,14 +31,6 @@ Cleanup() { echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_${network_type}.nmd -nomad run discovery.nmd -nomad run broker.nmd - -sleep 1 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` echo "Start producer" diff --git a/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat b/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat index 7057a8d9b3cd63f48f59cc9ac7da4e403cf35bef..9e29ddb7d3f08ab7138d73db252636d68b4376ab 100644 --- a/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat @@ -8,8 +8,6 @@ set proxy_address="127.0.0.1:8400" echo db.%beamtime_id%_detector.insert({dummy:1}) | %mongo_exe% %beamtime_id%_detector -call start_services.bat - "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id% > token set /P token=< token @@ -32,7 +30,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% del /f token echo db.dropDatabase() | %mongo_exe% %beamtime_id%_detector diff --git a/tests/automatic/full_chain/simple_chain_filegen/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_filegen/CMakeLists.txt index 878b5192b990fba317f109df09235fd0de488e6a..9b2389617c2c544b84c535bb9696c086da2aeecd 100644 --- a/tests/automatic/full_chain/simple_chain_filegen/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_filegen/CMakeLists.txt @@ -3,13 +3,13 @@ set(TARGET_NAME full_chain_simple_chain_filegen_producer) ################################ # Testing ################################ -prepare_asapo() if (UNIX) set (ROOT_PATH "/tmp/asapo/") else() set (ROOT_PATH "c:\\\\tmp\\\\asapo\\\\") endif() +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) configure_file(test.json.in test.json @ONLY) -add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) diff --git a/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh b/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh index 0bd69ff985116b9f46df3ace65571196af175243..bac120a9a42a3f3345af646cbd94ea2cf16ef764 100644 --- a/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh @@ -7,7 +7,6 @@ trap Cleanup EXIT producer_bin=$1 consumer_bin=$2 asapo_tool_bin=$3 -network_type=$4 beamtime_id=asapo_test @@ -27,25 +26,11 @@ Cleanup() { kill -9 $producerid rm -rf /tmp/asapo/test_in rm -rf ${receiver_folder} - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer echo "db.dropDatabase()" | mongo ${beamtime_id}_detector } echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_${network_type}.nmd -nomad run discovery.nmd -nomad run broker.nmd - -sleep 1 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` echo "Start producer" diff --git a/tests/automatic/full_chain/simple_chain_filegen/check_windows.bat b/tests/automatic/full_chain/simple_chain_filegen/check_windows.bat index 9d783bd6ad254ac7674fa9262a2a33617febd228..105fb4e92c169e21fc21e263a451ca7785e606b8 100644 --- a/tests/automatic/full_chain/simple_chain_filegen/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_filegen/check_windows.bat @@ -1,5 +1,3 @@ - - SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" SET beamtime_id=asapo_test SET beamline=test @@ -12,8 +10,6 @@ set proxy_address="127.0.0.1:8400" echo db.%beamtime_id%_detector.insert({dummy:1}) | %mongo_exe% %beamtime_id%_detector -call start_services.bat - "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id% > token set /P token=< token @@ -48,7 +44,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% rmdir /S /Q c:\tmp\asapo\test_in Taskkill /IM "%producer_short_name%" /F diff --git a/tests/automatic/full_chain/simple_chain_filegen_batches/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_filegen_batches/CMakeLists.txt index 810f673112d1af8c124ae62a8364af670f7a8353..efc3d525a82b7e4025cd8bab1fbc4f6073bbaea8 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_batches/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_filegen_batches/CMakeLists.txt @@ -3,7 +3,6 @@ set(TARGET_NAME full_chain_simple_chain_filegen_producer_batches) ################################ # Testing ################################ -prepare_asapo() if (UNIX) set (ROOT_PATH "/tmp/asapo/") else() @@ -11,5 +10,6 @@ else() endif() configure_file(test.json.in test.json @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) -add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) diff --git a/tests/automatic/full_chain/simple_chain_filegen_batches/check_linux.sh b/tests/automatic/full_chain/simple_chain_filegen_batches/check_linux.sh index 553a3b90c33b12c4cbaf3e3d6750596b4f5e8db3..bd9fae0ac61f46ad063cab90c3eb3b335bbe5ecc 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_batches/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_filegen_batches/check_linux.sh @@ -7,7 +7,6 @@ trap Cleanup EXIT producer_bin=$1 consumer_bin=$2 asapo_tool_bin=$3 -network_type=$4 beamtime_id=asapo_test @@ -28,30 +27,14 @@ Cleanup() { kill -9 $producerid rm -rf /tmp/asapo/test_in rm -rf ${receiver_folder} - - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer echo "db.dropDatabase()" | mongo ${beamtime_id}_detector rm -rf out } echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd -nomad run broker.nmd - -sleep 1 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` - mkdir /tmp/asapo/test_in/processed/test1 mkdir /tmp/asapo/test_in/processed/test2 diff --git a/tests/automatic/full_chain/simple_chain_filegen_batches/check_windows.bat b/tests/automatic/full_chain/simple_chain_filegen_batches/check_windows.bat index bc1a1402ae6b96aa54776e20c1bea2cc082cae48..9b9244d6249ebba3c9470fd395f4a5ac1a9c5d37 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_batches/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_filegen_batches/check_windows.bat @@ -1,5 +1,3 @@ - - SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" SET beamtime_id=asapo_test SET beamline=test @@ -12,8 +10,6 @@ set proxy_address="127.0.0.1:8400" echo db.%beamtime_id%_detector.insert({dummy:1}) | %mongo_exe% %beamtime_id%_detector -call start_services.bat - "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id% > token set /P token=< token @@ -47,7 +43,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% rmdir /S /Q c:\tmp\asapo\test_in Taskkill /IM "%producer_short_name%" /F diff --git a/tests/automatic/full_chain/simple_chain_filegen_multisource/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_filegen_multisource/CMakeLists.txt index 0341d8b7ad7dc345b8b3407a7fe5ccc061ea5822..5babe60b6f2d4daa7714bb8ae7f792924b9243c8 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_multisource/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_filegen_multisource/CMakeLists.txt @@ -3,7 +3,6 @@ set(TARGET_NAME full_chain_simple_chain_filegen_producer_multisource) ################################ # Testing ################################ -prepare_asapo() if (UNIX) set (ROOT_PATH "/tmp/asapo/") else() @@ -14,5 +13,6 @@ SET (ID 1) configure_file(test.json.in test1.json @ONLY) SET (ID 2) configure_file(test.json.in test2.json @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) add_script_test("${TARGET_NAME}" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) diff --git a/tests/automatic/full_chain/simple_chain_filegen_multisource/check_linux.sh b/tests/automatic/full_chain/simple_chain_filegen_multisource/check_linux.sh index 9619e32b3ceb6c42a966fc7a501fa623f1b6b576..e75e3b5bcb599432310c8fecda0187dbc89996fa 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_multisource/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_filegen_multisource/check_linux.sh @@ -27,26 +27,12 @@ Cleanup() { rm -rf /tmp/asapo/test_in1 rm -rf /tmp/asapo/test_in2 rm -rf ${receiver_folder} - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer echo "db.dropDatabase()" | mongo ${beamtime_id}_detector rm -rf out } echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd -nomad run broker.nmd - -sleep 1 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` mkdir -p /tmp/asapo/test_in1/processed diff --git a/tests/automatic/full_chain/simple_chain_filegen_multisource/check_windows.bat b/tests/automatic/full_chain/simple_chain_filegen_multisource/check_windows.bat index ef7d8294e3e380550237571139a0b7910cb729dd..f545926676753dde81c19ce33e55c986dad2553d 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_multisource/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_filegen_multisource/check_windows.bat @@ -1,5 +1,3 @@ - - SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" SET beamtime_id=asapo_test SET beamline=test @@ -12,8 +10,6 @@ set proxy_address="127.0.0.1:8400" echo db.%beamtime_id%_detector.insert({dummy:1}) | %mongo_exe% %beamtime_id%_detector -call start_services.bat - "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id% > token set /P token=< token @@ -55,7 +51,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% rmdir /S /Q c:\tmp\asapo\test_in1 rmdir /S /Q c:\tmp\asapo\test_in2 diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/CMakeLists.txt index 17c1adc618b76c372691be8c4ee0e0591e28d266..3da6e5000b33c39ef5df602855cb2713526589cc 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/CMakeLists.txt @@ -3,7 +3,6 @@ set(TARGET_NAME full_chain_simple_chain_withdata_fromcache) ################################ # Testing ################################ -prepare_asapo() if (UNIX) set (ROOT_PATH "/tmp/asapo/") else() @@ -11,6 +10,10 @@ else() endif() configure_file(test.json.in test.json @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/receiver_tcp.json.tpl.lin.in receiver_tcp.json.tpl @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/receiver_fabric.json.tpl.lin.in receiver_fabric.json.tpl @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) + add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh index 0e12523a64c39ebd2f6f34be348d791804f4b395..9cd94ca9d3760bc0bbeffe5fc79071e6a6f5ffee 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh @@ -25,29 +25,26 @@ mkdir -p /tmp/asapo/test_in/processed Cleanup() { echo cleanup + set +e + if [[ $network_type == "fabric" ]]; then + nomad stop receiver + nomad run receiver_tcp.nmd + fi kill -9 $producerid rm -rf /tmp/asapo/test_in rm -rf ${receiver_folder} influx -execute "drop database ${monitor_database_name}" - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer echo "db.dropDatabase()" | mongo ${beamtime_id}_detector rm out.txt } echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_${network_type}.nmd -nomad run discovery.nmd -nomad run broker.nmd -sleep 1 +if [[ $network_type == "fabric" ]]; then + nomad stop receiver + nomad run receiver_fabric.nmd +fi token=`$3 token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` @@ -71,7 +68,3 @@ grep "hello1" out.txt grep "hello2" out.txt grep "hello3" out.txt grep -i "Using connection type: $network_type" out.txt - -sleep 12 - -influx -execute "select sum(n_requests) from statistics where receiver_ds_tag !=''" -database=${monitor_database_name} -format=json | jq .results[0].series[0].values[0][1] | tee /dev/stderr | grep 3 diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_windows.bat b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_windows.bat index dfde693b8fbd64470c3d8bc5cbd3b6e750548775..0a54f44ba46a98d97dc8d449936db49ebfc310e3 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_windows.bat @@ -1,5 +1,3 @@ - - SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" SET beamtime_id=asapo_test SET beamline=test @@ -12,8 +10,6 @@ set proxy_address="127.0.0.1:8400" echo db.%beamtime_id%_detector.insert({dummy:1}) | %mongo_exe% %beamtime_id%_detector -call start_services.bat - "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id% > token set /P token=< token @@ -33,7 +29,6 @@ echo hello3 > c:\tmp\asapo\test_in\processed\test2\file2 ping 192.0.2.1 -n 1 -w 1000 > nul - REM consumer "%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 1000 0 > out.txt type out.txt @@ -50,7 +45,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% rmdir /S /Q c:\tmp\asapo\test_in Taskkill /IM "%producer_short_name%" /F diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/CMakeLists.txt index 4cc2403a472a4829c214879075f96f62f673d3a7..ab7e4f092da79c2f1d8fe6965e7099af348ce942 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/CMakeLists.txt @@ -4,7 +4,6 @@ set(TARGET_NAME full_chain_simple_chain_withdata_fromfile) # Testing ################################ set(RECEIVER_USE_CACHE false) -prepare_asapo() if (UNIX) set (ROOT_PATH "/tmp/asapo/") else() @@ -12,5 +11,6 @@ else() endif() configure_file(test.json.in test.json @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) -add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_linux.sh b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_linux.sh index 748986058523fcfb329688bf4c3eda99234a61d0..59992c6e45cd481a1c78e5820fc546c91d4a627e 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_linux.sh @@ -7,7 +7,6 @@ trap Cleanup EXIT producer_bin=$1 consumer_bin=$2 asapo_tool_bin=$3 -network_type=$4 beamtime_id=asapo_test @@ -29,11 +28,6 @@ Cleanup() { rm -rf /tmp/asapo/test_in rm -rf ${receiver_folder} influx -execute "drop database ${monitor_database_name}" - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker nomad stop authorizer echo "db.dropDatabase()" | mongo ${beamtime_id}_detector rm out.txt @@ -41,14 +35,6 @@ Cleanup() { echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_${network_type}.nmd -nomad run discovery.nmd -nomad run broker.nmd - -sleep 1 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_windows.bat b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_windows.bat index 63a5f3521d5485552aeae57a6efbefe39b8a976b..4ce03a1a75a3b02357e5397ac57c667ef6cdb781 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_windows.bat @@ -12,8 +12,6 @@ set proxy_address="127.0.0.1:8400" echo db.%beamtime_id%_detector.insert({dummy:1}) | %mongo_exe% %beamtime_id%_detector -call start_services.bat - "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id% > token set /P token=< token @@ -52,7 +50,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% rmdir /S /Q c:\tmp\asapo\test_in Taskkill /IM "%producer_short_name%" /F diff --git a/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt index 7149bd170d51a480e1833b5d1de290f30047e7e2..d33f53c2d592ed789447974d5b2ab9b6bd2e7d9a 100644 --- a/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt @@ -3,5 +3,5 @@ set(TARGET_NAME full_chain_simple_chain_metadata) ################################ # Testing ################################ -prepare_asapo() -add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) diff --git a/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh b/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh index 70fc2dfe2b509b1e783076f89c2cf9403d295766..5142eeae87612ffd82a124c6fdcfd87aedaa7372 100644 --- a/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh @@ -23,12 +23,6 @@ receiver_folder=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/dat Cleanup() { echo cleanup rm -rf ${receiver_root_folder} - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer rm -rf out echo "db.dropDatabase()" | mongo ${beamtime_id}_detector influx -execute "drop database ${monitor_database_name}" @@ -36,14 +30,6 @@ Cleanup() { echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_tcp.nmd # Only use TCP because the consumer will only use metadata anyways -nomad run discovery.nmd -nomad run broker.nmd - -sleep 1 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` diff --git a/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat b/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat index f5121e9f4e478607434b2810c238b83fc1f25523..3551790bbbf50ae8795aab76aabc2360293d08cd 100644 --- a/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat @@ -8,8 +8,6 @@ set proxy_address="127.0.0.1:8400" echo db.%beamtime_id%_detector.insert({dummy:1}) | %mongo_exe% %beamtime_id%_detector -call start_services.bat - "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id% > token set /P token=< token @@ -30,7 +28,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% del /f token echo db.dropDatabase() | %mongo_exe% %beamtime_id%_detector diff --git a/tests/automatic/full_chain/simple_chain_raw/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_raw/CMakeLists.txt index 3bbd3e039f3ab1e1bf14e8701313900e8c0a53ce..d054c37c2fbdd3014e6b27d539806534cf48fbf0 100644 --- a/tests/automatic/full_chain/simple_chain_raw/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_raw/CMakeLists.txt @@ -3,21 +3,8 @@ set(TARGET_NAME full_chain_simple_chain_raw) ################################ # Testing ################################ -prepare_asapo() - -file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/asap3 ASAP3_FOLDER ) -file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/beamline CURRENT_BEAMLINES_FOLDER ) - -file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/ip_bl_mapping BEAMLINES_FOLDER ) -if (WIN32) - string(REPLACE "\\" "\\\\" ASAP3_FOLDER "${ASAP3_FOLDER}") - string(REPLACE "\\" "\\\\" BEAMLINES_FOLDER "${BEAMLINES_FOLDER}") - string(REPLACE "\\" "\\\\" CURRENT_BEAMLINES_FOLDER "${CURRENT_BEAMLINES_FOLDER}") - -endif() configure_file(beamtime-metadata-11111111.json beamtime-metadata-11111111.json COPYONLY) - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/settings.json.tpl.in authorizer.json.tpl @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) diff --git a/tests/automatic/full_chain/simple_chain_raw/check_linux.sh b/tests/automatic/full_chain/simple_chain_raw/check_linux.sh index 176da746d3e600097f498ed8084b5a1bdc4e8bc8..109485d11a69321dfeb78938c64114722f50a96b 100644 --- a/tests/automatic/full_chain/simple_chain_raw/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_raw/check_linux.sh @@ -9,43 +9,27 @@ beamtime_id=11111111 monitor_database_name=db_test proxy_address=127.0.0.1:8400 -mkdir -p asap3/petra3/gpfs/p07/2019/data/11111111 -cp beamtime-metadata* asap3/petra3/gpfs/p07/2019/data/11111111 -mkdir -p beamline/p07/current -cp beamtime-metadata* beamline/p07/current/ + +mkdir -p /tmp/asapo/asap3/petra3/gpfs/p07/2019/data/11111111 +cp beamtime-metadata* /tmp/asapo/asap3/petra3/gpfs/p07/2019/data/11111111 +mkdir -p /tmp/asapo/beamline/p07/current +cp beamtime-metadata* /tmp/asapo/beamline/p07/current/ Cleanup() { echo cleanup - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer - rm -rf out asap3 beamline + rm -rf out /tmp/asapo/asap3 /tmp/asapo/beamline echo "db.dropDatabase()" | mongo ${beamtime_id}_detector influx -execute "drop database ${monitor_database_name}" } -#echo "db.data_${beamtime_id}_detector.insert({dummy:1})" | mongo data_${beamtime_id}_detector echo "db.dropDatabase()" | mongo ${beamtime_id}_detector - -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd -nomad run broker.nmd - -sleep 1 - token=`$3 token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` #producer $1 localhost:8400 ${beamtime_id} 100 10 4 100 100 - -$2 ${proxy_address} "__" ${beamtime_id} 2 $token 5000 1 > out +$2 ${proxy_address} "__" ${beamtime_id} 2 $token 2000 1 > out cat out cat out | grep "Processed 10 file(s)" -ls beamline/p07/current/raw/1 | tee /dev/stderr | grep 1 +ls /tmp/asapo/beamline/p07/current/raw/1 | tee /dev/stderr | grep 1 diff --git a/tests/automatic/full_chain/simple_chain_raw/check_windows.bat b/tests/automatic/full_chain/simple_chain_raw/check_windows.bat index c60ca7696ac0ddd01837f8cbf94d9c468e50a83a..2a62d959a206b1e7378a0eee4076f54a025edafb 100644 --- a/tests/automatic/full_chain/simple_chain_raw/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_raw/check_windows.bat @@ -1,20 +1,16 @@ SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" SET beamtime_id=11111111 -mkdir asap3\petra3\gpfs\p07\2019\data\11111111 -mkdir beamline\p07\current -copy beamtime-metadata* beamline\p07\current\ /y -copy beamtime-metadata* asap3\petra3\gpfs\p07\2019\data\11111111\ /y +mkdir c:\tmp\asapo\asap3\petra3\gpfs\p07\2019\data\11111111 +mkdir c:\tmp\asapo\beamline\p07\current +copy beamtime-metadata* c:\tmp\asapo\beamline\p07\current\ /y +copy beamtime-metadata* c:\tmp\asapo\asap3\petra3\gpfs\p07\2019\data\11111111\ /y set proxy_address="127.0.0.1:8400" -call start_services.bat - "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id% > token - set /P token=< token - REM producer mkdir %receiver_folder% start /B "" "%1" %proxy_address% %beamtime_id% 100 10 4 100 100 @@ -24,7 +20,7 @@ REM consumer "%2" %proxy_address% "_" %beamtime_id% 2 %token% 5000 1 > out.txt type out.txt findstr /i /l /c:"Processed 10 file(s)" out.txt || goto :error -if not exist beamline\p07\current\raw\1 goto :error +if not exist c:\tmp\asapo\beamline\p07\current\raw\1 goto :error goto :clean @@ -33,9 +29,8 @@ call :clean exit /b 1 :clean -call stop_services.bat -rmdir /S /Q asap3 -rmdir /S /Q beamline +rmdir /S /Q c:\tmp\asapo\asap3 +rmdir /S /Q c:\tmp\asapo\beamline del /f token del /f out.txt echo db.dropDatabase() | %mongo_exe% %beamtime_id%_detector diff --git a/tests/automatic/full_chain/simple_chain_raw/settings.json.tpl.in b/tests/automatic/full_chain/simple_chain_raw/settings.json.tpl.in deleted file mode 100644 index 130d17e47a5489c0b6beb0fcd93edb4eab1b91ee..0000000000000000000000000000000000000000 --- a/tests/automatic/full_chain/simple_chain_raw/settings.json.tpl.in +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Port": {{ env "NOMAD_PORT_authorizer" }}, - "LogLevel":"debug", - "RootBeamtimesFolder":"@ASAP3_FOLDER@", - "CurrentBeamlinesFolder":"@CURRENT_BEAMLINES_FOLDER@", - "UserSecretFile":"auth_secret.key", - "AdminSecretFile":"auth_secret_admin.key", - "Ldap": - { - "Uri" : "ldap://localhost:389", - "BaseDn" : "ou=rgy,o=desy,c=de", - "FilterTemplate" : "(cn=a3__BEAMLINE__-hosts)" - } -} \ No newline at end of file diff --git a/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt index 827a81a9c51666d94f4063aa3a9dcdaf4b66e807..719adce9e820524d2c935abad84995c86607e206 100644 --- a/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt @@ -3,7 +3,6 @@ set(TARGET_NAME full_chain_usermeta_python) ################################ # Testing ################################ -prepare_asapo() if (UNIX) get_target_property(PYTHON_LIBS python-lib-consumer BINARY_DIR) @@ -11,5 +10,5 @@ else() get_target_property(PYTHON_LIBS asapo_consumer BINARY_DIR) endif() - +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_PROPERTY:asapo,EXENAME> ${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_LIBS} ${Python_EXECUTABLE}" nomem) diff --git a/tests/automatic/full_chain/simple_chain_usermeta_python/check_linux.sh b/tests/automatic/full_chain/simple_chain_usermeta_python/check_linux.sh index 129b8298c423c022e4c5887a7ff8119a98b02474..0a5e90992636119030c8e016a29246150940dd17 100644 --- a/tests/automatic/full_chain/simple_chain_usermeta_python/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_usermeta_python/check_linux.sh @@ -22,12 +22,6 @@ receiver_folder=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/dat Cleanup() { echo cleanup rm -rf ${receiver_root_folder} - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer rm -rf out echo "db.dropDatabase()" | mongo ${beamtime_id}_detector influx -execute "drop database ${monitor_database_name}" @@ -35,14 +29,6 @@ Cleanup() { echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_tcp.nmd # Only use TCP because the consumer will only use metadata anyways -nomad run discovery.nmd -nomad run broker.nmd - -sleep 2 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` diff --git a/tests/automatic/full_chain/simple_chain_usermeta_python/check_windows.bat b/tests/automatic/full_chain/simple_chain_usermeta_python/check_windows.bat index 86d039d555c236bba13be0f03fe65d8925b87007..338aa65eed4c57dd5d81934a7b3b02e80c8aacbf 100644 --- a/tests/automatic/full_chain/simple_chain_usermeta_python/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_usermeta_python/check_windows.bat @@ -8,8 +8,6 @@ set proxy_address="127.0.0.1:8400" echo db.%beamtime_id%_detector.insert({dummy:1}) | %mongo_exe% %beamtime_id%_detector -call start_services.bat - "%2" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id% > token set /P token=< token @@ -34,7 +32,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% del /f token echo db.dropDatabase() | %mongo_exe% %beamtime_id%_detector diff --git a/tests/automatic/full_chain/two_beamlines/CMakeLists.txt b/tests/automatic/full_chain/two_beamlines/CMakeLists.txt index b4b621b3dca1d4ae1162df26625b5d77a7069f2a..6337cc4721457dc0f68a6526b842f61fa6210215 100644 --- a/tests/automatic/full_chain/two_beamlines/CMakeLists.txt +++ b/tests/automatic/full_chain/two_beamlines/CMakeLists.txt @@ -3,11 +3,13 @@ set(TARGET_NAME full_chain_two_beamlines) ################################ # Testing ################################ -prepare_asapo() add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/receiver_tcp.json.tpl.lin.in receiver_tcp.json.tpl @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) if (ENABLE_LIBFABRIC) if (ENABLE_LIBFABRIC_LOCALHOST) + configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/receiver_fabric.json.tpl.lin.in receiver_fabric.json.tpl @ONLY) add_script_test("${TARGET_NAME}-fabric" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> fabric" nomem) else () message(WARNING "Disabled automated LibFabric of '${TARGET_NAME}-fabric' test because 'ENABLE_LIBFABRIC_LOCALHOST' is not enabled.") diff --git a/tests/automatic/full_chain/two_beamlines/check_linux.sh b/tests/automatic/full_chain/two_beamlines/check_linux.sh index f43ddad7bb44e55d68bae73b56c271f082c1aabb..ee0fc635ee1bd4feaeaeeb06291dbd45df2f1681 100644 --- a/tests/automatic/full_chain/two_beamlines/check_linux.sh +++ b/tests/automatic/full_chain/two_beamlines/check_linux.sh @@ -26,18 +26,14 @@ year=2019 receiver_folder1=${receiver_root_folder}/${facility}/gpfs/${beamline1}/${year}/data/${beamtime_id1} receiver_folder2=${receiver_root_folder}/${facility}/gpfs/${beamline2}/${year}/data/${beamtime_id2} - - Cleanup() { echo cleanup + set +e + if [[ $network_type == "fabric" ]]; then + nomad stop receiver + nomad run receiver_tcp.nmd + fi rm -rf ${receiver_root_folder} - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer -# kill $producerid echo "db.dropDatabase()" | mongo ${beamtime_id1}_${data_source} echo "db.dropDatabase()" | mongo ${beamtime_id2}_${data_source} influx -execute "drop database ${monitor_database_name}" @@ -46,13 +42,10 @@ Cleanup() { echo "db.${beamtime_id1}_${data_source}.insert({dummy:1})" | mongo ${beamtime_id1}_${data_source} echo "db.${beamtime_id2}_${data_source}.insert({dummy:1})" | mongo ${beamtime_id2}_${data_source} -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_${network_type}.nmd -nomad run discovery.nmd -nomad run broker.nmd - -sleep 3 +if [[ $network_type == "fabric" ]]; then + nomad stop receiver + nomad run receiver_fabric.nmd +fi token1=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id1` token2=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id2` diff --git a/tests/automatic/full_chain/two_beamlines/check_windows.bat b/tests/automatic/full_chain/two_beamlines/check_windows.bat index 1d7390636b4c7a0aefd9a916c3f76cc519a0e5fe..968f7e4fe13630ef0e679f2e86b50e51a7292715 100644 --- a/tests/automatic/full_chain/two_beamlines/check_windows.bat +++ b/tests/automatic/full_chain/two_beamlines/check_windows.bat @@ -18,8 +18,6 @@ set proxy_address="127.0.0.1:8400" echo db.%beamtime_id1%_%data_source%.insert({dummy:1}) | %mongo_exe% %beamtime_id1%_%data_source% echo db.%beamtime_id2%_%data_source%.insert({dummy:1}) | %mongo_exe% %beamtime_id2%_%data_source% -call start_services.bat - "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id1% > token set /P token1=< token "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id2% > token @@ -52,7 +50,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% del /f token1 del /f token2 diff --git a/tests/automatic/full_chain/two_streams/CMakeLists.txt b/tests/automatic/full_chain/two_streams/CMakeLists.txt index bde0f7e3971762241ed5e201a65ea989ecec101e..85eb3a5e9ede46b8ad4ffe1e6d3c7ffc16098367 100644 --- a/tests/automatic/full_chain/two_streams/CMakeLists.txt +++ b/tests/automatic/full_chain/two_streams/CMakeLists.txt @@ -3,5 +3,5 @@ set(TARGET_NAME full_chain_two_streams) ################################ # Testing ################################ -prepare_asapo() +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) diff --git a/tests/automatic/full_chain/two_streams/check_linux.sh b/tests/automatic/full_chain/two_streams/check_linux.sh index 835de3037b542248963514aaf3cba5db493d8d34..0021c179868ecb14264973e50142243ee8949a8e 100644 --- a/tests/automatic/full_chain/two_streams/check_linux.sh +++ b/tests/automatic/full_chain/two_streams/check_linux.sh @@ -27,12 +27,6 @@ receiver_folder=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/dat Cleanup() { echo cleanup rm -rf ${receiver_root_folder} - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer echo "db.dropDatabase()" | mongo ${beamtime_id}_${stream1} echo "db.dropDatabase()" | mongo ${beamtime_id}_${stream2} } @@ -40,14 +34,6 @@ Cleanup() { echo "db.${beamtime_id}_${stream1}.insert({dummy:1})" | mongo ${beamtime_id}_${stream1} echo "db.${beamtime_id}_${stream2}.insert({dummy:1})" | mongo ${beamtime_id}_${stream2} -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd -nomad run broker.nmd - -sleep 3 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` echo "Start producers" diff --git a/tests/automatic/full_chain/two_streams/check_windows.bat b/tests/automatic/full_chain/two_streams/check_windows.bat index 5e3b68c2c92e7b6baa3920540be8eb77266553e8..ee45bc72f48e25cffc3a5bae95e7d8a7e5aa7bcd 100644 --- a/tests/automatic/full_chain/two_streams/check_windows.bat +++ b/tests/automatic/full_chain/two_streams/check_windows.bat @@ -13,8 +13,6 @@ set proxy_address="127.0.0.1:8400" echo db.%beamtime_id%_%stream1%.insert({dummy:1}) | %mongo_exe% %beamtime_id%_%stream1% echo db.%beamtime_id%_%stream2%.insert({dummy:1}) | %mongo_exe% %beamtime_id%_%stream2% -call start_services.bat - "%3" token -endpoint http://127.0.0.1:8400/asapo-authorizer -secret admin_token.key -types read %beamtime_id% > token set /P token=< token @@ -40,7 +38,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% del /f token1 del /f token2 diff --git a/tests/automatic/high_avail/broker_mongo_restart/CMakeLists.txt b/tests/automatic/high_avail/broker_mongo_restart/CMakeLists.txt index 9c50d188705d726e4850d41d8fb352d8bc2b5010..22840923a66a40c54efad8d3258ac3c986cdc8b4 100644 --- a/tests/automatic/high_avail/broker_mongo_restart/CMakeLists.txt +++ b/tests/automatic/high_avail/broker_mongo_restart/CMakeLists.txt @@ -3,5 +3,5 @@ set(TARGET_NAME broker_mongo_restart) ################################ # Testing ################################ -prepare_asapo() +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) diff --git a/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh b/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh index 89a8247cb4cbdf3e36e9c572f893b69b05f33ad0..302423c246825a2dd55cc1fe768db21f3537548b 100755 --- a/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh +++ b/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh @@ -49,12 +49,6 @@ Cleanup() { set +e echo cleanup rm -rf ${receiver_root_folder} - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer kill $producerid kill $workerid echo "db.dropDatabase()" | mongo --port 27015 ${beamtime_id}_detector || echo "db.dropDatabase()" | mongo --port 27016 ${beamtime_id}_detector @@ -71,15 +65,6 @@ sed -i 's/info/debug/g' broker.json.tpl start_mongo 27016 wait_mongo 27016 - -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd -nomad run broker.nmd - -sleep 1 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` diff --git a/tests/automatic/high_avail/receiver_mongo_restart/CMakeLists.txt b/tests/automatic/high_avail/receiver_mongo_restart/CMakeLists.txt index bebdc30dc0556f1c0d1d781230996503835ac92e..0c7eba4297e3b717e8b54df7d85e78e9ff1753f5 100644 --- a/tests/automatic/high_avail/receiver_mongo_restart/CMakeLists.txt +++ b/tests/automatic/high_avail/receiver_mongo_restart/CMakeLists.txt @@ -3,5 +3,5 @@ set(TARGET_NAME receiver-mongo-restart) ################################ # Testing ################################ -prepare_asapo() +configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/admin_token.key admin_token.key COPYONLY) add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer>" nomem) diff --git a/tests/automatic/high_avail/receiver_mongo_restart/check_linux.sh b/tests/automatic/high_avail/receiver_mongo_restart/check_linux.sh index 11199a46a2c3cb343df16f8a9eab4274ce7531ef..87734e95dfe399f8a099538b9d4ea3aaab456288 100644 --- a/tests/automatic/high_avail/receiver_mongo_restart/check_linux.sh +++ b/tests/automatic/high_avail/receiver_mongo_restart/check_linux.sh @@ -41,14 +41,10 @@ receiver_folder=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/dat Cleanup() { echo cleanup + set +e rm -rf ${receiver_root_folder} - nomad stop receiver - nomad stop discovery - nomad stop authorizer - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - echo "db.dropDatabase()" | mongo --port 27016 ${beamtime_id}_detector - kill_mongo + echo "db.dropDatabase()" | mongo --port 27016 ${beamtime_id}_detector + kill_mongo } start_mongo @@ -60,17 +56,8 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo --port 27016 ${beamt sed -i 's/27017/27016/g' discovery.json.tpl - -nomad run authorizer.nmd -nomad run nginx.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd - mkdir -p ${receiver_folder} - -sleep 1 - nfiles=1000 $1 localhost:8400 ${beamtime_id} 100 $nfiles 1 0 200 & diff --git a/tests/automatic/high_avail/services_restart/CMakeLists.txt b/tests/automatic/high_avail/services_restart/CMakeLists.txt index 4b27ebf5b089288c4ac5e4a89a2de33322385ac4..cb554fba0144eafc44e67d1dd72e33b6e96129a4 100644 --- a/tests/automatic/high_avail/services_restart/CMakeLists.txt +++ b/tests/automatic/high_avail/services_restart/CMakeLists.txt @@ -4,5 +4,5 @@ set(TARGET_NAME service_restart) # Testing ################################ prepare_asapo() -add_script_test("${TARGET_NAME}-all-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> broker 1000 998 tcp" nomem) -add_script_test("${TARGET_NAME}-all-but-broker-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> receiver 1000 1000 tcp" nomem) +add_script_test("${TARGET_NAME}-all" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> broker 1000 998" nomem) +add_script_test("${TARGET_NAME}-all-but-broker" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> receiver 1000 1000" nomem) diff --git a/tests/automatic/high_avail/services_restart/check_linux.sh b/tests/automatic/high_avail/services_restart/check_linux.sh index a9e011210b329a56a3174bbfa42bfb82b26446a9..d8324f4daea6f4efc78be659de3bf218f06c1408 100644 --- a/tests/automatic/high_avail/services_restart/check_linux.sh +++ b/tests/automatic/high_avail/services_restart/check_linux.sh @@ -7,7 +7,7 @@ trap Cleanup EXIT producer_bin=$1 consumer_bin=$2 asapo_tool_bin=$3 -network_type=$7 + beamtime_id=asapo_test @@ -24,25 +24,10 @@ mkdir -p ${receiver_folder} Cleanup() { echo cleanup rm -rf ${receiver_folder} - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop broker - nomad stop authorizer echo "db.dropDatabase()" | mongo ${beamtime_id}_detector influx -execute "drop database ${monitor_database_name}" } -#sed -i 's/info/debug/g' broker.json.tpl - -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd -nomad run broker.nmd - -sleep 1 token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` @@ -52,7 +37,7 @@ echo "Start producer" $producer_bin localhost:8400 ${beamtime_id} 100 $5 4 0 100 & #producerid=`echo $!` -echo "Start consumer in $network_type mode" +echo "Start consumer" $consumer_bin ${proxy_address} dummy_path ${beamtime_id} 2 $token 30000 1 &> output.txt & sleep 1 @@ -67,10 +52,10 @@ nomad stop receiver nomad run nginx.nmd nomad run authorizer.nmd nomad run discovery.nmd -nomad run receiver_$7.nmd +nomad run receiver_tcp.nmd if [[ "$4" == "receiver" ]]; then - nomad run $4_$7.nmd + nomad run $4_tcp.nmd else nomad run $4.nmd fi diff --git a/tests/automatic/producer/aai/CMakeLists.txt b/tests/automatic/producer/aai/CMakeLists.txt index 2330026be2ac46e58f307196622770ea32f82403..27749acb8d83cb3ba00563f6f4c7cc06e769ff9a 100644 --- a/tests/automatic/producer/aai/CMakeLists.txt +++ b/tests/automatic/producer/aai/CMakeLists.txt @@ -3,9 +3,6 @@ set(TARGET_NAME producer_python_aai) ################################ # Testing ################################ -prepare_asapo() - -prepare_asapo() if (UNIX) get_target_property(PYTHON_LIBS python-lib-producer BINARY_DIR) @@ -13,14 +10,7 @@ else() get_target_property(PYTHON_LIBS asapo_producer BINARY_DIR) endif() -file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/beamline CURRENT_BEAMLINES_FOLDER ) - -if (WIN32) - string(REPLACE "\\" "\\\\" CURRENT_BEAMLINES_FOLDER "${CURRENT_BEAMLINES_FOLDER}") -endif() - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/settings.json.tpl.in authorizer.json.tpl @ONLY) -configure_file(beamtime-metadata-11111111.json beamline/p07/current/beamtime-metadata-11111111.json COPYONLY) +configure_file(beamtime-metadata-11111111.json beamtime-metadata-11111111.json) file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/producer_aai.py TEST_SCRIPT ) diff --git a/tests/automatic/producer/aai/check_linux.sh b/tests/automatic/producer/aai/check_linux.sh index d5aeba38c60264f46a24053b42c9976280b9fd98..e1da7ce2ec3cd66dfa1cbbc83078dfc968b16eba 100644 --- a/tests/automatic/producer/aai/check_linux.sh +++ b/tests/automatic/producer/aai/check_linux.sh @@ -18,32 +18,26 @@ token=$BLP07_W_TOKEN Cleanup() { echo cleanup rm -rf ${receiver_root_folder} - nomad stop receiver >/dev/null - nomad stop discovery >/dev/null - nomad stop authorizer >/dev/null - nomad stop nginx >/dev/null - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill > /dev/null - echo "db.dropDatabase()" | mongo ${beamtime_id}_${data_source} >/dev/null - echo "db.dropDatabase()" | mongo ${beamtime_id2}_${data_source} >/dev/null + echo "db.dropDatabase()" | mongo ${beamtime_id}_${data_source} >/dev/null + echo "db.dropDatabase()" | mongo ${beamtime_id2}_${data_source} >/dev/null + rm -rf $beamline_dir } export PYTHONPATH=$2:${PYTHONPATH} -nomad run authorizer.nmd >/dev/null -nomad run nginx.nmd >/dev/null -nomad run receiver_tcp.nmd >/dev/null -nomad run discovery.nmd >/dev/null - mkdir -p ${receiver_folder} ${receiver_folder2} sleep 1 echo test > file1 +beamline_dir='/tmp/asapo/beamline/p07/current/' +mkdir -p $beamline_dir +cp beamtime-metadata-11111111.json $beamline_dir -$1 $3 $beamline $token $data_source "127.0.0.1:8400" > out || cat out +$1 $3 $beamline $token $data_source "127.0.0.1:8400" ${beamline_dir}"beamtime-metadata-11111111.json" > out || cat out cat out -cat out | grep "successfuly sent" | wc -l | grep 3 -cat out | grep "reauthorization\|Broken" | wc -l | grep 1 -cat out | grep "duplicated" | wc -l | grep 2 +cat out | grep "successfuly sent" | wc -l | tee /dev/stderr | grep 3 +cat out | grep "reauthorization\|Broken" | wc -l | tee /dev/stderr | grep 1 +cat out | grep "duplicated" | wc -l | tee /dev/stderr | grep 2 diff --git a/tests/automatic/producer/aai/check_windows.bat b/tests/automatic/producer/aai/check_windows.bat index fa0c3b90200640a4b293687a05da34cb7c47639f..5a5741ddf3853f1e36675267a9bbd5e4f3ea488e 100644 --- a/tests/automatic/producer/aai/check_windows.bat +++ b/tests/automatic/producer/aai/check_windows.bat @@ -9,11 +9,11 @@ SET receiver_folder2="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\ SET dbname=%beamtime_id%_%data_source% SET dbname2=%beamtime_id2%_%data_source% SET token=%BLP07_W_TOKEN% +SET beamline_dir=/c:\tmp\asapo\beamline\p07\current\ -echo db.%dbname%.insert({dummy:1})" | %mongo_exe% %dbname% -call start_services.bat +echo db.%dbname%.insert({dummy:1})" | %mongo_exe% %dbname% mkdir %receiver_folder% mkdir %receiver_folder2% @@ -24,7 +24,10 @@ ping 192.0.2.1 -n 1 -w 1000 > nul set PYTHONPATH=%2 -"%1" "%3" %beamline% %token% %data_source% "127.0.0.1:8400" > out +mkdir %beamline_dir% +copy beamtime-metadata-11111111.json %beamline_dir% /y + +"%1" "%3" %beamline% %token% %data_source% "127.0.0.1:8400"%beamline_dir%beamtime-metadata-11111111.json > out type out set NUM=0 @@ -44,9 +47,9 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% rmdir /S /Q %receiver_root_folder2% +rmdir /S /Q %beamline_dir% echo db.dropDatabase() | %mongo_exe% %dbname% echo db.dropDatabase() | %mongo_exe% %dbname2% diff --git a/tests/automatic/producer/aai/producer_aai.py b/tests/automatic/producer/aai/producer_aai.py index 8828b87ab773ca9a54741a8232eb9aa69d7629ff..da575d7c727b2f6dee4dfd21c50a7c41cb755794 100644 --- a/tests/automatic/producer/aai/producer_aai.py +++ b/tests/automatic/producer/aai/producer_aai.py @@ -12,6 +12,7 @@ beamline = sys.argv[1] token = sys.argv[2] data_source = sys.argv[3] endpoint = sys.argv[4] +fname = sys.argv[5] nthreads = 1 @@ -42,7 +43,6 @@ producer.send_file(1, local_path = "./file1", exposed_path = "processed/"+data_s producer.wait_requests_finished(10000) -fname = 'beamline/p07/current/beamtime-metadata-11111111.json' with open(fname) as json_file: data = json.load(json_file) data['beamtimeId']='22222222' diff --git a/tests/automatic/producer/aai/settings.json.tpl.in b/tests/automatic/producer/aai/settings.json.tpl.in deleted file mode 100644 index a98ad02c79c683d5be97492e6aed38a945b80f54..0000000000000000000000000000000000000000 --- a/tests/automatic/producer/aai/settings.json.tpl.in +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Port": {{ env "NOMAD_PORT_authorizer" }}, - "LogLevel":"debug", - "CurrentBeamlinesFolder":"@CURRENT_BEAMLINES_FOLDER@", - "UserSecretFile":"auth_secret.key", - "AdminSecretFile":"auth_secret_admin.key" -} - - diff --git a/tests/automatic/producer/python_api/CMakeLists.txt b/tests/automatic/producer/python_api/CMakeLists.txt index 8e8282c914c64197afab2716f74734d94d89b0a5..cec3071ede7d56eb094753f05bf7a5db84ec6f25 100644 --- a/tests/automatic/producer/python_api/CMakeLists.txt +++ b/tests/automatic/producer/python_api/CMakeLists.txt @@ -3,10 +3,6 @@ set(TARGET_NAME producer_python_api) ################################ # Testing ################################ -prepare_asapo() - -prepare_asapo() - if (UNIX) get_target_property(PYTHON_LIBS python-lib-producer BINARY_DIR) else() diff --git a/tests/automatic/producer/python_api/check_linux.sh b/tests/automatic/producer/python_api/check_linux.sh index 957e6ff0dbeff68f1f56d880ffcfcc8a07f6b314..4d677c18aae9d896544951ff7b034ca9850a0a80 100644 --- a/tests/automatic/producer/python_api/check_linux.sh +++ b/tests/automatic/producer/python_api/check_linux.sh @@ -16,11 +16,6 @@ receiver_folder=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/dat Cleanup() { echo cleanup rm -rf ${receiver_root_folder} - nomad stop receiver >/dev/null - nomad stop discovery >/dev/null - nomad stop authorizer >/dev/null - nomad stop nginx >/dev/null - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill > /dev/null echo "db.dropDatabase()" | mongo ${beamtime_id}_${data_source} >/dev/null } @@ -28,17 +23,10 @@ export PYTHONPATH=$2:${PYTHONPATH} echo "db.${beamtime_id}_${data_source}.insert({dummy:1})" | mongo ${beamtime_id}_${data_source} >/dev/null -nomad run authorizer.nmd >/dev/null -nomad run nginx.nmd >/dev/null -nomad run receiver_tcp.nmd >/dev/null -nomad run discovery.nmd >/dev/null - mkdir -p ${receiver_folder} echo test > file1 -sleep 10 - $1 $3 $data_source $beamtime_id "127.0.0.1:8400" &> out || cat out cat out echo count successfully send, expect 15 diff --git a/tests/automatic/producer/python_api/check_windows.bat b/tests/automatic/producer/python_api/check_windows.bat index 844e51b378243114eed735074a11e6dbb81e02dc..8ae2e338226684a502058ce7355da2a38e76477e 100644 --- a/tests/automatic/producer/python_api/check_windows.bat +++ b/tests/automatic/producer/python_api/check_windows.bat @@ -8,8 +8,6 @@ SET dbname=%beamtime_id%_%data_source% echo db.%dbname%.insert({dummy:1})" | %mongo_exe% %dbname% -call start_services.bat - mkdir %receiver_folder% echo test > file1 @@ -43,7 +41,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% echo db.dropDatabase() | %mongo_exe% %dbname%