diff --git a/CMakeModules/prepare_asapo.cmake b/CMakeModules/prepare_asapo.cmake index 7ef66d96fc259d1a812691f43e245a7d2205164f..66c7e52517e3af216024fe3c1b3896d0ce37ddac 100644 --- a/CMakeModules/prepare_asapo.cmake +++ b/CMakeModules/prepare_asapo.cmake @@ -27,6 +27,8 @@ function(prepare_asapo) configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/authorizer_settings.json.tpl.win authorizer.json.tpl COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/common_scripts/start_services.bat start_services.bat COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/common_scripts/stop_services.bat stop_services.bat COPYONLY) + configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/common_scripts/start_authorizer.bat start_authorizer.bat COPYONLY) + configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/common_scripts/stop_authorizer.bat stop_authorizer.bat COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/config/nomad/receiver_tcp.nmd.in receiver_tcp.nmd @ONLY) configure_file(${CMAKE_SOURCE_DIR}/config/nomad/nginx_kill_win.nmd nginx_kill.nmd @ONLY) diff --git a/producer/api/cpp/unittests/test_producer_impl.cpp b/producer/api/cpp/unittests/test_producer_impl.cpp index 17d038597992c201a9cba0e9b9281b747bfca28b..13cafa963dfbde3e1fb2e9121e1ee19b938c034a 100644 --- a/producer/api/cpp/unittests/test_producer_impl.cpp +++ b/producer/api/cpp/unittests/test_producer_impl.cpp @@ -59,7 +59,6 @@ TEST(ProducerImpl, Constructor) { ASSERT_THAT(dynamic_cast<asapo::AbstractLogger*>(producer.log__), Ne(nullptr)); ASSERT_THAT(dynamic_cast<asapo::RequestPool*>(producer.request_pool__.get()), Ne(nullptr)); ASSERT_THAT(dynamic_cast<const asapo::HttpClient*>(producer.httpclient__.get()), Ne(nullptr)); - } class ProducerImplTests : public testing::Test { @@ -68,7 +67,7 @@ class ProducerImplTests : public testing::Test { asapo::ProducerRequestHandlerFactory factory{&service}; testing::NiceMock<asapo::MockLogger> mock_logger; testing::NiceMock<MockRequestPull> mock_pull{&factory, &mock_logger}; - std::string expected_server_uri = "test:8400"; + std::string expected_server_uri = "localhost:9400"; asapo::ProducerImpl producer{expected_server_uri, 1, 3600000, asapo::RequestHandlerType::kTcp}; uint64_t expected_size = 100; uint64_t expected_id = 10; diff --git a/tests/automatic/asapo_fabric/parallel_data_transfer.cpp b/tests/automatic/asapo_fabric/parallel_data_transfer.cpp index cf5e490000ce38ef122ca30396ba2a81cc680b1a..ec68b712b4b25f0a8c3bd653d5784cfd0a2cd423 100644 --- a/tests/automatic/asapo_fabric/parallel_data_transfer.cpp +++ b/tests/automatic/asapo_fabric/parallel_data_transfer.cpp @@ -18,7 +18,7 @@ std::future<void> serverIsDoneFuture = serverIsDone.get_future(); constexpr size_t kRdmaSize = 5 * 1024 * 1024; constexpr int kServerThreads = 2; -constexpr int kEachInstanceRuns = 10; +constexpr int kEachInstanceRuns = 3; constexpr int kClientThreads = 4; void ServerChildThread(FabricServer* server, std::atomic<int>* serverTotalRequests, char* expectedRdmaBuffer) { diff --git a/tests/automatic/asapo_fabric/simple_data_transfer.cpp b/tests/automatic/asapo_fabric/simple_data_transfer.cpp index 28a2b9ce6316fe3d429618494c742bd6c9ee403d..86054cb9b2f263a3cd70b62dd55090c897e8a0c6 100644 --- a/tests/automatic/asapo_fabric/simple_data_transfer.cpp +++ b/tests/automatic/asapo_fabric/simple_data_transfer.cpp @@ -17,7 +17,7 @@ std::promise<void> serverIsDone; std::future<void> serverIsDoneFuture = serverIsDone.get_future(); constexpr int kTotalRuns = 3; -constexpr int kEachInstanceRuns = 5; +constexpr int kEachInstanceRuns = 2; constexpr size_t kRdmaSize = 5 * 1024 * 1024; void ServerMasterThread(const std::string& hostname, uint16_t port, char* expectedRdmaBuffer) { diff --git a/tests/automatic/common_scripts/start_authorizer.bat b/tests/automatic/common_scripts/start_authorizer.bat new file mode 100644 index 0000000000000000000000000000000000000000..de5ada62fd36bcc868e23b0831c2883fc0eb40c2 --- /dev/null +++ b/tests/automatic/common_scripts/start_authorizer.bat @@ -0,0 +1,24 @@ +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 cbe15b437378469b298ce4355f6bd4ffa592ef4b..452c5937b596e59ef8c4802d4ba8defb5eb4a495 100644 --- a/tests/automatic/common_scripts/start_services.bat +++ b/tests/automatic/common_scripts/start_services.bat @@ -20,3 +20,11 @@ curl --silent --fail 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol curl --silent --fail 127.0.0.1:8400/asapo-discovery/v0.1/asapo-broker?protocol=v0.1 --stderr - | findstr 127.0.0.1 || goto :repeat curl --silent --fail 127.0.0.1:8400/asapo-discovery/v0.1/asapo-file-transfer?protocol=v0.1 --stderr - | findstr 127.0.0.1 || goto :repeat echo discovery ready + +goto :clean + +:error +echo error starting asapo services +exit /b 1 + +:clean diff --git a/tests/automatic/common_scripts/stop_authorizer.bat b/tests/automatic/common_scripts/stop_authorizer.bat new file mode 100644 index 0000000000000000000000000000000000000000..27b0b30b9ed382e7baee3527e78d392cddea5c1e --- /dev/null +++ b/tests/automatic/common_scripts/stop_authorizer.bat @@ -0,0 +1,3 @@ +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/full_chain/simple_chain_raw/check_windows.bat b/tests/automatic/full_chain/simple_chain_raw/check_windows.bat index 2a62d959a206b1e7378a0eee4076f54a025edafb..35d521137e6cece2174f83321a78cba902dbc31b 100644 --- a/tests/automatic/full_chain/simple_chain_raw/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_raw/check_windows.bat @@ -12,9 +12,8 @@ set proxy_address="127.0.0.1:8400" set /P token=< token REM producer -mkdir %receiver_folder% start /B "" "%1" %proxy_address% %beamtime_id% 100 10 4 100 100 -ping 192.0.2.1 -n 1 -w 1000 > nul +ping 192.0.2.1 -n 1 -w 3000 > nul REM consumer "%2" %proxy_address% "_" %beamtime_id% 2 %token% 5000 1 > out.txt 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 87734e95dfe399f8a099538b9d4ea3aaab456288..1035ccddc5cea98070aa86b32993667619a49849 100644 --- a/tests/automatic/high_avail/receiver_mongo_restart/check_linux.sh +++ b/tests/automatic/high_avail/receiver_mongo_restart/check_linux.sh @@ -70,7 +70,7 @@ start_mongo wait -echo "db.data_default.validate(true)" | mongo --port 27016 ${beamtime_id}_detector +echo "db.data_default.validate({full: true})" | mongo --port 27016 ${beamtime_id}_detector echo processed files: echo "db.data_default.count()" | mongo --port 27016 ${beamtime_id}_detector diff --git a/tests/automatic/system_io/read_subdirectories/CMakeLists.txt b/tests/automatic/system_io/read_subdirectories/CMakeLists.txt index f73702922ef62fc6970dcdb1d8860af15e5a0f36..6b24dd256c0df56f1fafef382d2828af3a4941c4 100644 --- a/tests/automatic/system_io/read_subdirectories/CMakeLists.txt +++ b/tests/automatic/system_io/read_subdirectories/CMakeLists.txt @@ -23,7 +23,7 @@ add_test_setup_cleanup(${TARGET_NAME}) IF(WIN32) add_integration_test(${TARGET_NAME} list_folders "test test\\subtest1test\\subtest1\\subtest2test\\subtest3test\\subtest3\\subtest4") ELSE() - add_integration_test(${TARGET_NAME} list_folders "test test/subtest3test/subtest3/subtest4test/subtest1test/subtest1/subtest2") + add_integration_test(${TARGET_NAME} list_folders "test test/subtest1test/subtest1/subtest2") ENDIF(WIN32) diff --git a/tests/automatic/system_io/read_subdirectories/setup_linux.sh b/tests/automatic/system_io/read_subdirectories/setup_linux.sh index bd288c5178bd4e1c7554978d6627b463cd458643..0f4baaccc8b9d4b30def396e9c4acfe48b359f67 100644 --- a/tests/automatic/system_io/read_subdirectories/setup_linux.sh +++ b/tests/automatic/system_io/read_subdirectories/setup_linux.sh @@ -2,8 +2,6 @@ mkdir -p test/subtest1/subtest2 sleep 0.1 -mkdir -p test/subtest3/subtest4/ -sleep 0.1 mkdir test_noaccess1 chmod -rx test_noaccess1 diff --git a/tests/valgrind.suppressions b/tests/valgrind.suppressions index 2c21d104a09bbf2e4a911e3f38cdbda5e5e16516..5df24de1c40daa0ee06de0720e6b1f4580b66377 100644 --- a/tests/valgrind.suppressions +++ b/tests/valgrind.suppressions @@ -95,7 +95,6 @@ Memcheck:Param socketcall.sendto(msg) fun:send - fun:ofi_send_socket } { asapo_fabric__sockets__leak