diff --git a/CMakeModules/prepare_asapo.cmake b/CMakeModules/prepare_asapo.cmake index 66c7e52517e3af216024fe3c1b3896d0ce37ddac..bcf2db0fcd819039856d419e85e7f3d00cc8be3b 100644 --- a/CMakeModules/prepare_asapo.cmake +++ b/CMakeModules/prepare_asapo.cmake @@ -27,9 +27,6 @@ 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) else() diff --git a/broker/src/asapo_broker/server/authorizer.go b/broker/src/asapo_broker/server/authorizer.go index 07cf4ddfe63db13a9eef3aa4b6b7201d38f3c934..4ff965d05b2e20d2860d319ecbb6809248accde1 100644 --- a/broker/src/asapo_broker/server/authorizer.go +++ b/broker/src/asapo_broker/server/authorizer.go @@ -84,7 +84,7 @@ func (a * AsapoAuthorizer) doRequest(req *http.Request) (token Token, err error) } if resp.StatusCode != http.StatusOK { - return token, &HttpError{errors.New("returned " + resp.Status + ": " + string(body)),resp.StatusCode} + return token, &HttpError{errors.New("authorizer returned " + resp.Status + ": " + string(body)),resp.StatusCode} } err = json.Unmarshal(body, &token) diff --git a/broker/src/asapo_broker/server/get_streams.go b/broker/src/asapo_broker/server/get_streams.go index 7cc8d0875af1a6f6f0ca335c8707b928457639ad..a22274553f58663c2bdbd830c246344b48f0dea9 100644 --- a/broker/src/asapo_broker/server/get_streams.go +++ b/broker/src/asapo_broker/server/get_streams.go @@ -1,12 +1,10 @@ package server import ( - "fmt" "net/http" ) func routeGetStreams(w http.ResponseWriter, r *http.Request) { - fmt.Println(r.RequestURI) keys := r.URL.Query() from := keys.Get("from") filter := keys.Get("filter") diff --git a/consumer/api/cpp/src/consumer_impl.cpp b/consumer/api/cpp/src/consumer_impl.cpp index b6eb00b86c9f880014ac1e5cd1a7d70f13593829..c8358a58cccb45770cf0107b7a804ec8b2f1abad 100644 --- a/consumer/api/cpp/src/consumer_impl.cpp +++ b/consumer/api/cpp/src/consumer_impl.cpp @@ -111,7 +111,7 @@ Error ProcessRequestResponce(const RequestInfo &request, } if (err!=nullptr) { - std::string prefix = "Error processing request" + request.api; + std::string prefix = "Error processing request " + request.host+request.api; err->Prepend(prefix); } return err; diff --git a/deploy/build_env/centos/Dockerfile.7.9.2009 b/deploy/build_env/centos/Dockerfile.7.9.2009 index 22c443a7b590b0f5601a94fe7d4ec7e879a349ea..a800bd13fe57b5c6b0ea3e57e89b7395c1c93d37 100644 --- a/deploy/build_env/centos/Dockerfile.7.9.2009 +++ b/deploy/build_env/centos/Dockerfile.7.9.2009 @@ -2,7 +2,7 @@ from centos:7.9.2009 RUN yum update -y && yum install -y epel-release make g++ python python3 git wget rpm-build RUN yum -y install gcc gcc-c++ glibc-static libstdc++-static zlib-devel libcurl-devel python-pip python3-pip python-devel python3-devel numpy python3-numpy -RUN pip install --upgrade pip +#RUN pip install --upgrade pip RUN pip install cython RUN pip3 install cython diff --git a/deploy/build_env/centos/build.sh b/deploy/build_env/centos/build.sh index 112f6b292bb84e2ab1a47990a48145a7ae2bc247..3df44c92eb3d54f6e5098b97f80d7c9c6de3e0b0 100755 --- a/deploy/build_env/centos/build.sh +++ b/deploy/build_env/centos/build.sh @@ -12,7 +12,7 @@ cmake \ -DCPACK_PACKAGE_NAME="asapo-devel" \ -DCPACK_GENERATOR="RPM" \ .. -make +make -j 4 make package cmake -DNUMPY_VERSION=0 -DBUILD_PYTHON=ON -DBUILD_PYTHON_PACKAGES="source;rpm" .. diff --git a/deploy/build_env/debians/build.sh b/deploy/build_env/debians/build.sh index 2ba687b4b3f909163d8566ab536bed84ea57fbe9..a237aca6de64253e907b74233b36500902147b49 100755 --- a/deploy/build_env/debians/build.sh +++ b/deploy/build_env/debians/build.sh @@ -15,7 +15,7 @@ cmake \ -DCPACK_GENERATOR="DEB" \ .. cmake .. #second time for to correctly build deb packages -make +make -j 4 make package diff --git a/discovery/src/asapo_discovery/common/consts.go b/discovery/src/asapo_discovery/common/consts.go index e43ea3b1e52bae972c34cb40e658b3d1cc99a98b..46cf71dcdae48f003e3471fab799e0fc243e4090 100644 --- a/discovery/src/asapo_discovery/common/consts.go +++ b/discovery/src/asapo_discovery/common/consts.go @@ -1,6 +1,6 @@ package common -const ( +var ( NameMongoService = "asapo-mongodb" NameFtsService = "asapo-file-transfer" NameBrokerService = "asapo-broker" diff --git a/discovery/src/asapo_discovery/request_handler/request_handler_consul.go b/discovery/src/asapo_discovery/request_handler/request_handler_consul.go index 9db9cb5eecb1e8b466f2a72c7ba3e42225bcbe93..a8180db1579e680eaa41fe2106c8540f84d5328a 100644 --- a/discovery/src/asapo_discovery/request_handler/request_handler_consul.go +++ b/discovery/src/asapo_discovery/request_handler/request_handler_consul.go @@ -67,7 +67,7 @@ func (rh *ConsulRequestHandler) GetReceivers(use_ib bool) ([]byte, error) { return nil, errors.New("consul client not connected") } var err error - response.Uris, err = rh.GetServices("asapo-receiver",use_ib) + response.Uris, err = rh.GetServices(common.NameReceiverService,use_ib) if err != nil { return nil, err } diff --git a/discovery/src/asapo_discovery/request_handler/request_handler_consul_test.go b/discovery/src/asapo_discovery/request_handler/request_handler_consul_test.go index 516928011dba75e384b3196d10203a7972bd3a80..44b6b7b101ebd62a22b59fd51eea7c619b88c2ad 100644 --- a/discovery/src/asapo_discovery/request_handler/request_handler_consul_test.go +++ b/discovery/src/asapo_discovery/request_handler/request_handler_consul_test.go @@ -48,16 +48,17 @@ func (suite *ConsulHandlerTestSuite) SetupTest() { if err != nil { panic(err) } - - suite.registerAgents("asapo-receiver") - suite.registerAgents("asapo-broker") + common.NameReceiverService = "asapo-receiver-test" + common.NameBrokerService = "asapo-broker-test" + suite.registerAgents("asapo-receiver-test") + suite.registerAgents("asapo-broker-test") } func (suite *ConsulHandlerTestSuite) TearDownTest() { - suite.client.Agent().ServiceDeregister("asapo-receiver1234") - suite.client.Agent().ServiceDeregister("asapo-receiver1235") - suite.client.Agent().ServiceDeregister("asapo-broker1234") - suite.client.Agent().ServiceDeregister("asapo-broker1235") + suite.client.Agent().ServiceDeregister("asapo-receiver-test1234") + suite.client.Agent().ServiceDeregister("asapo-receiver-test1235") + suite.client.Agent().ServiceDeregister("asapo-broker-test1234") + suite.client.Agent().ServiceDeregister("asapo-broker-test1235") } func (suite *ConsulHandlerTestSuite) TestInitDefaultUri() { @@ -154,8 +155,8 @@ func (suite *ConsulHandlerTestSuite) TestGetBrokerStatic() { } func (suite *ConsulHandlerTestSuite) TestGetBrokerEmpty() { - suite.client.Agent().ServiceDeregister("asapo-broker1234") - suite.client.Agent().ServiceDeregister("asapo-broker1235") + suite.client.Agent().ServiceDeregister("asapo-broker-test1234") + suite.client.Agent().ServiceDeregister("asapo-broker-test1235") suite.handler.Init(consul_settings) res, err := suite.handler.GetSingleService(common.NameBrokerService) diff --git a/examples/consumer/getnext/CMakeLists.txt b/examples/consumer/getnext/CMakeLists.txt index 1e7bd4ca74068e668977e62b76a03d58628fe4ff..6353d1706436a5acf5e9997b65436cbc4562d63f 100644 --- a/examples/consumer/getnext/CMakeLists.txt +++ b/examples/consumer/getnext/CMakeLists.txt @@ -14,10 +14,6 @@ set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY get_target_property(VAR ${TARGET_NAME} RUNTIME_OUTPUT_DIRECTORY) add_dependencies(${TARGET_NAME} asapo-broker) - -prepare_asapo() - -configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/broker_settings.json settings.json COPYONLY) add_script_test("${TARGET_NAME}" "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}") endif() diff --git a/examples/consumer/getnext/check_linux.sh b/examples/consumer/getnext/check_linux.sh index 2c853792cf60bc9a171c6664a2a695ca71c0791f..2cb761da0fcdbc11a634e2c46dcfcb0417885c96 100644 --- a/examples/consumer/getnext/check_linux.sh +++ b/examples/consumer/getnext/check_linux.sh @@ -12,19 +12,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} } -nomad run nginx.nmd -nomad run discovery.nmd -nomad run authorizer.nmd -nomad run broker.nmd - for i in `seq 1 3`; 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} @@ -32,7 +22,7 @@ done sleep 1 -$@ 127.0.0.1:8400 $source_path $beamtime_id 2 $token_test_run 12000 1 | tee /dev/stderr | grep "Processed 3 file(s)" +$@ 127.0.0.1:8400 $source_path $beamtime_id 2 $token_test_run 3000 1 | tee /dev/stderr | grep "Processed 3 file(s)" diff --git a/examples/consumer/getnext/check_windows.bat b/examples/consumer/getnext/check_windows.bat index 1a3db40dff18fa2808fcdf3c3957eeb40f990e58..2e0870e3678408205d00f4f172153fc98336b199 100644 --- a/examples/consumer/getnext/check_windows.bat +++ b/examples/consumer/getnext/check_windows.bat @@ -7,12 +7,10 @@ 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_TOKEN% -call start_services.bat - for /l %%x in (1, 1, 3) do echo db.data_default.insert({"_id":%%x,"size":100,"name":"%%x","timestamp":0,"source":"none","buf_id":0,"dataset_substream":0,"meta":{"test":10}}) | %mongo_exe% %database_name% || goto :error -"%1" 127.0.0.1:8400 %source_path% %beamtime_id% 1 %token_test_run% 12000 1 | findstr /c:"Processed 3 file" || goto :error +"%1" 127.0.0.1:8400 %source_path% %beamtime_id% 1 %token_test_run% 3000 1 | findstr /c:"Processed 3 file" || goto :error goto :clean :error @@ -20,5 +18,4 @@ call :clean exit /b 1 :clean -call stop_services.bat echo db.dropDatabase() | %mongo_exe% %database_name% diff --git a/examples/consumer/getnext_python/CMakeLists.txt b/examples/consumer/getnext_python/CMakeLists.txt index a551c090300c7d24cd0a72dbf8b8602ae9806308..6c0804e29ecb0767b02f0ed30d616ef7d737b508 100644 --- a/examples/consumer/getnext_python/CMakeLists.txt +++ b/examples/consumer/getnext_python/CMakeLists.txt @@ -1,8 +1,5 @@ set(TARGET_NAME getnext_python) - -prepare_asapo() - if (UNIX) get_target_property(PYTHON_LIBS python-lib-consumer BINARY_DIR) else() diff --git a/examples/consumer/getnext_python/check_linux.sh b/examples/consumer/getnext_python/check_linux.sh index 50c4b25cfa5364a5566b8440a6296649cb043497..9f6fb85bd8f428a51c2cc9a163255c8e217ba456 100644 --- a/examples/consumer/getnext_python/check_linux.sh +++ b/examples/consumer/getnext_python/check_linux.sh @@ -12,19 +12,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} } -nomad run nginx.nmd -nomad run discovery.nmd -nomad run authorizer.nmd -nomad run broker.nmd - for i in `seq 1 3`; 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/examples/consumer/getnext_python/check_windows.bat b/examples/consumer/getnext_python/check_windows.bat index 9b96ec00e6ddc2373237820eb86ee333f0f2b7b0..e48e27bd8c3a9a23fef9fb366ac6ef564a297057 100644 --- a/examples/consumer/getnext_python/check_windows.bat +++ b/examples/consumer/getnext_python/check_windows.bat @@ -7,8 +7,6 @@ SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" set token_test_run=%BT_TEST_RUN_TOKEN% set group_id=bif31l2uiddd4r0q6b40 -call start_services.bat - for /l %%x in (1, 1, 3) do echo db.data_default.insert({"_id":%%x,"size":100,"name":"%%x","timestamp":0,"source":"none","buf_id":0,"dataset_substream":0,"meta":{"test":10}}) | %mongo_exe% %database_name% || goto :error @@ -44,5 +42,4 @@ call :clean exit /b 1 :clean -call stop_services.bat echo db.dropDatabase() | %mongo_exe% %database_name% diff --git a/examples/consumer/getnext_python/getnext.py b/examples/consumer/getnext_python/getnext.py index 0aec93df4bdfff79a2b6733e1cb225fa955e28b2..e521c98f5be613f2a1f6d04acc2251858017d5b2 100644 --- a/examples/consumer/getnext_python/getnext.py +++ b/examples/consumer/getnext_python/getnext.py @@ -6,7 +6,7 @@ import sys source, path, beamtime, token, group_id = sys.argv[1:] -consumer = asapo_consumer.create_consumer(source,path,True, beamtime,"",token,60000) +consumer = asapo_consumer.create_consumer(source,path,True, beamtime,"",token,5000) if group_id == "new": diff --git a/examples/pipeline/in_to_out/CMakeLists.txt b/examples/pipeline/in_to_out/CMakeLists.txt index efe0d0f8a6f0e87758fef1c4fa683fa469068fa0..60e211fb06c546e4e23bd3d8aaf02182332bb363 100644 --- a/examples/pipeline/in_to_out/CMakeLists.txt +++ b/examples/pipeline/in_to_out/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}" "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}" nomem) diff --git a/examples/pipeline/in_to_out/check_linux.sh b/examples/pipeline/in_to_out/check_linux.sh index 120bad4d0fc3a2e95e40fe9397e154f98bda7855..ceaeccdacc4c7a1d7e4091715cb2a35acda58a56 100644 --- a/examples/pipeline/in_to_out/check_linux.sh +++ b/examples/pipeline/in_to_out/check_linux.sh @@ -25,12 +25,6 @@ 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 echo "db.dropDatabase()" | mongo ${indatabase_name} echo "db.dropDatabase()" | mongo ${outdatabase_name} echo "db.dropDatabase()" | mongo ${outdatabase_name2} @@ -40,12 +34,6 @@ Cleanup() { } -nomad run nginx.nmd -nomad run discovery.nmd -nomad run broker.nmd -nomad run receiver_tcp.nmd -nomad run authorizer.nmd - mkdir -p $receiver_folder mkdir processed echo hello1 > processed/file1 diff --git a/examples/pipeline/in_to_out/check_windows.bat b/examples/pipeline/in_to_out/check_windows.bat index 57485dbe442e4ae171f7e63641a69aa5a31a4d5a..c2f2b91da85472b63607bea4094d63154d495f8c 100644 --- a/examples/pipeline/in_to_out/check_windows.bat +++ b/examples/pipeline/in_to_out/check_windows.bat @@ -18,8 +18,6 @@ SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\d SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" -call start_services.bat - for /l %%x in (1, 1, 3) do echo db.data_default.insert({"_id":%%x,"size":6,"name":"processed\\file%%x","timestamp":0,"source":"none","buf_id":0,"dataset_substream":0,"meta":{"test":10}}) | %mongo_exe% %indatabase_name% || goto :error mkdir %receiver_folder% @@ -58,7 +56,6 @@ call :clean exit /b 1 :clean -call stop_services.bat echo db.dropDatabase() | %mongo_exe% %indatabase_name% echo db.dropDatabase() | %mongo_exe% %outdatabase_name% diff --git a/examples/pipeline/in_to_out_python/CMakeLists.txt b/examples/pipeline/in_to_out_python/CMakeLists.txt index bdac25363e1a04cf6afa0b7b7ca85ccaaf3feed3..f145b0aa21af7f648495347ea05f1aa63051522b 100644 --- a/examples/pipeline/in_to_out_python/CMakeLists.txt +++ b/examples/pipeline/in_to_out_python/CMakeLists.txt @@ -1,7 +1,5 @@ set(TARGET_NAME pipeline_inout_python) -prepare_asapo() - if (UNIX) get_target_property(PYTHON_LIBS_CONSUMER python-lib-consumer BINARY_DIR) get_target_property(PYTHON_LIBS_PRODUCER python-lib-producer BINARY_DIR) diff --git a/examples/pipeline/in_to_out_python/check_linux.sh b/examples/pipeline/in_to_out_python/check_linux.sh index 12f7444f8c7462af63d647efb8eb1ebed74c4ec1..4a1a7438585878bf130886ffa9405174ef151ab6 100644 --- a/examples/pipeline/in_to_out_python/check_linux.sh +++ b/examples/pipeline/in_to_out_python/check_linux.sh @@ -29,12 +29,6 @@ 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 echo "db.dropDatabase()" | mongo ${indatabase_name} echo "db.dropDatabase()" | mongo ${outdatabase_name} rm -rf processed @@ -43,12 +37,6 @@ Cleanup() { } -nomad run nginx.nmd -nomad run discovery.nmd -nomad run broker.nmd -nomad run receiver_tcp.nmd -nomad run authorizer.nmd - mkdir -p $receiver_folder mkdir processed diff --git a/examples/pipeline/in_to_out_python/check_windows.bat b/examples/pipeline/in_to_out_python/check_windows.bat index ff761ad8262930e138399b75e106c77b25c0e89a..44d24a150d7af85f80ed349772f287b5821a1cb3 100644 --- a/examples/pipeline/in_to_out_python/check_windows.bat +++ b/examples/pipeline/in_to_out_python/check_windows.bat @@ -20,8 +20,6 @@ SET timeout=2 SET timeout_producer=25 SET nthreads=4 -call start_services.bat - for /l %%x in (1, 1, 3) do echo db.data_default.insert({"_id":%%x,"size":6,"name":"processed\\file%%x","timestamp":1,"source":"none","buf_id":0,"dataset_substream":0,"meta":{"test":10}}) | %mongo_exe% %indatabase_name% || goto :error mkdir %receiver_folder% @@ -53,7 +51,6 @@ call :clean exit /b 1 :clean -call stop_services.bat echo db.dropDatabase() | %mongo_exe% %indatabase_name% echo db.dropDatabase() | %mongo_exe% %outdatabase_name% rmdir /S /Q %receiver_root_folder% diff --git a/producer/api/cpp/src/request_handler_tcp.cpp b/producer/api/cpp/src/request_handler_tcp.cpp index 9be95ddd219f83c025a6f36caac4119c65efd22e..00a2337e29056929270e6bf51b71954679148a74 100644 --- a/producer/api/cpp/src/request_handler_tcp.cpp +++ b/producer/api/cpp/src/request_handler_tcp.cpp @@ -302,7 +302,7 @@ void RequestHandlerTcp::PrepareProcessingRequestLocked() { } void RequestHandlerTcp::TearDownProcessingRequestLocked(bool request_processed_successfully) { - if (!request_processed_successfully) { + if (!request_processed_successfully && *ncurrent_connections_>0) { (*ncurrent_connections_)--; } } diff --git a/receiver/unittests/test_datacache.cpp b/receiver/unittests/test_datacache.cpp index 28bbde72be4debc5ba378710724af92784becd4a..ddadfdd5a33ad080a301b87f1d02b183e90b70a2 100644 --- a/receiver/unittests/test_datacache.cpp +++ b/receiver/unittests/test_datacache.cpp @@ -291,13 +291,13 @@ TEST_F(DataCacheTests, GetFreeSlotCreatesCorrectIds) { ASSERT_THAT(c3, Eq(c2 + 1)); ASSERT_THAT(c4, Eq(c3 + 1)); - ASSERT_THAT(t2 - t1, Ge(100)); - ASSERT_THAT(t2 - t1, Le(200)); + ASSERT_THAT(t2, Ne(t1)); + ASSERT_THAT(t2, Ne(t3)); + ASSERT_THAT(t4, Ne(t3)); + ASSERT_THAT(t1, Ne(t3)); + ASSERT_THAT(t4, Ne(t2)); + ASSERT_THAT(t4, Ne(t1)); - ASSERT_THAT(t3 - t2, Ge(10)); - ASSERT_THAT(t3 - t2, Le(20)); - - ASSERT_THAT(t4 - t3, Ge(1)); } } diff --git a/tests/automatic/CMakeLists.txt b/tests/automatic/CMakeLists.txt index 91516687693d29ef8a8f3b564dd76d4866464d8a..bf5f7ca3bc632f771b358b8e0fa5bfce39b44914 100644 --- a/tests/automatic/CMakeLists.txt +++ b/tests/automatic/CMakeLists.txt @@ -1,6 +1,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.7) # needed for fixtures find_package(Threads) +add_subdirectory(common_scripts) + + + add_subdirectory(common/cpp) add_subdirectory(system_io) diff --git a/tests/automatic/authorizer/check_authorize/CMakeLists.txt b/tests/automatic/authorizer/check_authorize/CMakeLists.txt index d0f3cdacc755d427043efb4694a86644f65bc6f4..8cfe77776b571ad3ab80491a5ef9d850be42746c 100644 --- a/tests/automatic/authorizer/check_authorize/CMakeLists.txt +++ b/tests/automatic/authorizer/check_authorize/CMakeLists.txt @@ -20,6 +20,5 @@ configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/auth_secret_admin.ke configure_file(beamtime-metadata-11111111.json beamtime-metadata-11111111.json COPYONLY) configure_file(beamtime-metadata-11111112.json beamtime-metadata-11111112.json COPYONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/settings.json.in settings.json @ONLY) add_script_test("${TARGET_NAME}-authorize" "$<TARGET_PROPERTY:${TARGET_NAME},EXENAME>" nomem ) diff --git a/tests/automatic/authorizer/check_authorize/check_linux.sh b/tests/automatic/authorizer/check_authorize/check_linux.sh index 26864b195cdb1664c240ac87d39f5d1113daa190..ea92dadbc998cf9e6a37b71534d35d24287cf7c1 100644 --- a/tests/automatic/authorizer/check_authorize/check_linux.sh +++ b/tests/automatic/authorizer/check_authorize/check_linux.sh @@ -6,62 +6,56 @@ trap Cleanup EXIT Cleanup() { echo cleanup - kill -9 $authorizeid - sleep 1 } -$@ -config settings.json & -sleep 1 -authorizeid=`echo $!` - -mkdir -p asap3/petra3/gpfs/p00/2019/comissioning/c20180508-000-COM20181 -mkdir -p asap3/petra3/gpfs/p00/2019/data/11000015 -mkdir -p beamline/p07/current -mkdir -p beamline/p08/current -cp beamtime-metadata-11111111.json beamline/p07/current/ -cp beamtime-metadata-11111112.json beamline/p08/current/ +mkdir -p /tmp/asapo/asap3/petra3/gpfs/p00/2019/comissioning/c20180508-000-COM20181 +mkdir -p /tmp/asapo/asap3/petra3/gpfs/p00/2019/data/11000015 +mkdir -p /tmp/asapo/beamline/p07/current +mkdir -p /tmp/asapo/beamline/p08/current +cp beamtime-metadata-11111111.json /tmp/asapo/beamline/p07/current/ +cp beamtime-metadata-11111112.json /tmp/asapo/beamline/p08/current/ #tokens AdminToken=$ASAPO_CREATE_TOKEN echo admin $AdminToken -curl -v --silent -H "Authorization: Bearer $AdminToken" --data '{"Subject": {"beamtimeId":"12345678"},"DaysValid":123,"AccessType":["read"]}' 127.0.0.1:5007/admin/issue --stderr - | tee /dev/stderr | grep "bt_12345678" -curl -v --silent -H "Authorization: Bearer blabla" --data '{"Subject": {"beamtimeId":"12345678"},"DaysValid":123,"AccessType":["read"]}' 127.0.0.1:5007/admin/issue --stderr - | tee /dev/stderr | grep "token does not match" +curl -v --silent -H "Authorization: Bearer $AdminToken" --data '{"Subject": {"beamtimeId":"12345678"},"DaysValid":123,"AccessType":["read"]}' 127.0.0.1:8400/asapo-authorizer/admin/issue --stderr - | tee /dev/stderr | grep "bt_12345678" +curl -v --silent -H "Authorization: Bearer blabla" --data '{"Subject": {"beamtimeId":"12345678"},"DaysValid":123,"AccessType":["read"]}' 127.0.0.1:8400/asapo-authorizer/admin/issue --stderr - | tee /dev/stderr | grep "token does not match" -curl -v --silent --data '{"SourceCredentials":"processed%c20180508-000-COM20181%%detector%","OriginHost":"127.0.0.1:5555"}' 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep c20180508-000-COM20181 -curl -v --silent --data '{"SourceCredentials":"processed%c20180508-000-COM20181%%detector%","OriginHost":"127.0.0.1:5555"}' 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep p00 -curl -v --silent --data '{"SourceCredentials":"processed%c20180508-000-COM20181%%detector%","OriginHost":"127.0.0.1:5555"}' 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep detector +curl -v --silent --data '{"SourceCredentials":"processed%c20180508-000-COM20181%%detector%","OriginHost":"127.0.0.1:5555"}' 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep c20180508-000-COM20181 +curl -v --silent --data '{"SourceCredentials":"processed%c20180508-000-COM20181%%detector%","OriginHost":"127.0.0.1:5555"}' 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep p00 +curl -v --silent --data '{"SourceCredentials":"processed%c20180508-000-COM20181%%detector%","OriginHost":"127.0.0.1:5555"}' 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep detector token=$C20180508_000_COM20181_TOKEN -curl -v --silent --data "{\"SourceCredentials\":\"processed%c20180508-000-COM20181%%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep detector -curl -v --silent --data "{\"SourceCredentials\":\"processed%c20180508-000-COM20181%auto%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep p00 -curl -v --silent --data '{"SourceCredentials":"processed%c20180508-000-COM20181%%detector%bla","OriginHost":"bla"}' 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep 401 +curl -v --silent --data "{\"SourceCredentials\":\"processed%c20180508-000-COM20181%%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep detector +curl -v --silent --data "{\"SourceCredentials\":\"processed%c20180508-000-COM20181%auto%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep p00 +curl -v --silent --data '{"SourceCredentials":"processed%c20180508-000-COM20181%%detector%bla","OriginHost":"bla"}' 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep 401 token=$BT11000015_TOKEN #beamtine not online -curl -v --silent --data "{\"SourceCredentials\":\"raw%11000015%%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep 401 +curl -v --silent --data "{\"SourceCredentials\":\"raw%11000015%%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep 401 token=$BT11000016_TOKEN -curl -v --silent --data "{\"SourceCredentials\":\"raw%11000016%%detector%${token}\",\"OriginHost\":\"bla\"}" 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep 401 +curl -v --silent --data "{\"SourceCredentials\":\"raw%11000016%%detector%${token}\",\"OriginHost\":\"bla\"}" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep 401 token=$BLP07_TOKEN -curl -v --silent --data "{\"SourceCredentials\":\"processed%auto%p07%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep 11111111 -curl -v --silent --data "{\"SourceCredentials\":\"raw%auto%p07%detector%$token\",\"OriginHost\":\"127.0.0.1:5007\"}" 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep 11111111 -curl -v --silent --data "{\"SourceCredentials\":\"raw%auto%p07%detector%$token\",\"OriginHost\":\"127.0.0.1:5007\"}" 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep p07 -curl -v --silent --data "{\"SourceCredentials\":\"raw%auto%p07%detector%$token\",\"OriginHost\":\"127.0.0.1:5007\"}" 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep /asap3/petra3/gpfs/p07/2020/data/11111111 +curl -v --silent --data "{\"SourceCredentials\":\"processed%auto%p07%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep 11111111 +curl -v --silent --data "{\"SourceCredentials\":\"raw%auto%p07%detector%$token\",\"OriginHost\":\"127.0.0.1:8400/asapo-authorizer\"}" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep 11111111 +curl -v --silent --data "{\"SourceCredentials\":\"raw%auto%p07%detector%$token\",\"OriginHost\":\"127.0.0.1:8400/asapo-authorizer\"}" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep p07 +curl -v --silent --data "{\"SourceCredentials\":\"raw%auto%p07%detector%$token\",\"OriginHost\":\"127.0.0.1:8400/asapo-authorizer\"}" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep /asap3/petra3/gpfs/p07/2020/data/11111111 #wrong data in metafile -curl -v --silent --data "{\"SourceCredentials\":\"processed%auto%p08%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep "cannot set meta fields" +curl -v --silent --data "{\"SourceCredentials\":\"processed%auto%p08%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep "cannot set meta fields" #read access -curl -v --silent --data "{\"SourceCredentials\":\"processed%auto%p07%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep read +curl -v --silent --data "{\"SourceCredentials\":\"processed%auto%p07%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep read #write access token=$BLP07_W_TOKEN -curl -v --silent --data "{\"SourceCredentials\":\"processed%auto%p07%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:5007/authorize --stderr - | tee /dev/stderr | grep write +curl -v --silent --data "{\"SourceCredentials\":\"processed%auto%p07%detector%$token\",\"OriginHost\":\"bla\"}" 127.0.0.1:8400/asapo-authorizer/authorize --stderr - | tee /dev/stderr | grep write -rm -rf asap3 beamline \ No newline at end of file +rm -rf /tmp/asapo/asap3 /tmp/asapo/beamline \ No newline at end of file diff --git a/tests/automatic/authorizer/check_authorize/check_windows.bat b/tests/automatic/authorizer/check_authorize/check_windows.bat index 9de7767141f3b1ea8301b2a5d60254bbd394de3e..66e7cb6d48c4ddf5b575cdc3977b42216765ca97 100644 --- a/tests/automatic/authorizer/check_authorize/check_windows.bat +++ b/tests/automatic/authorizer/check_authorize/check_windows.bat @@ -1,13 +1,9 @@ set full_name="%1" set short_name="%~nx1" -start /B "" "%full_name%" -config settings.json - -ping 192.0.2.1 -n 1 -w 1000 > nul - -mkdir asap3\petra3\gpfs\p00\2019\comissioning\c20180508-000-COM20181 -mkdir beamline\p07\current -copy beamtime-metadata-11111111.json beamline\p07\current\ /y +mkdir C:\tmp\asapo\asap3\petra3\gpfs\p00\2019\comissioning\c20180508-000-COM20181 +mkdir C:\tmp\asapo\beamline\p07\current +copy beamtime-metadata-11111111.json C:\tmp\asapo\beamline\p07\current\ /y C:\Curl\curl.exe -v --silent --data "{\"SourceCredentials\":\"processed%%c20180508-000-COM20181%%%%detector%%\",\"OriginHost\":\"127.0.0.1:5555\"}" 127.0.0.1:5007/authorize --stderr - | findstr c20180508-000-COM20181 || goto :error C:\Curl\curl.exe -v --silent --data "{\"SourceCredentials\":\"processed%%c20180508-000-COM20181%%auto%%detector%%\",\"OriginHost\":\"127.0.0.1:5555\"}" 127.0.0.1:5007/authorize --stderr - | findstr p00 || goto :error @@ -25,6 +21,5 @@ call :clean exit /b 1 :clean -Taskkill /IM "%short_name%" /F -rmdir /S /Q asap3 -rmdir /S /Q beamline +rmdir /S /Q C:\tmp\asapo\asap3 +rmdir /S /Q C:\tmp\asapo\beamline diff --git a/tests/automatic/authorizer/check_authorize/settings.json.in b/tests/automatic/authorizer/check_authorize/settings.json.in deleted file mode 100644 index 13950ebea0ad1bc146c59042780fd02020c150a5..0000000000000000000000000000000000000000 --- a/tests/automatic/authorizer/check_authorize/settings.json.in +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Port": 5007, - "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/broker/check_monitoring/CMakeLists.txt b/tests/automatic/broker/check_monitoring/CMakeLists.txt index 05ef150fd611bf31a545ec5573b3acfc4c0db959..db03b79a772502fb2243d103a27293c3b9407cdb 100644 --- a/tests/automatic/broker/check_monitoring/CMakeLists.txt +++ b/tests/automatic/broker/check_monitoring/CMakeLists.txt @@ -3,8 +3,4 @@ set(TARGET_NAME asapo-broker) ################################ # Testing ################################ -prepare_asapo() -configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/broker_settings.json settings.json COPYONLY) - -add_script_test("${TARGET_NAME}-monitoring" "$<TARGET_PROPERTY:${TARGET_NAME},EXENAME> $<TARGET_PROPERTY:asapo,EXENAME>" nomem - ) +add_script_test("${TARGET_NAME}-monitoring" "" nomem) diff --git a/tests/automatic/broker/check_monitoring/check_linux.sh b/tests/automatic/broker/check_monitoring/check_linux.sh index 291a0641dd36041cee3de396f08dabc89dc0fc50..734ffd75b0e3a3595a93d8f7262f71e85f2da10b 100644 --- a/tests/automatic/broker/check_monitoring/check_linux.sh +++ b/tests/automatic/broker/check_monitoring/check_linux.sh @@ -7,42 +7,28 @@ set -e trap Cleanup EXIT Cleanup() { - set +e + set +e echo cleanup influx -execute "drop database ${database_name}" - kill -9 $brokerid - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop authorizer } ! influx -execute "drop database ${database_name}" -nomad run nginx.nmd -nomad run authorizer.nmd -sleep 1 - - token=$BT_DATA_TOKEN +broker=`curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-broker?protocol=v0.3` +echo found broker at $broker -$1 -config settings.json & - -sleep 0.3 - -brokerid=`echo $!` - -groupid=`curl -d '' --silent 127.0.0.1:5005/v0.2/creategroup` +groupid=`curl -d '' --silent $broker/v0.2/creategroup` for i in `seq 1 50`; do - curl --silent 127.0.0.1:5005/v0.2/beamtime/data/source/stream/${groupid}/next?token=$token >/dev/null 2>&1 & + curl --silent $broker/v0.2/beamtime/data/source/stream/${groupid}/next?token=$token >/dev/null 2>&1 & done - sleep 12 -influx -execute "select sum(rate) from RequestsRate" -database=${database_name} -format=json | jq .results[0].series[0].values[0][1] | tee /dev/stderr | grep 51 +influx -execute "select sum(rate) from RequestsRate" -database=${database_name} -format=json | jq .results[0].series[0].values[0][1] diff --git a/tests/automatic/broker/get_last/CMakeLists.txt b/tests/automatic/broker/get_last/CMakeLists.txt index 3b688f5db85a0a377f372e734cbd66264737768f..5b06ea8d750f76bac0d5f5a23ad49fbbc7a75e84 100644 --- a/tests/automatic/broker/get_last/CMakeLists.txt +++ b/tests/automatic/broker/get_last/CMakeLists.txt @@ -3,8 +3,5 @@ set(TARGET_NAME asapo-broker) ################################ # Testing ################################ -prepare_asapo() -configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/broker_settings.json settings.json COPYONLY) - -add_script_test("${TARGET_NAME}-getlast" "$<TARGET_PROPERTY:${TARGET_NAME},EXENAME> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-getlast" "" nomem) diff --git a/tests/automatic/broker/get_last/check_linux.sh b/tests/automatic/broker/get_last/check_linux.sh index c89bc54c841d1b6c32ffecb357ddb16b9e309bda..f3cfc8b57ad4ffc548d82a90a618c686e30a03d8 100644 --- a/tests/automatic/broker/get_last/check_linux.sh +++ b/tests/automatic/broker/get_last/check_linux.sh @@ -10,10 +10,6 @@ trap Cleanup EXIT Cleanup() { echo cleanup echo "db.dropDatabase()" | mongo ${database_name} - kill -9 $brokerid - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop authorizer } echo "db.data_${stream}.insert({"_id":2})" | mongo ${database_name} @@ -21,33 +17,26 @@ echo "db.data_${stream}.insert({"_id":1})" | mongo ${database_name} token=$BT_DATA_TOKEN -nomad run nginx.nmd -nomad run authorizer.nmd -sleep 1 +broker=`curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-broker?protocol=v0.3` +echo found broker at $broker -$1 -config settings.json & +groupid=`curl -d '' --silent $broker/v0.2/creategroup` -sleep 0.3 -brokerid=`echo $!` +curl -v --silent $broker/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - - -groupid=`curl -d '' --silent 127.0.0.1:5005/v0.2/creategroup` - -curl -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - - -curl -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - | grep '"_id":2' -curl -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - | grep '"_id":2' +curl -v --silent $broker/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - | grep '"_id":2' +curl -v --silent $broker/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - | grep '"_id":2' echo "db.data_${stream}.insert({"_id":3})" | mongo ${database_name} -curl -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - | grep '"_id":3' +curl -v --silent $broker/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - | grep '"_id":3' echo "db.data_${stream}.insert({"_id":4})" | mongo ${database_name} -curl -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/${stream}/${groupid}/next?token=$token --stderr - | grep '"_id":1' -curl -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - | grep '"_id":4' +curl -v --silent $broker/v0.2/beamtime/data/detector/${stream}/${groupid}/next?token=$token --stderr - | grep '"_id":1' +curl -v --silent $broker/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - | grep '"_id":4' #with a new group -groupid=`curl -d '' --silent 127.0.0.1:5005/v0.2/creategroup` -curl -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/${stream}/${groupid}/next?token=$token --stderr - | grep '"_id":1' -curl -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - | grep '"_id":4' \ No newline at end of file +groupid=`curl -d '' --silent $broker/v0.2/creategroup` +curl -v --silent $broker/v0.2/beamtime/data/detector/${stream}/${groupid}/next?token=$token --stderr - | grep '"_id":1' +curl -v --silent $broker/v0.2/beamtime/data/detector/${stream}/0/last?token=$token --stderr - | grep '"_id":4' \ No newline at end of file diff --git a/tests/automatic/broker/get_last/check_windows.bat b/tests/automatic/broker/get_last/check_windows.bat index 0de73dda41882495abd00f018a2f24ca87aaf9cc..dacb2771c01cd7bd51af8e337ed1598a792fc70f 100644 --- a/tests/automatic/broker/get_last/check_windows.bat +++ b/tests/automatic/broker/get_last/check_windows.bat @@ -4,40 +4,31 @@ SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" echo db.data_default.insert({"_id":1}) | %mongo_exe% %database_name% || goto :error echo db.data_default.insert({"_id":2}) | %mongo_exe% %database_name% || goto :error -set full_name="%1" -set short_name="%~nx1" - -call start_authorizer.bat - - -start /B "" "%full_name%" -config settings.json - -ping 192.0.2.1 -n 1 -w 5000 > nul - - set token=%BT_DATA_TOKEN% +curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-broker?protocol=v0.3 > broker +set /P broker=< broker -C:\Curl\curl.exe -d '' --silent 127.0.0.1:5005/v0.2/creategroup > groupid +C:\Curl\curl.exe -d '' --silent %broker%/v0.2/creategroup > groupid set /P groupid=< groupid -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/default/0/last?token=%token% --stderr - | findstr /c:\"_id\":2 || goto :error -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/default/0/last?token=%token% --stderr - | findstr /c:\"_id\":2 || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.2/beamtime/data/detector/default/0/last?token=%token% --stderr - | findstr /c:\"_id\":2 || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.2/beamtime/data/detector/default/0/last?token=%token% --stderr - | findstr /c:\"_id\":2 || goto :error echo db.data_default.insert({"_id":3}) | %mongo_exe% %database_name% || goto :error -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/default/0/last?token=%token% --stderr - | findstr /c:\"_id\":3 || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.2/beamtime/data/detector/default/0/last?token=%token% --stderr - | findstr /c:\"_id\":3 || goto :error echo db.data_default.insert({"_id":4}) | %mongo_exe% %database_name% || goto :error -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"_id\":1 || goto :error -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/default/0/last?token=%token% --stderr - | findstr /c:\"_id\":4 || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.2/beamtime/data/detector/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"_id\":1 || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.2/beamtime/data/detector/default/0/last?token=%token% --stderr - | findstr /c:\"_id\":4 || goto :error -C:\Curl\curl.exe -d '' --silent 127.0.0.1:5005/v0.2/creategroup > groupid +C:\Curl\curl.exe -d '' --silent %broker%/v0.2/creategroup > groupid set /P groupid=< groupid -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"_id\":1 || goto :error -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/default/0/last?token=%token% --stderr - | findstr /c:\"_id\":4 || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.2/beamtime/data/detector/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"_id\":1 || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.2/beamtime/data/detector/default/0/last?token=%token% --stderr - | findstr /c:\"_id\":4 || goto :error goto :clean @@ -47,7 +38,6 @@ call :clean exit /b 1 :clean -Taskkill /IM "%short_name%" /F echo db.dropDatabase() | %mongo_exe% %database_name% del /f groupid -call stop_authorizer.bat +del /f broker diff --git a/tests/automatic/broker/get_meta/CMakeLists.txt b/tests/automatic/broker/get_meta/CMakeLists.txt index dc491f8bf71ff293f831de25273b189a82d2e253..64a43e64beae8ea75441b4eca88f9521cda1fa14 100644 --- a/tests/automatic/broker/get_meta/CMakeLists.txt +++ b/tests/automatic/broker/get_meta/CMakeLists.txt @@ -3,9 +3,5 @@ set(TARGET_NAME asapo-broker) ################################ # Testing ################################ -prepare_asapo() -configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/broker_settings.json settings.json COPYONLY) - -add_script_test("${TARGET_NAME}-getmeta" "$<TARGET_PROPERTY:${TARGET_NAME},EXENAME> $<TARGET_PROPERTY:asapo,EXENAME>" nomem - ) +add_script_test("${TARGET_NAME}-getmeta" "" nomem) diff --git a/tests/automatic/broker/get_meta/check_linux.sh b/tests/automatic/broker/get_meta/check_linux.sh index 14b23b4d6368cb4cf2d6f86cf8b01160c96051fe..100138a7a35b130877e7ce570fd7bd363e4b7c88 100644 --- a/tests/automatic/broker/get_meta/check_linux.sh +++ b/tests/automatic/broker/get_meta/check_linux.sh @@ -9,26 +9,16 @@ trap Cleanup EXIT Cleanup() { echo cleanup echo "db.dropDatabase()" | mongo ${database_name} - kill -9 $brokerid - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop authorizer } echo 'db.meta.insert({"_id":0,"data":"test"})' | mongo ${database_name} token=$BT_TEST_TOKEN -nomad run nginx.nmd -nomad run authorizer.nmd -sleep 1 +broker=`curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-broker?protocol=v0.3` +echo found broker at $broker -$1 -config settings.json & - -sleep 0.3 -brokerid=`echo $!` - -curl -v --silent 127.0.0.1:5005/v0.2/beamtime/test/detector/default/0/meta/0?token=$token --stderr - | tee /dev/stderr | grep '"data":"test"' -curl -v --silent 127.0.0.1:5005/v0.2/beamtime/test/detector/default/0/meta/1?token=$token --stderr - | tee /dev/stderr | grep 'no documents' +curl -v --silent $broker/v0.2/beamtime/test/detector/default/0/meta/0?token=$token --stderr - | tee /dev/stderr | grep '"data":"test"' +curl -v --silent $broker/v0.2/beamtime/test/detector/default/0/meta/1?token=$token --stderr - | tee /dev/stderr | grep 'no documents' diff --git a/tests/automatic/broker/get_meta/check_windows.bat b/tests/automatic/broker/get_meta/check_windows.bat index 9e1e9e8d929aea59bf9183230cf6e3bc63acc993..d9b79672ac65a61570bac60e1ade22bb3b9a8964 100644 --- a/tests/automatic/broker/get_meta/check_windows.bat +++ b/tests/automatic/broker/get_meta/check_windows.bat @@ -3,20 +3,14 @@ SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" echo db.meta.insert({"_id":0}) | %mongo_exe% %database_name% || goto :error -set full_name="%1" -set short_name="%~nx1" - -call start_authorizer.bat - -start /B "" "%full_name%" -config settings.json - -ping 192.0.2.1 -n 1 -w 5000 > nul +curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-broker?protocol=v0.3 > broker +set /P broker=< broker set token=%BT_DATA_TOKEN% -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/default/0/meta/0?token=%token% --stderr - | findstr /c:\"_id\":0 || goto :error -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.2/beamtime/data/detector/default/0/meta/1?token=%token% --stderr - | findstr /c:"no documents" || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.2/beamtime/data/detector/default/0/meta/0?token=%token% --stderr - | findstr /c:\"_id\":0 || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.2/beamtime/data/detector/default/0/meta/1?token=%token% --stderr - | findstr /c:"no documents" || goto :error goto :clean @@ -26,7 +20,5 @@ call :clean exit /b 1 :clean -Taskkill /IM "%short_name%" /F echo db.dropDatabase() | %mongo_exe% %database_name% del /f groupid -call stop_authorizer.bat diff --git a/tests/automatic/broker/get_next/CMakeLists.txt b/tests/automatic/broker/get_next/CMakeLists.txt index 1eba288a03006af23d30193982fb3fda054548a1..5caffad4ae41b6c582c87543d2c795cb536ede8b 100644 --- a/tests/automatic/broker/get_next/CMakeLists.txt +++ b/tests/automatic/broker/get_next/CMakeLists.txt @@ -3,9 +3,5 @@ set(TARGET_NAME asapo-broker) ################################ # Testing ################################ -prepare_asapo() -configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/broker_settings.json settings.json COPYONLY) - -add_script_test("${TARGET_NAME}-getnext" "$<TARGET_PROPERTY:${TARGET_NAME},EXENAME> $<TARGET_PROPERTY:asapo,EXENAME>" nomem - ) +add_script_test("${TARGET_NAME}-getnext" "" nomem) diff --git a/tests/automatic/broker/get_next/check_linux.sh b/tests/automatic/broker/get_next/check_linux.sh index 7bce26802ed0e90dbf396aa9f3c349cb1e491001..bcef1d69dbff830086679c027c77828f680dc117 100644 --- a/tests/automatic/broker/get_next/check_linux.sh +++ b/tests/automatic/broker/get_next/check_linux.sh @@ -10,10 +10,6 @@ trap Cleanup EXIT Cleanup() { echo cleanup echo "db.dropDatabase()" | mongo ${database_name} - kill -9 $brokerid - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop authorizer } echo "db.data_${stream}.insert({"_id":2})" | mongo ${database_name} @@ -21,21 +17,15 @@ echo "db.data_${stream}.insert({"_id":1})" | mongo ${database_name} token=$BT_DATA_TOKEN -nomad run nginx.nmd -nomad run authorizer.nmd -sleep 1 +broker=`curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-broker?protocol=v0.3` +echo found broker at $broker -$1 -config settings.json & - -sleep 0.3 -brokerid=`echo $!` - -groupid=`curl -d '' --silent 127.0.0.1:5005/v0.3/creategroup` -curl -v --silent 127.0.0.1:5005/v0.3/beamtime/data/source/${stream}/${groupid}/next?token=$token --stderr - | tee /dev/stderr | grep '"_id":1' -curl -v --silent 127.0.0.1:5005/v0.3/beamtime/data/source/${stream}/${groupid}/next?token=$token --stderr - | tee /dev/stderr | grep '"_id":2' -curl -v --silent 127.0.0.1:5005/v0.3/beamtime/data/source/${stream}/${groupid}/next?token=$token --stderr - | tee /dev/stderr | grep '"id_max":2' +groupid=`curl -d '' --silent $broker/v0.3/creategroup` +curl -v --silent $broker/v0.3/beamtime/data/source/${stream}/${groupid}/next?token=$token --stderr - | tee /dev/stderr | grep '"_id":1' +curl -v --silent $broker/v0.3/beamtime/data/source/${stream}/${groupid}/next?token=$token --stderr - | tee /dev/stderr | grep '"_id":2' +curl -v --silent $broker/v0.3/beamtime/data/source/${stream}/${groupid}/next?token=$token --stderr - | tee /dev/stderr | grep '"id_max":2' # with a new group -groupid=`curl -d '' --silent 127.0.0.1:5005/v0.3/creategroup` -curl -v --silent 127.0.0.1:5005/v0.3/beamtime/data/source/${stream}/${groupid}/next?token=$token --stderr - | tee /dev/stderr | grep '"_id":1' \ No newline at end of file +groupid=`curl -d '' --silent $broker/v0.3/creategroup` +curl -v --silent $broker/v0.3/beamtime/data/source/${stream}/${groupid}/next?token=$token --stderr - | tee /dev/stderr | grep '"_id":1' \ No newline at end of file diff --git a/tests/automatic/broker/get_next/check_windows.bat b/tests/automatic/broker/get_next/check_windows.bat index b32059d4fa1877cb5da876a37f3d6231f00c345b..ba8760fa73377ce49e913da2a9f09f683871d393 100644 --- a/tests/automatic/broker/get_next/check_windows.bat +++ b/tests/automatic/broker/get_next/check_windows.bat @@ -4,26 +4,23 @@ SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" echo db.data_default.insert({"_id":1}) | %mongo_exe% %database_name% || goto :error echo db.data_default.insert({"_id":2}) | %mongo_exe% %database_name% || goto :error -set full_name="%1" -set short_name="%~nx1" - set token=%BT_DATA_TOKEN% -call start_authorizer.bat - -start /B "" "%full_name%" -config settings.json +curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-broker?protocol=v0.3 > broker +set /P broker=< broker -ping 192.0.2.1 -n 1 -w 5000 > nul -C:\Curl\curl.exe -d '' --silent 127.0.0.1:5005/v0.3/creategroup > groupid +C:\Curl\curl.exe -d '' --silent %broker%/v0.3/creategroup > groupid set /P groupid=< groupid -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.3/beamtime/data/source/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"_id\":1 || goto :error -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.3/beamtime/data/source/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"_id\":2 || goto :error -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.3/beamtime/data/source/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"id_max\":2 || goto :error -C:\Curl\curl.exe -d '' --silent 127.0.0.1:5005/v0.3/creategroup > groupid + +C:\Curl\curl.exe -v --silent %broker%/v0.3/beamtime/data/source/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"_id\":1 || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.3/beamtime/data/source/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"_id\":2 || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.3/beamtime/data/source/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"id_max\":2 || goto :error + +C:\Curl\curl.exe -d '' --silent %broker%/v0.3/creategroup > groupid set /P groupid=< groupid -C:\Curl\curl.exe -v --silent 127.0.0.1:5005/v0.3/beamtime/data/source/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"_id\":1 || goto :error +C:\Curl\curl.exe -v --silent %broker%/v0.3/beamtime/data/source/default/%groupid%/next?token=%token% --stderr - | findstr /c:\"_id\":1 || goto :error goto :clean @@ -32,8 +29,6 @@ call :clean exit /b 1 :clean -Taskkill /IM "%short_name%" /F echo db.dropDatabase() | %mongo_exe% %database_name% del /f token -del /f groupid -call stop_authorizer.bat +del /f groupid \ No newline at end of file diff --git a/tests/automatic/broker/read_config/check_windows.bat b/tests/automatic/broker/read_config/check_windows.bat index ed4dfc5f8d36c7c07bca2cae0939f448fae70c9c..97281a411e385794cf45cedd922b25b160079324 100644 --- a/tests/automatic/broker/read_config/check_windows.bat +++ b/tests/automatic/broker/read_config/check_windows.bat @@ -1,10 +1,4 @@ set full_name="%1" -set short_name="%~nx1" - -start /B "" "%full_name%" -config settings_good.json - -ping 192.0.2.1 -n 1 -w 1000 > nul -Taskkill /IM "%short_name%" /F %full_name% -config settings_bad.json 2>&1 | findstr /c:"not set" || goto :error diff --git a/tests/automatic/bug_fixes/consumer_python_memleak/CMakeLists.txt b/tests/automatic/bug_fixes/consumer_python_memleak/CMakeLists.txt index 352d76a2b71a0d16e953d3f91eaac692c6dafbb2..f269003b5152b85fcaf9d5b564362e9dc31fb20f 100644 --- a/tests/automatic/bug_fixes/consumer_python_memleak/CMakeLists.txt +++ b/tests/automatic/bug_fixes/consumer_python_memleak/CMakeLists.txt @@ -1,8 +1,6 @@ set(TARGET_NAME consumer_python_memleak) -prepare_asapo() - if (UNIX) get_target_property(PYTHON_LIBS python-lib-consumer BINARY_DIR) else() diff --git a/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh b/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh index f06e415503d8880ec671ad4cb9523bdeab92aab5..8b10f8421d6a79009b1064cdb8ada072dfc46eb1 100644 --- a/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh +++ b/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh @@ -13,21 +13,12 @@ token=$ASAPO_TEST_RW_TOKEN Cleanup() { echo cleanup rm -rf $fname - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop broker - nomad stop discovery echo "db.dropDatabase()" | mongo ${beamtime_id}_stream } fname=test.dat size=100000000 # 10MB -nomad run nginx.nmd -nomad run discovery.nmd -nomad run broker.nmd - -sleep 1 echo 'db.data_default.insert({"_id":'1',"size":'$size',"name":"'$fname'","timestamp":1,"source":"none","buf_id":0,"dataset_substream":0,"meta":{}})' | mongo ${beamtime_id}_stream dd if=/dev/zero of=$fname bs=$size count=1 diff --git a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/CMakeLists.txt b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/CMakeLists.txt index 08bd8372ea5cd0b79f3fe94dcefebe75facd821e..5ce9b9f96f35b3928af862623d5ea1197e526766 100644 --- a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/CMakeLists.txt +++ b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/CMakeLists.txt @@ -3,9 +3,6 @@ set(TARGET_NAME bugfix_callback) ################################ # Testing ################################ -prepare_asapo() - -prepare_asapo() if (UNIX) get_target_property(PYTHON_LIBS python-lib-producer BINARY_DIR) diff --git a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/bugfix_callback.py b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/bugfix_callback.py index c0858795a1bdf11a15e24bf61b52751c2b574df1..485410e11255acf83f84bb082ace4a60b9f72ba7 100644 --- a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/bugfix_callback.py +++ b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/bugfix_callback.py @@ -28,6 +28,8 @@ class AsapoSender: producer = asapo_producer.create_producer(endpoint,'processed',beamtime,'auto', data_source, token, nthreads, 600000) producer.set_log_level("debug") +print(asapo_producer.__version__) + sender = AsapoSender(producer) meta={} diff --git a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_linux.sh b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_linux.sh index 09e978362f9699b8dd9c2ac69c0b9fe5f4581940..675a58d3f66b89036d0a471bec8716db5616887a 100644 --- a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_linux.sh +++ b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_linux.sh @@ -16,23 +16,11 @@ 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 + echo "db.dropDatabase()" | mongo ${beamtime_id}_${data_source} >/dev/null } 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 diff --git a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_windows.bat b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_windows.bat index 99fff14fb7c41bd6e8c9affba9d90af8638e0cb5..2f605ae7ca9b111e1a3238de2369ed341346181b 100644 --- a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_windows.bat +++ b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_windows.bat @@ -6,10 +6,6 @@ SET receiver_root_folder=c:\tmp\asapo\receiver\files SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\data\%beamtime_id%" 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 @@ -29,7 +25,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% echo db.dropDatabase() | %mongo_exe% %dbname% diff --git a/tests/automatic/bug_fixes/producer_send_after_restart/CMakeLists.txt b/tests/automatic/bug_fixes/producer_send_after_restart/CMakeLists.txt index e974aa40b4671c5f42f49f5f36fa86d1c89e352d..08fb1205fa1cb603692b6d714766ab0586604977 100644 --- a/tests/automatic/bug_fixes/producer_send_after_restart/CMakeLists.txt +++ b/tests/automatic/bug_fixes/producer_send_after_restart/CMakeLists.txt @@ -13,4 +13,4 @@ endif() 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/bug_fixes/producer_send_after_restart/check_linux.sh b/tests/automatic/bug_fixes/producer_send_after_restart/check_linux.sh index ea36e9886b6209ddef6e162e6072b0d3fe6c6bb2..038868ae598c3a7080bd4982fb6b4f602e51f6dd 100644 --- a/tests/automatic/bug_fixes/producer_send_after_restart/check_linux.sh +++ b/tests/automatic/bug_fixes/producer_send_after_restart/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,19 +26,9 @@ Cleanup() { echo cleanup rm -rf ${receiver_root_folder} rm -rf /tmp/asapo/test_in - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop receiver - nomad stop discovery - nomad stop authorizer echo "db.dropDatabase()" | mongo ${beamtime_id}_detector } -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_${network_type}.nmd -nomad run discovery.nmd - sleep 1 mkdir /tmp/asapo/test_in/processed #producer @@ -53,7 +42,7 @@ echo hello > /tmp/asapo/test_in/processed/file1 sleep 1 nomad stop receiver sleep 1 -nomad run receiver_${network_type}.nmd +nomad run receiver_tcp.nmd echo hello > /tmp/asapo/test_in/processed/file1 sleep 1 diff --git a/tests/automatic/bug_fixes/producer_send_after_restart/check_windows.bat b/tests/automatic/bug_fixes/producer_send_after_restart/check_windows.bat index b039195e0a103dc00763d16a212d545d7c804b4f..055e6efbb8bfa4d319d99979d61bd3094678fc46 100644 --- a/tests/automatic/bug_fixes/producer_send_after_restart/check_windows.bat +++ b/tests/automatic/bug_fixes/producer_send_after_restart/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 @@ -10,10 +8,6 @@ set producer_short_name="%~nx1" 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 @@ -46,8 +40,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/bug_fixes/python_deadlock/CMakeLists.txt b/tests/automatic/bug_fixes/python_deadlock/CMakeLists.txt index b4007ef6387cb0aac545de107c108ebf329e5531..b2d5a3ccffc6d6da1d7baee1b6f6ed62149dc3ef 100644 --- a/tests/automatic/bug_fixes/python_deadlock/CMakeLists.txt +++ b/tests/automatic/bug_fixes/python_deadlock/CMakeLists.txt @@ -1,8 +1,6 @@ set(TARGET_NAME python_deadlock_producer) -prepare_asapo() - find_package (Python3 REQUIRED) if (UNIX) diff --git a/tests/automatic/bug_fixes/receiver_cpu_usage/CMakeLists.txt b/tests/automatic/bug_fixes/receiver_cpu_usage/CMakeLists.txt index 15daad97f8c7aaf2a3068d839b12902da6a2ded3..f566fedf0ea5288e3c1dcbadcc0a00b34ee51091 100644 --- a/tests/automatic/bug_fixes/receiver_cpu_usage/CMakeLists.txt +++ b/tests/automatic/bug_fixes/receiver_cpu_usage/CMakeLists.txt @@ -3,7 +3,6 @@ set(TARGET_NAME receiver_cpu_usage) ################################ # Testing ################################ -prepare_asapo() set (ROOT_PATH "/tmp/asapo/") configure_file(test.json.in test.json @ONLY) diff --git a/tests/automatic/bug_fixes/receiver_cpu_usage/check_linux.sh b/tests/automatic/bug_fixes/receiver_cpu_usage/check_linux.sh index 8877ee587ddafbdabadb2fcf61b9ce2a55856564..0d74d4cdd3d26c0ed06ce30f464c2b4e2a159025 100644 --- a/tests/automatic/bug_fixes/receiver_cpu_usage/check_linux.sh +++ b/tests/automatic/bug_fixes/receiver_cpu_usage/check_linux.sh @@ -23,21 +23,9 @@ Cleanup() { kill $producerid rm -rf /tmp/asapo/test_in/test1 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 authorizer echo "db.dropDatabase()" | mongo ${beamtime_id}_detector } -nomad run nginx.nmd -nomad run authorizer.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd - -sleep 1 - #producer mkdir -p ${receiver_folder} $1 test.json & diff --git a/tests/automatic/bug_fixes/streamlist_python_multithread/CMakeLists.txt b/tests/automatic/bug_fixes/streamlist_python_multithread/CMakeLists.txt index 704002fc8e41064709fb34552514a79c2db1cc82..e61d987ed6540510a9f64a20d9df2f0170f1ecdd 100644 --- a/tests/automatic/bug_fixes/streamlist_python_multithread/CMakeLists.txt +++ b/tests/automatic/bug_fixes/streamlist_python_multithread/CMakeLists.txt @@ -1,11 +1,8 @@ set(TARGET_NAME streamlist_python) -prepare_asapo() - find_package (Python3 REQUIRED) - if (UNIX) get_target_property(PYTHON_LIBS python-lib-consumer BINARY_DIR) get_target_property(PYTHON_LIBS_PRODUCER python-lib-producer BINARY_DIR) diff --git a/tests/automatic/bug_fixes/streamlist_python_multithread/check_linux.sh b/tests/automatic/bug_fixes/streamlist_python_multithread/check_linux.sh index 678925935e45b108d355dd5755ddc33f24dc247f..51ab3ef4cd2c5b80a9d4fe7a5f793986a967970b 100644 --- a/tests/automatic/bug_fixes/streamlist_python_multithread/check_linux.sh +++ b/tests/automatic/bug_fixes/streamlist_python_multithread/check_linux.sh @@ -9,24 +9,10 @@ token=$ASAPO_TEST_RW_TOKEN Cleanup() { echo cleanup - nomad stop nginx - nomad run nginx_kill.nmd && nomad stop -yes -purge nginx_kill - nomad stop broker - nomad stop discovery - nomad stop authorizer - nomad stop receiver echo "db.dropDatabase()" | mongo ${beamtime_id}_source_1 echo "db.dropDatabase()" | mongo ${beamtime_id}_source_2 } -nomad run nginx.nmd -nomad run discovery.nmd -nomad run broker.nmd -nomad run receiver_tcp.nmd -nomad run authorizer.nmd - -sleep 1 - export PYTHONPATH=$1:$2:${PYTHONPATH} export Python3_EXECUTABLE=$3 diff --git a/tests/automatic/common_scripts/CMakeLists.txt b/tests/automatic/common_scripts/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..788be8b5476a60d8db49aaf3dc53d55035dc7415 --- /dev/null +++ b/tests/automatic/common_scripts/CMakeLists.txt @@ -0,0 +1,9 @@ +prepare_asapo() + +IF (WIN32) + configure_file(start_services.bat start_services.bat @ONLY) + configure_file(stop_services.bat stop_services.bat @ONLY) +ELSE () + configure_file(start_services.sh start_services.sh @ONLY) + configure_file(stop_services.sh stop_services.sh @ONLY) +ENDIF() diff --git a/tests/automatic/common_scripts/start_authorizer.bat b/tests/automatic/common_scripts/start_authorizer.bat deleted file mode 100644 index de5ada62fd36bcc868e23b0831c2883fc0eb40c2..0000000000000000000000000000000000000000 --- a/tests/automatic/common_scripts/start_authorizer.bat +++ /dev/null @@ -1,24 +0,0 @@ -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 diff --git a/tests/automatic/common_scripts/start_services.bat b/tests/automatic/common_scripts/start_services.bat index 452c5937b596e59ef8c4802d4ba8defb5eb4a495..87f16087a311774bc134cc6092dd9a69ebabca8f 100644 --- a/tests/automatic/common_scripts/start_services.bat +++ b/tests/automatic/common_scripts/start_services.bat @@ -1,10 +1,6 @@ -c:\opt\consul\nomad run receiver_tcp.nmd -c:\opt\consul\nomad run authorizer.nmd -c:\opt\consul\nomad run discovery.nmd -c:\opt\consul\nomad run broker.nmd c:\opt\consul\nomad run nginx.nmd -c:\opt\consul\nomad run file_transfer.nmd - +c:\opt\consul\nomad run discovery.nmd +c:\opt\consul\nomad run authorizer.nmd ping 192.0.2.1 -n 1 -w 3000 > nul @@ -16,10 +12,18 @@ if %i% EQU 20 ( goto :error ) ping 192.0.2.1 -n 1 -w 1000 >nul +curl --silent --fail 127.0.0.1:8400/asapo-discovery/asapo-mongodb --stderr - | findstr 127.0.0.1 || goto :repeat +if %i% EQU 1 ( + c:\opt\consul\nomad run receiver_tcp.nmd + c:\opt\consul\nomad run broker.nmd + c:\opt\consul\nomad run file_transfer.nmd + ping 192.0.2.1 -n 1 -w 3000 > nul +) curl --silent --fail 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.1 --stderr - | findstr 127.0.0.1 || goto :repeat 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 + +echo services ready goto :clean diff --git a/tests/automatic/common_scripts/start_services.sh b/tests/automatic/common_scripts/start_services.sh old mode 100644 new mode 100755 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..5c3f70a7138f9297d572559728bfbaf8c21ded42 --- a/tests/automatic/common_scripts/start_services.sh +++ b/tests/automatic/common_scripts/start_services.sh @@ -0,0 +1,32 @@ +nomad run authorizer.nmd +nomad run discovery.nmd +nomad run nginx.nmd + +while true +do + sleep 1 + echo starting nginx and discovery + curl --silent 127.0.0.1:8400/asapo-discovery/asapo-mongodb --stderr - | grep 127.0.0.1 || continue + echo nginx and discovery started + break +done + + +nomad run file_transfer.nmd +nomad run receiver_tcp.nmd +nomad run broker.nmd + +while true +do + sleep 1 + echo starting services + curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.1 --stderr - | grep 127.0.0.1 || continue + echo recevier started + curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-broker?protocol=v0.1 --stderr - | grep 127.0.0.1 || continue + echo broker started + curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-file-transfer?protocol=v0.1 --stderr - | grep 127.0.0.1 || continue + echo file transfer started + break +done + +echo services ready \ No newline at end of file diff --git a/tests/automatic/common_scripts/stop_authorizer.bat b/tests/automatic/common_scripts/stop_authorizer.bat deleted file mode 100644 index 27b0b30b9ed382e7baee3527e78d392cddea5c1e..0000000000000000000000000000000000000000 --- a/tests/automatic/common_scripts/stop_authorizer.bat +++ /dev/null @@ -1,3 +0,0 @@ -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 diff --git a/tests/automatic/common_scripts/stop_services.sh b/tests/automatic/common_scripts/stop_services.sh old mode 100644 new mode 100755 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d10019f51241296db1aaf37c6a6e7ef0f8613eab --- a/tests/automatic/common_scripts/stop_services.sh +++ b/tests/automatic/common_scripts/stop_services.sh @@ -0,0 +1,7 @@ +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 +nomad stop file_transfer 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..edd7a8216e326579096366985f15a2be9d396238 100644 --- a/tests/automatic/consumer/consumer_api/check_windows.bat +++ b/tests/automatic/consumer/consumer_api/check_windows.bat @@ -6,7 +6,7 @@ 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 +c:\opt\consul\nomad status 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 @@ -39,7 +39,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/consumer_api.cpp b/tests/automatic/consumer/consumer_api/consumer_api.cpp index c1b0269ad30e0ced18a2eacb22a004a49af345c2..26230c93279759c59ca9505b5796e5ac2390edd9 100644 --- a/tests/automatic/consumer/consumer_api/consumer_api.cpp +++ b/tests/automatic/consumer/consumer_api/consumer_api.cpp @@ -327,7 +327,7 @@ void TestAll(const Args& args) { exit(EXIT_FAILURE); } - consumer->SetTimeout(100); + consumer->SetTimeout(1000); auto group_id = consumer->GenerateNewGroupId(&err); if (args.datasets == "single") { 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/consumer/next_multithread_broker/check_windows.bat b/tests/automatic/consumer/next_multithread_broker/check_windows.bat index d995d7cec883a1b6a71059035d6b52d094fe682e..8649820ffe5e4f85b36ad0c9daebf83a7f4dd187 100644 --- a/tests/automatic/consumer/next_multithread_broker/check_windows.bat +++ b/tests/automatic/consumer/next_multithread_broker/check_windows.bat @@ -2,8 +2,6 @@ SET database_name=test_run_detector SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" set token_test_run=%BT_TEST_RUN_TOKEN% -call start_services.bat - for /l %%x in (1, 1, 10) do echo db.data_default.insert({"_id":%%x,"size":100,"name":"%%x","timestamp":0,"source":"none","buf_id":0,"dataset_substream":0,"meta":{"test":10}}) | %mongo_exe% %database_name% || goto :error @@ -16,6 +14,5 @@ call :clean exit /b 1 :clean -call stop_services.bat echo db.dropDatabase() | %mongo_exe% %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 9ff35c7a84548387e451e1addf8d73a3741ca1c4..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 5000 > 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 95a64c6f9305995a47cf602e240e3844cec33ebc..a442e63f4227d6554285670167db9ab334e8c850 100755 --- a/tests/automatic/full_chain/simple_chain/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain/check_linux.sh @@ -23,40 +23,17 @@ 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 5 - 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..9fc0808fa01e5b2957fdb750eeec5c074f5945cc 100644 --- a/tests/automatic/full_chain/simple_chain/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain/check_windows.bat @@ -7,9 +7,6 @@ SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\d 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 +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_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 077e620d4adc24ad6b8d7cd03aaee4557129b51e..165f48f54a0dbeb636017751b44967b1fb209b34 100644 --- a/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh @@ -24,27 +24,11 @@ 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}" } -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 5 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` echo "Start producer" @@ -55,5 +39,4 @@ echo "Start consumer in metadata only mode" $consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 5000 1 1 | tee out grep "Processed 100 dataset(s)" out grep "with 500 file(s)" out -grep -i "Using connection type: No connection" out 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..d666562e80474de97ddd16d04c0b0044901ed785 100644 --- a/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat @@ -6,9 +6,6 @@ SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\d 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 +29,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 58d3eef2061b56fb15a553694bed85d3e28b3229..b2e8905f5967d5b4924ab406e62834acea85cac7 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,9 @@ 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 5 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` echo "Start producer" @@ -58,17 +41,15 @@ sleep 1 mkdir /tmp/asapo/test_in/processed/test1 mkdir /tmp/asapo/test_in/processed/test2 +sleep 1 echo hello > /tmp/asapo/test_in/processed/test1/file1 echo hello > /tmp/asapo/test_in/processed/test1/file2 echo hello > /tmp/asapo/test_in/processed/test2/file1 -sleep 1 - echo "Start consumer in metadata only mode" $consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 1000 1 | tee /dev/stderr out grep "Processed 3 file(s)" out -grep -i "Using connection type: No connection" out test ! -f /tmp/asapo/test_in/processed/test1/file1 test ! -f /tmp/asapo/test_in/processed/test1/file2 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..383366fa1918557fc34053caea329f22270e8fd0 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 @@ -10,10 +8,6 @@ set producer_short_name="%~nx1" 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 +42,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 f8deeae836a5198f4ef0275539a4d83811939821..ca07ab0fe4ad8a6f406ad16ebad722a9dcfb86e0 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,27 +27,10 @@ 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 5 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` #producer @@ -62,6 +44,7 @@ sleep 1 mkdir /tmp/asapo/test_in/processed/test1 mkdir /tmp/asapo/test_in/processed/test2 +sleep 1 echo hello > /tmp/asapo/test_in/processed/test1/file1 echo hello > /tmp/asapo/test_in/processed/test1/file2 @@ -71,7 +54,6 @@ echo "Start consumer in metadata only mode" $consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 2000 1 1 | tee out grep "Processed 1 dataset(s)" out grep "with 3 file(s)" out -grep -i "Using connection type: No connection" out test -f /tmp/asapo/test_in/processed/test1/file1 test -f /tmp/asapo/test_in/processed/test1/file2 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..2a0538172457f0b78efcdfecc9b6024736400a88 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 @@ -10,10 +8,6 @@ set producer_short_name="%~nx1" 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 +41,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 f66cacbaba7e5ca6ce6169969a8630103d6f98dc..b3f7a47aca323086987f0908b55a452b506f539b 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,10 @@ 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 5 - 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 @@ -66,6 +50,8 @@ sleep 1 mkdir -p /tmp/asapo/test_in1/processed/test1 mkdir -p /tmp/asapo/test_in2/processed/test2 +sleep 1 + echo hello > /tmp/asapo/test_in1/processed/test1/file1 echo hello > /tmp/asapo/test_in1/processed/test1/file2 echo hello > /tmp/asapo/test_in2/processed/test2/file1 @@ -75,4 +61,3 @@ echo "Start consumer in metadata only mode" $consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 2000 1 1 | tee out grep "Processed 2 dataset(s)" out grep "with 4 file(s)" out -grep -i "Using connection type: No connection" out 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..5f7a5f9af3d2cbe2ed1ff362d10a0b4bfa06af2d 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 @@ -10,10 +8,6 @@ set producer_short_name="%~nx1" 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 @@ -46,7 +40,6 @@ REM consumer type out.txt findstr /i /l /c:"Processed 2 dataset(s)" out.txt || goto :error findstr /i /l /c:"with 4 file(s)" out.txt || goto :error -findstr /i /l /c:"Using connection type: No connection" out.txt || goto :error goto :clean @@ -55,7 +48,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..c148c993837553e6e5c2ca48a01099828d9a7d1d 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() @@ -12,6 +11,8 @@ endif() configure_file(test.json.in test.json @ONLY) +prepare_asapo() + add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) if (ENABLE_LIBFABRIC) 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 55d4b353fdb114af2148034668fed7e677f5e93b..7c22a733b5cb10e57e9f004b82951b63decd339f 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,37 @@ 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 + while true + do + sleep 1 + curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.1 --stderr - | grep 127.0.0.1 || continue + echo recevier started + break + done + 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 5 +if [[ $network_type == "fabric" ]]; then + nomad stop receiver + nomad run receiver_fabric.nmd + while true + do + sleep 1 + curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.1 --stderr - | grep 127.0.0.1 || continue + echo recevier started + break + done +fi token=`$3 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_cache/check_windows.bat b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_windows.bat index dfde693b8fbd64470c3d8bc5cbd3b6e750548775..ae61bf27db4ff394ff65bba041e7df804a9e9819 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 @@ -10,10 +8,6 @@ set producer_short_name="%~nx1" 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 +27,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 +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_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 8cfcc248787193c79fb3b65b462dde5693d762bd..e3f49565c663a9e7cb61283ff932abf0e0165414 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,26 +28,10 @@ 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 } -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 5 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` @@ -60,6 +43,7 @@ producerid=`echo $!` sleep 1 mkdir /tmp/asapo/test_in/processed/test1 mkdir /tmp/asapo/test_in/processed/test2 +sleep 1 echo -n hello1 > /tmp/asapo/test_in/processed/test1/file1 echo -n hello2 > /tmp/asapo/test_in/processed/test1/file2 @@ -71,5 +55,4 @@ grep "Processed 3 file(s)" out.txt grep "hello1" out.txt grep "hello2" out.txt grep "hello3" out.txt -grep -i "Using connection type: No connection" out.txt 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..186404bc68d1f4883798a0c5e836958d64b2ba3c 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 @@ -10,10 +10,6 @@ set producer_short_name="%~nx1" 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 @@ -42,7 +38,6 @@ findstr /i /l /c:"Processed 3 file(s)" out.txt || goto :error findstr /i /l /c:"hello1" out.txt || goto :error findstr /i /l /c:"hello2" out.txt || goto :error findstr /i /l /c:"hello3" out.txt || goto :error -findstr /i /l /c:"Using connection type: No connection" out.txt || goto :error goto :clean @@ -52,7 +47,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 6735603d72c39e13cdc2d59d6abb21d3eedd58c8..3d9103f83b59123012d41cc5648b4ecb51f95d37 100644 --- a/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh @@ -23,27 +23,11 @@ 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}" } -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 5 - token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` @@ -54,4 +38,3 @@ $producer_bin localhost:8400 ${beamtime_id} 100 0 1 0 1000 echo "Start consumer in metadata only mode" $consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 1000 1 | tee out grep "dummy_meta" out -grep -i "Using connection type: No connection" out 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..fc5283fe047d782f5676a2aa32aa44612420b184 100644 --- a/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat @@ -6,10 +6,6 @@ SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\d 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 +26,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 5ec50d63e024ad3c92c42d345a5c078d3f5a1ba7..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 5 - 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 8df2f77f3984614954a85585921fd6370b773c6d..35d521137e6cece2174f83321a78cba902dbc31b 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 start /B "" "%1" %proxy_address% %beamtime_id% 100 10 4 100 100 ping 192.0.2.1 -n 1 -w 3000 > nul @@ -23,7 +19,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 @@ -32,9 +28,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 edbb9a24d7804afa8ce7c358db16e70ee6723640..53a8e3485a0bd5e016653b430aedf0890e004e9d 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,27 +22,11 @@ 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}" } -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 5 - 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..d965adb884c6392bf721249bec51869cc4d6886e 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 @@ -6,10 +6,6 @@ SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\d 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 +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/two_beamlines/CMakeLists.txt b/tests/automatic/full_chain/two_beamlines/CMakeLists.txt index b4b621b3dca1d4ae1162df26625b5d77a7069f2a..71ec8879ddee42e89de716a7af16a6e7d10a9444 100644 --- a/tests/automatic/full_chain/two_beamlines/CMakeLists.txt +++ b/tests/automatic/full_chain/two_beamlines/CMakeLists.txt @@ -4,8 +4,8 @@ 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) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) if (ENABLE_LIBFABRIC) if (ENABLE_LIBFABRIC_LOCALHOST) add_script_test("${TARGET_NAME}-fabric" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext> $<TARGET_PROPERTY:asapo,EXENAME> fabric" nomem) diff --git a/tests/automatic/full_chain/two_beamlines/check_linux.sh b/tests/automatic/full_chain/two_beamlines/check_linux.sh index 70577f6c619a5ae7a966090d212f431bba87d35e..057dd44c055fd9359f18e312078b51ba722b7c16 100644 --- a/tests/automatic/full_chain/two_beamlines/check_linux.sh +++ b/tests/automatic/full_chain/two_beamlines/check_linux.sh @@ -26,33 +26,37 @@ 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 + while true + do + sleep 1 + curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.1 --stderr - | grep 127.0.0.1 || continue + echo recevier started + break + done + 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}" } -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 5 +if [[ $network_type == "fabric" ]]; then + nomad stop receiver + nomad run receiver_fabric.nmd + while true + do + sleep 1 + curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.1 --stderr - | grep 127.0.0.1 || continue + echo recevier started + break + done +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..c1e4cb978302d3577f8fd3f0cd643056f540c1a4 100644 --- a/tests/automatic/full_chain/two_beamlines/check_windows.bat +++ b/tests/automatic/full_chain/two_beamlines/check_windows.bat @@ -15,11 +15,6 @@ SET receiver_folder2="%receiver_root_folder%\%facility%\gpfs\%beamline2%\%year%\ 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 +47,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 0e70b549b04dddf234a3f9ee3aaf7556228dce0b..59fc1873592249e956ed0d57b0571fcb71e88d69 100644 --- a/tests/automatic/full_chain/two_streams/check_linux.sh +++ b/tests/automatic/full_chain/two_streams/check_linux.sh @@ -27,27 +27,10 @@ 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} } -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 5 - 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..01d64a1de995d530ea6f8d5f1cd1afcbd64dfa3a 100644 --- a/tests/automatic/full_chain/two_streams/check_windows.bat +++ b/tests/automatic/full_chain/two_streams/check_windows.bat @@ -10,11 +10,6 @@ SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\d 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 +35,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/check_linux.sh b/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh index 89a8247cb4cbdf3e36e9c572f893b69b05f33ad0..2e40ee88eaeb8155fd9de4e11c5bd7557ab84f41 100755 --- a/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh +++ b/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh @@ -49,43 +49,31 @@ 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 influx -execute "drop database ${monitor_database_name}" kill_mongo 27015 || kill_mongo 27016 sed -i 's/27015/27017/g' discovery.json.tpl + nomad stop discovery + nomad run discovery.nmd } -sed -i 's/27017/27016/g' receiver_tcp.json.tpl -sed -i 's/27017/27016/g' discovery.json.tpl -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 +sed -i 's/27017/27016/g' discovery.json.tpl +nomad stop discovery nomad run discovery.nmd +nomad stop broker nomad run broker.nmd -sleep 1 +sleep 2 token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id` -echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo --port 27016 ${beamtime_id}_detector - - echo "Start producer" mkdir -p ${receiver_folder} $producer_bin localhost:8400 ${beamtime_id} 100 1000 4 0 100 & 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 d56abbb21fba5d8773db7d5cbf903742ef037bc1..6ce5943adaf3bf7d6c76c80e958a74f2f0862a50 100644 --- a/tests/automatic/high_avail/receiver_mongo_restart/check_linux.sh +++ b/tests/automatic/high_avail/receiver_mongo_restart/check_linux.sh @@ -28,7 +28,6 @@ function start_mongo { } -database_name=db_test beamtime_id=asapo_test beamline=test @@ -37,40 +36,27 @@ facility=test_facility year=2019 receiver_folder=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/data/${beamtime_id} - - 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 + sed -i 's/27016/27017/g' discovery.json.tpl + nomad stop discovery + nomad run discovery.nmd } start_mongo wait_mongo -# create db before consumer starts reading it. todo: git rid of it -echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo --port 27016 ${beamtime_id}_detector - sed -i 's/27017/27016/g' discovery.json.tpl - - -nomad run authorizer.nmd -nomad run nginx.nmd -nomad run receiver_tcp.nmd +nomad stop discovery 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..7043c1ac971b7c8dac5b21cd1b8b3bc02a384a8c 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,35 +24,18 @@ 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` -echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector - 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 +50,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..b576b7e959e9addbd90f46051ca0a5e6c8055994 100644 --- a/tests/automatic/producer/aai/check_windows.bat +++ b/tests/automatic/producer/aai/check_windows.bat @@ -9,11 +9,7 @@ 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% - - -echo db.%dbname%.insert({dummy:1})" | %mongo_exe% %dbname% - -call start_services.bat +SET beamline_dir=c:\tmp\asapo\beamline\p07\current\ mkdir %receiver_folder% mkdir %receiver_folder2% @@ -24,7 +20,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 +43,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..c86f6bd6ae66428eb24dcc37703577a70953d1a3 100644 --- a/tests/automatic/producer/python_api/check_linux.sh +++ b/tests/automatic/producer/python_api/check_linux.sh @@ -16,29 +16,15 @@ 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 } 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..6dbbf441a3e80626d3e7405915e3bf21a49b7fcb 100644 --- a/tests/automatic/producer/python_api/check_windows.bat +++ b/tests/automatic/producer/python_api/check_windows.bat @@ -6,10 +6,6 @@ SET receiver_root_folder=c:\tmp\asapo\receiver\files SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\data\%beamtime_id%" 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 +39,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% echo db.dropDatabase() | %mongo_exe% %dbname% diff --git a/tests/automatic/producer_receiver/CMakeLists.txt b/tests/automatic/producer_receiver/CMakeLists.txt index e70ec3340028482ff5f6fb0da4dadf4939e2580b..fe492ed045288c807437cf76afb50225f44c06a9 100644 --- a/tests/automatic/producer_receiver/CMakeLists.txt +++ b/tests/automatic/producer_receiver/CMakeLists.txt @@ -2,6 +2,6 @@ add_subdirectory(transfer_single_file) add_subdirectory(transfer_single_file_bypass_buffer) add_subdirectory(transfer_datasets) -if (UNIX) - add_subdirectory(check_monitoring) -endif() \ No newline at end of file +#if (UNIX) #removed since monitoring willbe refactored anyway +# add_subdirectory(check_monitoring) +#endif() \ No newline at end of file diff --git a/tests/automatic/producer_receiver/check_monitoring/CMakeLists.txt b/tests/automatic/producer_receiver/check_monitoring/CMakeLists.txt index 80b82ae8e85c275dbd132c72e2838c1cbc7f8545..6ebdc0c1fdde998ce153744c95c17bb2f90578ff 100644 --- a/tests/automatic/producer_receiver/check_monitoring/CMakeLists.txt +++ b/tests/automatic/producer_receiver/check_monitoring/CMakeLists.txt @@ -3,6 +3,4 @@ set(TARGET_NAME receiver) ################################ # Testing ################################ -prepare_asapo() - add_script_test("${TARGET_NAME}-monitoring" "$<TARGET_FILE:dummy-data-producer>" nomem) diff --git a/tests/automatic/producer_receiver/check_monitoring/check_linux.sh b/tests/automatic/producer_receiver/check_monitoring/check_linux.sh index f1579684745cfe43871ab0fb4aafd32e0e16491c..cf0863c9b152382e380a7f0c2d0ef1dc7a0d072a 100644 --- a/tests/automatic/producer_receiver/check_monitoring/check_linux.sh +++ b/tests/automatic/producer_receiver/check_monitoring/check_linux.sh @@ -15,24 +15,12 @@ trap Cleanup EXIT Cleanup() { echo cleanup influx -execute "drop database ${database_name}" - 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 ${beamtime_id}_detector rm -rf ${receiver_root_folder} } mkdir -p ${receiver_folder} -nomad run authorizer.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd -nomad run nginx.nmd - -sleep 1 - $1 localhost:8400 ${beamtime_id} 100 112 4 0 100 sleep 2 diff --git a/tests/automatic/producer_receiver/transfer_datasets/CMakeLists.txt b/tests/automatic/producer_receiver/transfer_datasets/CMakeLists.txt index b29b867f1725f0f4b58f613105a3ceab059e5201..cdc5cb2b46b7a660f900309c0adfaace2db4f76a 100644 --- a/tests/automatic/producer_receiver/transfer_datasets/CMakeLists.txt +++ b/tests/automatic/producer_receiver/transfer_datasets/CMakeLists.txt @@ -3,5 +3,4 @@ set(TARGET_NAME transfer-datasets) ################################ # Testing ################################ -prepare_asapo() add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer>" nomem) diff --git a/tests/automatic/producer_receiver/transfer_datasets/check_linux.sh b/tests/automatic/producer_receiver/transfer_datasets/check_linux.sh index 0847e13fe075c3aa005dfc4ac4902671efd16d06..2207d5a305ee1b0fa8e1288672bbfe7619ab5c16 100644 --- a/tests/automatic/producer_receiver/transfer_datasets/check_linux.sh +++ b/tests/automatic/producer_receiver/transfer_datasets/check_linux.sh @@ -16,26 +16,10 @@ receiver_folder=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/dat Cleanup() { echo cleanup 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 ${beamtime_id}_detector influx -execute "drop database ${database_name}" } -echo "db.dropDatabase()" | mongo ${beamtime_id}_detector - - -# create db before consumer starts reading it. todo: git rid of it -echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector - -nomad run authorizer.nmd -nomad run nginx.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd - mkdir -p ${receiver_folder} $1 localhost:8400 ${beamtime_id} 100 1 1 0 30 3 diff --git a/tests/automatic/producer_receiver/transfer_datasets/check_windows.bat b/tests/automatic/producer_receiver/transfer_datasets/check_windows.bat index 71219ec2eb4868eacbda8b0ca9c0121a6178f16f..f380010943b8129af8061070b21f8961408c1f9b 100644 --- a/tests/automatic/producer_receiver/transfer_datasets/check_windows.bat +++ b/tests/automatic/producer_receiver/transfer_datasets/check_windows.bat @@ -5,10 +5,6 @@ SET receiver_root_folder=c:\tmp\asapo\receiver\files SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\data\%beamtime_id%" -echo db.%beamtime_id%_detector.insert({dummy:1})" | %mongo_exe% %beamtime_id%_detector - -call start_services.bat - mkdir %receiver_folder% "%1" 127.0.0.1:8400 %beamtime_id% 100 1 1 0 30 3 @@ -36,7 +32,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% echo db.dropDatabase() | %mongo_exe% %beamtime_id%_detector diff --git a/tests/automatic/producer_receiver/transfer_single_file/CMakeLists.txt b/tests/automatic/producer_receiver/transfer_single_file/CMakeLists.txt index 7b299ca60c8ad5d3df328007c44f62a58069de24..79a432652dab319da286d20998bb5d0bc80f96e5 100644 --- a/tests/automatic/producer_receiver/transfer_single_file/CMakeLists.txt +++ b/tests/automatic/producer_receiver/transfer_single_file/CMakeLists.txt @@ -3,5 +3,4 @@ set(TARGET_NAME transfer-single-file) ################################ # Testing ################################ -prepare_asapo() add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer>" nomem) diff --git a/tests/automatic/producer_receiver/transfer_single_file/check_linux.sh b/tests/automatic/producer_receiver/transfer_single_file/check_linux.sh index c0d3435cec2d3be4b9a1ba1b9d72f11c3db5c37a..90d116c91ce60bbb7c9a4a4a2ab1b84119ab6477 100644 --- a/tests/automatic/producer_receiver/transfer_single_file/check_linux.sh +++ b/tests/automatic/producer_receiver/transfer_single_file/check_linux.sh @@ -16,27 +16,12 @@ receiver_folder=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/dat Cleanup() { echo cleanup 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 ${beamtime_id}_detector - influx -execute "drop database ${database_name}" + echo "db.dropDatabase()" | mongo ${beamtime_id}_detector + influx -execute "drop database ${database_name}" } -# create db before consumer starts reading it. todo: git rid of it -echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector - -nomad run authorizer.nmd -nomad run nginx.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd - mkdir -p ${receiver_folder} -sleep 1 - $1 localhost:8400 ${beamtime_id} 100 1 1 0 30 ls -ln ${receiver_folder}/processed/1 | awk '{ print $5 }'| grep 100000 diff --git a/tests/automatic/producer_receiver/transfer_single_file/check_windows.bat b/tests/automatic/producer_receiver/transfer_single_file/check_windows.bat index ce3967d729f3737647b4302c4e9d07994c80e9ea..afcbb8dd81b1d2206bd75a52682e8390a86c25ce 100644 --- a/tests/automatic/producer_receiver/transfer_single_file/check_windows.bat +++ b/tests/automatic/producer_receiver/transfer_single_file/check_windows.bat @@ -4,11 +4,6 @@ SET beamline=test SET receiver_root_folder=c:\tmp\asapo\receiver\files SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\data\%beamtime_id%" - -echo db.%beamtime_id%_detector.insert({dummy:1})" | %mongo_exe% %beamtime_id%_detector - -call start_services.bat - mkdir %receiver_folder% "%1" 127.0.0.1:8400 %beamtime_id% 100 1 1 0 30 @@ -27,7 +22,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% echo db.dropDatabase() | %mongo_exe% %beamtime_id%_detector diff --git a/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/CMakeLists.txt b/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/CMakeLists.txt index c203baaa6123e8923e19c175f0d8ab1637d0578f..46f9fe9a400c98dfd5d51551f0a95e8184d37e00 100644 --- a/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/CMakeLists.txt +++ b/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/CMakeLists.txt @@ -3,5 +3,4 @@ set(TARGET_NAME transfer-single-file_bypass) ################################ # Testing ################################ -prepare_asapo() add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer>" nomem) diff --git a/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/check_linux.sh b/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/check_linux.sh index bcd84032b22efe63f53adda3e6cf2259f8be9507..1da3b56b61ce312af68c19ec582e0c2cc6e056c5 100644 --- a/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/check_linux.sh +++ b/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/check_linux.sh @@ -17,27 +17,12 @@ Cleanup() { echo cleanup 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 ${beamtime_id}_detector influx -execute "drop database ${database_name}" } -# create db before consumer starts reading it. todo: git rid of it -echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector - -nomad run authorizer.nmd -nomad run nginx.nmd -nomad run receiver_tcp.nmd -nomad run discovery.nmd - mkdir -p ${receiver_folder} -sleep 1 - $1 localhost:8400 ${beamtime_id} 60000 1 1 0 30 echo "db.data_default.find({"_id":1})" | mongo ${beamtime_id}_detector > out diff --git a/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/check_windows.bat b/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/check_windows.bat index 7ddac5f47c1166e58d6ae55645a2cbea9ed1c07b..bfe4dc45961791ac39cd885616bbe4b01ec43b07 100644 --- a/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/check_windows.bat +++ b/tests/automatic/producer_receiver/transfer_single_file_bypass_buffer/check_windows.bat @@ -4,11 +4,6 @@ SET beamline=test SET receiver_root_folder=c:\tmp\asapo\receiver\files SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\data\%beamtime_id%" - -echo db.%beamtime_id%_detector.insert({dummy:1})" | %mongo_exe% %beamtime_id%_detector - -call start_services.bat - mkdir %receiver_folder% "%1" 127.0.0.1:8400 %beamtime_id% 60000 1 1 0 30 @@ -30,7 +25,6 @@ call :clean exit /b 1 :clean -call stop_services.bat rmdir /S /Q %receiver_root_folder% echo db.dropDatabase() | %mongo_exe% %beamtime_id%_detector diff --git a/tests/automatic/settings/authorizer_settings.json.tpl.lin b/tests/automatic/settings/authorizer_settings.json.tpl.lin index 62e187d4edaf97da92a626c68aa5bcaea2e439d9..0980b029ab5f75ff7c2fc7fc4c6a735eb763ad40 100644 --- a/tests/automatic/settings/authorizer_settings.json.tpl.lin +++ b/tests/automatic/settings/authorizer_settings.json.tpl.lin @@ -1,6 +1,8 @@ { "Port": {{ env "NOMAD_PORT_authorizer" }}, "LogLevel":"debug", + "RootBeamtimesFolder":"/tmp/asapo/asap3", + "CurrentBeamlinesFolder":"/tmp/asapo/beamline", "AlwaysAllowedBeamtimes":[{"beamtimeId":"asapo_test","beamline":"test","corePath":"/tmp/asapo/receiver/files/test_facility/gpfs/test/2019/data/asapo_test", "beamline-path":"/tmp/asapo/receiver/files/beamline/test/current"}, {"beamtimeId":"asapo_test1","beamline":"test1","corePath":"/tmp/asapo/receiver/files/test_facility/gpfs/test1/2019/data/asapo_test1"}, diff --git a/tests/automatic/settings/authorizer_settings.json.tpl.win b/tests/automatic/settings/authorizer_settings.json.tpl.win index 810ad2e5a980e125d782c977aef733820ad1e439..a34aeee04de2331356421a45113a7717f9ffb798 100644 --- a/tests/automatic/settings/authorizer_settings.json.tpl.win +++ b/tests/automatic/settings/authorizer_settings.json.tpl.win @@ -1,6 +1,8 @@ { "Port": {{ env "NOMAD_PORT_authorizer" }}, "LogLevel":"debug", + "RootBeamtimesFolder":"c:\\tmp\\asapo\\asap3", + "CurrentBeamlinesFolder":"c:\\tmp\\asapo\\beamline", "AlwaysAllowedBeamtimes":[{"beamtimeId":"asapo_test","beamline":"test","corePath":"c:\\tmp\\asapo\\receiver\\files\\test_facility\\gpfs\\test\\2019\\data\\asapo_test", "beamline-path":"c:\\tmp\\asapo\\receiver\\files\\beamline\\test\\current"}, {"beamtimeId":"asapo_test1","beamline":"test1","corePath":"c:\\tmp\\asapo\\receiver\\files\\test_facility\\gpfs\\test1\\2019\\data\\asapo_test1"}, diff --git a/tests/automatic/settings/broker_settings.json b/tests/automatic/settings/broker_settings.json index a6fb5a48041ae1550dd1f5ffe797929ebac2b0bd..4847d08451af7849c37e902b8a9d911014558fb8 100644 --- a/tests/automatic/settings/broker_settings.json +++ b/tests/automatic/settings/broker_settings.json @@ -5,6 +5,6 @@ "AuthorizationServer": "localhost:8400/asapo-authorizer", "PerformanceDbName": "db_test", "Port":5005, - "LogLevel":"info", + "LogLevel":"debug", "CheckResendInterval":0 } \ No newline at end of file diff --git a/tests/automatic/settings/broker_settings.json.tpl b/tests/automatic/settings/broker_settings.json.tpl index b79228a7a658f1e465a60a21f4692fb633a5df66..66c5bc9e0e34476cb19c97e829f41757eaf01922 100644 --- a/tests/automatic/settings/broker_settings.json.tpl +++ b/tests/automatic/settings/broker_settings.json.tpl @@ -7,5 +7,5 @@ "CheckResendInterval":0, "PerformanceDbName": "db_test", "Port":{{ env "NOMAD_PORT_broker" }}, - "LogLevel":"info" + "LogLevel":"debug" } \ No newline at end of file