diff --git a/examples/consumer/getnext_broker/check_linux.sh b/examples/consumer/getnext_broker/check_linux.sh index 01b701c9be590d9dc02b26686148ed7b23b002a0..501af68251034177639eff18d23c70c6fd055c61 100644 --- a/examples/consumer/getnext_broker/check_linux.sh +++ b/examples/consumer/getnext_broker/check_linux.sh @@ -30,7 +30,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 tcp $source_path $beamtime_id 2 $token_test_run 12000 1 | tee /dev/stderr | grep "Processed 3 file(s)" diff --git a/examples/consumer/getnext_broker/check_windows.bat b/examples/consumer/getnext_broker/check_windows.bat index 6945e1dbade737b50f5f7f8bd1319b3eecbb869f..8dcbc3182374d885ca308d5f7d4b3367d35216c0 100644 --- a/examples/consumer/getnext_broker/check_windows.bat +++ b/examples/consumer/getnext_broker/check_windows.bat @@ -12,7 +12,7 @@ call start_services.bat for /l %%x in (1, 1, 3) do echo db.data_default.insert({"_id":%%x,"size":100,"name":"%%x","lastchange":1,"source":"none","buf_id":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 tcp %source_path% %beamtime_id% 1 %token_test_run% 12000 1 | findstr /c:"Processed 3 file" || goto :error goto :clean :error diff --git a/examples/consumer/getnext_broker_python/check_linux.sh b/examples/consumer/getnext_broker_python/check_linux.sh index b1a508025c94fade1010a2b5f40492e32c791ecb..ea6fb7e5975a9c5d39523aa560800794fb6b3c09 100644 --- a/examples/consumer/getnext_broker_python/check_linux.sh +++ b/examples/consumer/getnext_broker_python/check_linux.sh @@ -36,13 +36,13 @@ export PYTHONPATH=$1:${PYTHONPATH} Python_EXECUTABLE=$2 -$Python_EXECUTABLE getnext.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run $group_id > out +$Python_EXECUTABLE getnext.py 127.0.0.1:8400 tcp $source_path $beamtime_id $token_test_run $group_id > out cat out cat out | grep '"size": 100' cat out | grep '"_id": 1' cat out | grep '"meta_test": "test"' -$Python_EXECUTABLE getnext.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run $group_id> out +$Python_EXECUTABLE getnext.py 127.0.0.1:8400 tcp $source_path $beamtime_id $token_test_run $group_id> out cat out cat out | grep '"_id": 2' diff --git a/examples/consumer/getnext_broker_python/check_windows.bat b/examples/consumer/getnext_broker_python/check_windows.bat index 44980989369cddff912cad3685b940f2c42ef69b..dfdb7ae17e7f7308a1d418bf15ced7d9538ce39a 100644 --- a/examples/consumer/getnext_broker_python/check_windows.bat +++ b/examples/consumer/getnext_broker_python/check_windows.bat @@ -16,22 +16,22 @@ echo db.meta.insert({"_id":0,"meta_test":"test"}) | %mongo_exe% %database_name% set PYTHONPATH=%1 -python3 getnext.py 127.0.0.1:8400 %source_path% %beamtime_id% %token_test_run% %group_id% > out +python3 getnext.py 127.0.0.1:8400 tcp %source_path% %beamtime_id% %token_test_run% %group_id% > out type out type out | findstr /c:"100" || goto :error type out | findstr /c:"\"_id\": 1" || goto :error type out | findstr /c:"\"meta_test\": \"test\"" || goto :error -python3 getnext.py 127.0.0.1:8400 %source_path% %beamtime_id% %token_test_run% %group_id% > out +python3 getnext.py 127.0.0.1:8400 tcp %source_path% %beamtime_id% %token_test_run% %group_id% > out type out type out | findstr /c:"\"_id\": 2" || goto :error -python3 getnext.py 127.0.0.1:8400 %source_path% %beamtime_id% %token_test_run% %group_id% > out +python3 getnext.py 127.0.0.1:8400 tcp %source_path% %beamtime_id% %token_test_run% %group_id% > out type out type out | findstr /c:"\"_id\": 3" || goto :error -python3 getnext.py 127.0.0.1:8400 %source_path% %beamtime_id% %token_test_run% new > out +python3 getnext.py 127.0.0.1:8400 tcp %source_path% %beamtime_id% %token_test_run% new > out type out type out | findstr /c:"100" || goto :error type out | findstr /c:"\"_id\": 1" || goto :error diff --git a/examples/pipeline/in_to_out/check_linux.sh b/examples/pipeline/in_to_out/check_linux.sh index 6490fbadbf464a8708f57769e9b0715bdb28483f..0657d34ade002ce44e078faf20b1e40044fe21bb 100644 --- a/examples/pipeline/in_to_out/check_linux.sh +++ b/examples/pipeline/in_to_out/check_linux.sh @@ -59,7 +59,7 @@ done sleep 1 -$1 127.0.0.1:8400 $source_path $beamtime_id $stream_in $stream_out $token 2 1000 25000 1 > out +$1 127.0.0.1:8400 tcp $source_path $beamtime_id $stream_in $stream_out $token 2 1000 25000 1 > out cat out cat out | grep "Processed 3 file(s)" cat out | grep "Sent 3 file(s)" @@ -70,7 +70,7 @@ cat ${receiver_folder}/file1_${stream_out} | grep hello1 cat ${receiver_folder}/file2_${stream_out} | grep hello2 cat ${receiver_folder}/file3_${stream_out} | grep hello3 -$1 127.0.0.1:8400 $source_path $beamtime_id $stream_in $stream_out2 $token 2 1000 25000 0 > out2 +$1 127.0.0.1:8400 tcp $source_path $beamtime_id $stream_in $stream_out2 $token 2 1000 25000 0 > out2 cat out2 test ! -f ${receiver_folder}/file1_${stream_out2} echo "db.data_default.find({"_id":1})" | mongo ${outdatabase_name2} | tee /dev/stderr | grep ./file1 diff --git a/examples/pipeline/in_to_out/check_windows.bat b/examples/pipeline/in_to_out/check_windows.bat index 9b575777b8fb97ab7f155e0e94c414cafa7fe038..56ef0b8e50e4095ac8d09924faa7a7aa4e634bd1 100644 --- a/examples/pipeline/in_to_out/check_windows.bat +++ b/examples/pipeline/in_to_out/check_windows.bat @@ -29,7 +29,7 @@ echo hello2 > file2 echo hello3 > file3 -"%1" 127.0.0.1:8400 %source_path% %beamtime_id% %stream_in% %stream_out% %token% 2 1000 25000 1 > out +"%1" 127.0.0.1:8400 tcp %source_path% %beamtime_id% %stream_in% %stream_out% %token% 2 1000 25000 1 > out type out findstr /I /L /C:"Processed 3 file(s)" out || goto :error findstr /I /L /C:"Sent 3 file(s)" out || goto :error @@ -41,7 +41,7 @@ findstr /I /L /C:"hello2" %receiver_folder%\file2_%stream_out% || goto :error findstr /I /L /C:"hello3" %receiver_folder%\file3_%stream_out% || goto :error -"%1" 127.0.0.1:8400 %source_path% %beamtime_id% %stream_in% %stream_out2% %token% 2 1000 25000 0 > out2 +"%1" 127.0.0.1:8400 tcp %source_path% %beamtime_id% %stream_in% %stream_out2% %token% 2 1000 25000 0 > out2 type out2 findstr /I /L /C:"Processed 3 file(s)" out2 || goto :error findstr /I /L /C:"Sent 3 file(s)" out2 || goto :error diff --git a/examples/pipeline/in_to_out_python/check_linux.sh b/examples/pipeline/in_to_out_python/check_linux.sh index 330f409736963582fe673954211dd6106b83b8ff..a105639bcff3727216e16f6bb7337f808b68ee4f 100644 --- a/examples/pipeline/in_to_out_python/check_linux.sh +++ b/examples/pipeline/in_to_out_python/check_linux.sh @@ -64,7 +64,7 @@ sleep 1 export PYTHONPATH=$2:$3:${PYTHONPATH} -$1 $4 127.0.0.1:8400 $source_path $beamtime_id $stream_in $stream_out $token $timeout $timeout_producer $nthreads 1 > out +$1 $4 127.0.0.1:8400 tcp $source_path $beamtime_id $stream_in $stream_out $token $timeout $timeout_producer $nthreads 1 > out cat out cat out | grep "Processed 3 file(s)" cat out | grep "Sent 3 file(s)" diff --git a/examples/pipeline/in_to_out_python/check_windows.bat b/examples/pipeline/in_to_out_python/check_windows.bat index b93a7f38c5ac641a5cb51e34b678d1f0debbaa2e..90c4364476e47f153efbb98269689f1c38175d9d 100644 --- a/examples/pipeline/in_to_out_python/check_windows.bat +++ b/examples/pipeline/in_to_out_python/check_windows.bat @@ -32,7 +32,7 @@ echo hello3 > file3 set PYTHONPATH=%2;%3 -"%1" "%4" 127.0.0.1:8400 %source_path% %beamtime_id% %stream_in% %stream_out% %token% %timeout% %timeout_producer% %nthreads% 1 > out +"%1" "%4" 127.0.0.1:8400 tcp %source_path% %beamtime_id% %stream_in% %stream_out% %token% %timeout% %timeout_producer% %nthreads% 1 > out type out findstr /I /L /C:"Processed 3 file(s)" out || goto :error 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 edf36d29606436cd033909680251472d05767f59..ae7b712a2e9090a04b931128f3ea2c57af97b76a 100644 --- a/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh +++ b/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh @@ -35,7 +35,7 @@ export PYTHONPATH=$1:${PYTHONPATH} export Python_EXECUTABLE=$2 -$Python_EXECUTABLE memleak.py $endpoint $path $beamtime_id $token &> out & +$Python_EXECUTABLE memleak.py $endpoint tcp $path $beamtime_id $token &> out & pid=`echo $!` sleep 1 @@ -53,4 +53,4 @@ leak=$(( $mem2 - $mem1 )) cat out echo leak: $leak -test $leak -lt 300000 \ No newline at end of file +test $leak -lt 300000 diff --git a/tests/automatic/bug_fixes/consumer_python_memleak/memleak.py b/tests/automatic/bug_fixes/consumer_python_memleak/memleak.py index 2f5eaac9bc5eeda3289c08e2de21e7828b169f98..28a61f22dd2ec702cd60232a65942b9978a46fd7 100644 --- a/tests/automatic/bug_fixes/consumer_python_memleak/memleak.py +++ b/tests/automatic/bug_fixes/consumer_python_memleak/memleak.py @@ -1,11 +1,11 @@ import asapo_consumer -import time import sys +import time -source, path, beamtime, token = sys.argv[1:] +source, network_type, path, beamtime, token = sys.argv[1:] broker = asapo_consumer.create_server_broker( - source, path,True, beamtime, "stream", token, 1000) + source, path,True, beamtime, "stream", token, 1000, network_type) group_id = broker.generate_group_id() print('generated group id: ', group_id) 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 56a0067a3f0fb59f618d56247db84c8f4141ca15..cea0d39ae010441c92bb22e191294998d5fc32d8 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}" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" 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 dd1302e80034cf7a372169672302f68c4cad0c25..a572806f4eca1327b2912ed74e68a74db5fe3e10 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 @@ -4,6 +4,11 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + beamtime_id=asapo_test monitor_database_name=db_test @@ -31,14 +36,14 @@ Cleanup() { nomad run nginx.nmd nomad run authorizer.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run discovery.nmd sleep 1 #producer mkdir -p ${receiver_folder} -$1 test.json &> output & +$producer_bin test.json &> output & producerid=`echo $!` sleep 1 @@ -47,7 +52,7 @@ echo hello > /tmp/asapo/test_in/test1/file1 sleep 1 nomad stop receiver sleep 1 -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd echo hello > /tmp/asapo/test_in/test1/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 815dffc5431972fd07bd4d8be6c725b7de66a483..1f57631842d6e359292191448883331ae7c5c295 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 @@ -45,7 +45,7 @@ ping 1.0.0.0 -n 10 -w 100 > nul REM consumer -"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 3000 1 | findstr /c:"Processed 3 file(s)" || goto :error +"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 3000 1 | findstr /c:"Processed 3 file(s)" || goto :error goto :clean diff --git a/tests/automatic/consumer/consumer_api/check_linux.sh b/tests/automatic/consumer/consumer_api/check_linux.sh index be6442d3a14a07892bb127f4dcb154865152d2b2..dd9e5e6cea9209b8664e1b861a738270b3d87147 100644 --- a/tests/automatic/consumer/consumer_api/check_linux.sh +++ b/tests/automatic/consumer/consumer_api/check_linux.sh @@ -45,7 +45,7 @@ done echo hello1 > 1 -$@ 127.0.0.1:8400 $beamtime_id $token_test_run single +$@ 127.0.0.1:8400 tcp $beamtime_id $token_test_run single #check datasets echo "db.dropDatabase()" | mongo ${database_name} @@ -65,4 +65,4 @@ done echo hello1 > 1_1 -$@ 127.0.0.1:8400 $beamtime_id $token_test_run datasets +$@ 127.0.0.1:8400 tcp $beamtime_id $token_test_run datasets diff --git a/tests/automatic/consumer/consumer_api/check_windows.bat b/tests/automatic/consumer/consumer_api/check_windows.bat index 6619a5c9653f487133012b6ccd3426b9332e64b9..355c3a5df4c3e7d3c5249f1283b09b9d5cb644bd 100644 --- a/tests/automatic/consumer/consumer_api/check_windows.bat +++ b/tests/automatic/consumer/consumer_api/check_windows.bat @@ -16,7 +16,7 @@ for /l %%x in (1, 1, 5) do echo db.data_stream2.insert({"_id":%%x,"size":6,"name echo hello1 > 1 -%1 127.0.0.1:8400 %beamtime_id% %token_test_run% single || goto :error +%1 127.0.0.1:8400 tcp %beamtime_id% %token_test_run% single || goto :error echo db.dropDatabase() | %mongo_exe% %database_name% @@ -24,7 +24,7 @@ for /l %%x in (1, 1, 10) do echo db.data_default.insert({"_id":%%x,"size":3,"ima echo hello1 > 1_1 -%1 127.0.0.1:8400 %beamtime_id% %token_test_run% datasets || goto :error +%1 127.0.0.1:8400 tcp %beamtime_id% %token_test_run% datasets || goto :error goto :clean diff --git a/tests/automatic/consumer/consumer_api_python/check_linux.sh b/tests/automatic/consumer/consumer_api_python/check_linux.sh index 04f3c058ba108f46132e138160a9900abbeb1dd8..9ad982107460883dde131169e3418c3c03121f10 100644 --- a/tests/automatic/consumer/consumer_api_python/check_linux.sh +++ b/tests/automatic/consumer/consumer_api_python/check_linux.sh @@ -52,7 +52,7 @@ sleep 1 export PYTHONPATH=$1:${PYTHONPATH} export Python_EXECUTABLE=$2 -$Python_EXECUTABLE $3/consumer_api.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run single +$Python_EXECUTABLE $3/consumer_api.py 127.0.0.1:8400 tcp $source_path $beamtime_id $token_test_run single #check datasets echo "db.dropDatabase()" | mongo ${database_name} > /dev/null @@ -71,4 +71,4 @@ do done -$Python_EXECUTABLE $3/consumer_api.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run datasets +$Python_EXECUTABLE $3/consumer_api.py 127.0.0.1:8400 tcp $source_path $beamtime_id $token_test_run datasets diff --git a/tests/automatic/consumer/consumer_api_python/check_windows.bat b/tests/automatic/consumer/consumer_api_python/check_windows.bat index 1b0ade3d5327978c3a7c99f6024dfb13ab04fc04..4e9b1fa1e867ca4c71e7dd0b3b5166443de23167 100644 --- a/tests/automatic/consumer/consumer_api_python/check_windows.bat +++ b/tests/automatic/consumer/consumer_api_python/check_windows.bat @@ -27,13 +27,13 @@ set PYTHONPATH=%1 echo | set /p dummyName="hello1" > %source_path%\1 echo | set /p dummyName="hello1" > %source_path%\1_1 -python %3/consumer_api.py 127.0.0.1:8400 %source_path% %beamtime_id% %token_test_run% single || goto :error +python %3/consumer_api.py 127.0.0.1:8400 tcp %source_path% %beamtime_id% %token_test_run% single || goto :error echo db.dropDatabase() | %mongo_exe% %database_name% for /l %%x in (1, 1, 10) do echo db.data_default.insert({"_id":%%x,"size":3,"images":[{"_id":1, "size":6,"name":"%%x_1","lastchange":1,"source":"none","buf_id":0,"meta":{"test":10}},{"_id":2, "size":6,"name":"%%x_2","lastchange":1,"source":"none","buf_id":0,"meta":{"test":10}},{"_id":3, "size":6,"name":"%%x_3","lastchange":1,"source":"none","buf_id":0,"meta":{"test":10}}]}) | %mongo_exe% %database_name% || goto :error -python %3/consumer_api.py 127.0.0.1:8400 %source_path% %beamtime_id% %token_test_run% datasets || goto :error +python %3/consumer_api.py 127.0.0.1:8400 tcp %source_path% %beamtime_id% %token_test_run% datasets || goto :error goto :clean diff --git a/tests/automatic/consumer/consumer_api_python/consumer_api.py b/tests/automatic/consumer/consumer_api_python/consumer_api.py index 706828c68e38fd4d3b5a06274a9304d7880c5905..9a491dcea4f61c3c8ec475ac5cb052c9db9bc602 100644 --- a/tests/automatic/consumer/consumer_api_python/consumer_api.py +++ b/tests/automatic/consumer/consumer_api_python/consumer_api.py @@ -4,6 +4,7 @@ import asapo_consumer import json import sys + def exit_on_noerr(name): print (name) sys.exit(1) @@ -197,10 +198,10 @@ def check_dataset(broker,group_id_new): else: exit_on_noerr("get_next_dataset4 err") -source, path, beamtime, token, mode = sys.argv[1:] +source, network_type, path, beamtime, token, mode = sys.argv[1:] -broker = asapo_consumer.create_server_broker(source,path,True, beamtime,"",token,60000) -broker_fts = asapo_consumer.create_server_broker(source,path,False, beamtime,"",token,60000) +broker = asapo_consumer.create_server_broker(source,path,True, beamtime,"",token,60000,network_type) +broker_fts = asapo_consumer.create_server_broker(source,path,False, beamtime,"",token,60000,network_type) group_id_new = broker.generate_group_id() @@ -214,4 +215,4 @@ if mode == "datasets": check_dataset(broker,group_id_new) print ("tests done") -sys.exit(0) \ No newline at end of file +sys.exit(0) diff --git a/tests/automatic/consumer/next_multithread_broker/check_linux.sh b/tests/automatic/consumer/next_multithread_broker/check_linux.sh index b4a6c53c924502c5b7a08016da4ae5dd3abf4007..bb15a380e40a3eb881a94aa522e27b9488e80b00 100644 --- a/tests/automatic/consumer/next_multithread_broker/check_linux.sh +++ b/tests/automatic/consumer/next_multithread_broker/check_linux.sh @@ -28,6 +28,6 @@ do echo 'db.data_default.insert({"_id":'$i',"size":100,"name":"'$i'","lastchange":1,"source":"none","buf_id":0,"meta":{"test":10}})' | mongo ${database_name} done -$@ 127.0.0.1:8400 test_run 4 10 $token_test_run +$@ 127.0.0.1:8400 tcp test_run 4 10 $token_test_run diff --git a/tests/automatic/consumer/next_multithread_broker/check_windows.bat b/tests/automatic/consumer/next_multithread_broker/check_windows.bat index 4c4bb2e685d89f1339fd8aaaea08809181e19df6..275660dd2196f816554a9aeb98a55bc141217c75 100644 --- a/tests/automatic/consumer/next_multithread_broker/check_windows.bat +++ b/tests/automatic/consumer/next_multithread_broker/check_windows.bat @@ -7,7 +7,7 @@ call start_services.bat for /l %%x in (1, 1, 10) do echo db.data_default.insert({"_id":%%x,"size":100,"name":"%%x","lastchange":1,"source":"none","buf_id":0,"meta":{"test":10}}) | %mongo_exe% %database_name% || goto :error -%1 127.0.0.1:8400 test_run 4 10 %token_test_run% || goto :error +%1 127.0.0.1:8400 tcp test_run 4 10 %token_test_run% || goto :error goto :clean 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..b42023c8a69d8c310ec465d825ee9857098eeba5 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 @@ -23,7 +23,7 @@ echo -n hello > $file_transfer_folder/aaa dd if=/dev/urandom of=$file_transfer_folder/random bs=1 count=100000 -$1 127.0.0.1:5007 127.0.0.1:5008 $file_transfer_folder +$1 127.0.0.1:5007 tcp 127.0.0.1:5008 $file_transfer_folder cat bbb | tee /dev/stderr | grep hello diff -q random $file_transfer_folder/random 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 7aab2755cce76f6668eba63700022d09ef6bb402..bee5675e2e031d1fb05e9752821a3d475243170c 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 @@ -15,7 +15,7 @@ echo | set /p dummyName="hello" > %file_transfer_folder%\aaa python3 -c "import os;fout=open('%file_transfer_folder%\\random', 'wb');fout.write(os.urandom(100000))" -"%1" 127.0.0.1:5007 127.0.0.1:5008 %file_transfer_folder% || goto :error +"%1" 127.0.0.1:5007 tcp 127.0.0.1:5008 %file_transfer_folder% || goto :error type bbb | findstr /c:"hello" || goto :error diff --git a/tests/automatic/full_chain/send_recv_substreams/CMakeLists.txt b/tests/automatic/full_chain/send_recv_substreams/CMakeLists.txt index 2eff5008291dff153400eb9194ff409f014dadf3..7ddfbbfbea7efa3dd31162a130bd557e15cf3f17 100644 --- a/tests/automatic/full_chain/send_recv_substreams/CMakeLists.txt +++ b/tests/automatic/full_chain/send_recv_substreams/CMakeLists.txt @@ -11,5 +11,5 @@ set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY prepare_asapo() -add_script_test("${TARGET_NAME}" "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}" nomem) +add_script_test("${TARGET_NAME}-tcp" "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME} tcp" nomem) diff --git a/tests/automatic/full_chain/send_recv_substreams/check_linux.sh b/tests/automatic/full_chain/send_recv_substreams/check_linux.sh index d5200e4033973394be3860a94bdedc9926db3e30..11acb1162cf6999b5cbece16bb7a02e0bd2dbf89 100644 --- a/tests/automatic/full_chain/send_recv_substreams/check_linux.sh +++ b/tests/automatic/full_chain/send_recv_substreams/check_linux.sh @@ -13,6 +13,8 @@ set -e trap Cleanup EXIT +network_type=$2 + Cleanup() { set +e nomad stop nginx @@ -27,9 +29,9 @@ Cleanup() { nomad run nginx.nmd nomad run discovery.nmd nomad run broker.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run authorizer.nmd -$1 127.0.0.1:8400 $beamtime_id $token > out +$1 127.0.0.1:8400 $network_type $beamtime_id $token > out cat out diff --git a/tests/automatic/full_chain/send_recv_substreams/check_windows.bat b/tests/automatic/full_chain/send_recv_substreams/check_windows.bat index d89ca68c8e229b56fd09562bfa1712b2463490f6..aa3d9d96086bcebcfc37ce8210ecd3274324bfbb 100644 --- a/tests/automatic/full_chain/send_recv_substreams/check_windows.bat +++ b/tests/automatic/full_chain/send_recv_substreams/check_windows.bat @@ -12,7 +12,7 @@ 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% +"%1" 127.0.0.1:8400 "%2" %beamtime_id% %token% goto :clean diff --git a/tests/automatic/full_chain/send_recv_substreams/send_recv_substreams.cpp b/tests/automatic/full_chain/send_recv_substreams/send_recv_substreams.cpp index 3b901888d67249aa4f75e2c8f1454c81ee95fe49..3fa8a1b7a36da215b07d092c66c6518cb0beb7e3 100644 --- a/tests/automatic/full_chain/send_recv_substreams/send_recv_substreams.cpp +++ b/tests/automatic/full_chain/send_recv_substreams/send_recv_substreams.cpp @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) { Args args; if (argc != 5) { std::cout << "Usage: " + std::string{argv[0]} - + " <server> <beamtime_id> <token>" + + " <server> <network_type> <beamtime_id> <token>" << std::endl; exit(EXIT_FAILURE); diff --git a/tests/automatic/full_chain/send_recv_substreams_python/CMakeLists.txt b/tests/automatic/full_chain/send_recv_substreams_python/CMakeLists.txt index 4312c3ca1e80f8d6b9e7530323d2ffaea2fb99cd..10a9c04a6fc0d18bb4faee7ff987bc7e23a07ab6 100644 --- a/tests/automatic/full_chain/send_recv_substreams_python/CMakeLists.txt +++ b/tests/automatic/full_chain/send_recv_substreams_python/CMakeLists.txt @@ -11,4 +11,4 @@ endif() file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/send_recv_substreams.py TEST_SCRIPT ) -add_script_test("${TARGET_NAME}" "${Python_EXECUTABLE} ${PYTHON_LIBS_CONSUMER} ${PYTHON_LIBS_PRODUCER} ${TEST_SCRIPT} " nomem) +add_script_test("${TARGET_NAME}-tcp" "${Python_EXECUTABLE} ${PYTHON_LIBS_CONSUMER} ${PYTHON_LIBS_PRODUCER} ${TEST_SCRIPT} tcp" nomem) diff --git a/tests/automatic/full_chain/send_recv_substreams_python/check_linux.sh b/tests/automatic/full_chain/send_recv_substreams_python/check_linux.sh index 34bc1850b7cbd839ee86989a7c2710f953132cf0..d33ffb364042592565a11f3e92ced775d15e8b91 100644 --- a/tests/automatic/full_chain/send_recv_substreams_python/check_linux.sh +++ b/tests/automatic/full_chain/send_recv_substreams_python/check_linux.sh @@ -13,6 +13,8 @@ set -e trap Cleanup EXIT +network_type=$5 + Cleanup() { set +e nomad stop nginx @@ -27,11 +29,11 @@ Cleanup() { nomad run nginx.nmd nomad run discovery.nmd nomad run broker.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run authorizer.nmd export PYTHONPATH=$2:$3:${PYTHONPATH} -$1 $4 127.0.0.1:8400 $beamtime_id $token +$1 $4 127.0.0.1:8400 $network_type $beamtime_id $token diff --git a/tests/automatic/full_chain/send_recv_substreams_python/check_windows.bat b/tests/automatic/full_chain/send_recv_substreams_python/check_windows.bat index 475943c379ac9a534bfd8afb91e9616585f9b055..35313f6bab2c8cd37d1ec405161c9ea38930b578 100644 --- a/tests/automatic/full_chain/send_recv_substreams_python/check_windows.bat +++ b/tests/automatic/full_chain/send_recv_substreams_python/check_windows.bat @@ -12,7 +12,7 @@ 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% +"%1" 127.0.0.1:8400 "%5" %beamtime_id% %token% goto :clean diff --git a/tests/automatic/full_chain/send_recv_substreams_python/send_recv_substreams.py b/tests/automatic/full_chain/send_recv_substreams_python/send_recv_substreams.py index 60ad65264b71f728a5f16c2a8babfb3d03d9c2f4..2ba5b4bca87a0e6dd99496575c5fc97223e744ec 100644 --- a/tests/automatic/full_chain/send_recv_substreams_python/send_recv_substreams.py +++ b/tests/automatic/full_chain/send_recv_substreams_python/send_recv_substreams.py @@ -3,10 +3,8 @@ from __future__ import print_function import asapo_consumer import asapo_producer import sys -import os - - import threading + lock = threading.Lock() timeout = 10 * 1000 @@ -25,9 +23,9 @@ def callback(header,err): print ("successfuly sent: ",header) lock.release() -source, beamtime, token = sys.argv[1:] +source, network_type, beamtime, token = sys.argv[1:] -broker = asapo_consumer.create_server_broker(source,".",True, beamtime,"",token,timeout) +broker = asapo_consumer.create_server_broker(source,".",True, beamtime,"",token,timeout,network_type) producer = asapo_producer.create_producer(source,beamtime,'auto', "", token, 1, 600) producer.set_log_level("debug") diff --git a/tests/automatic/full_chain/simple_chain/CMakeLists.txt b/tests/automatic/full_chain/simple_chain/CMakeLists.txt index 1f7374efe1954591b0c95d5a8c9f064686481780..ddb11f8a8abbd03cfcf333819b99e14792148c75 100644 --- a/tests/automatic/full_chain/simple_chain/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain/CMakeLists.txt @@ -4,4 +4,8 @@ set(TARGET_NAME full_chain_simple_chain) # Testing ################################ prepare_asapo() -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) + +if (ENABLE_LIBFABRIC) + add_script_test("${TARGET_NAME}-fabric" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> fabric" nomem) +endif() diff --git a/tests/automatic/full_chain/simple_chain/check_linux.sh b/tests/automatic/full_chain/simple_chain/check_linux.sh old mode 100644 new mode 100755 index 10e5accc1ead8801b6e7f1fb21429360fb6cd078..c0aecc7eb81cac570ed05b64c66e6a71c4520cb9 --- a/tests/automatic/full_chain/simple_chain/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain/check_linux.sh @@ -4,8 +4,13 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + beamtime_id=asapo_test -token=`$3 token -secret auth_secret.key $beamtime_id` +token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id` monitor_database_name=db_test proxy_address=127.0.0.1:8400 @@ -39,18 +44,18 @@ echo "db.dropDatabase()" | mongo ${beamtime_id}_detector nomad run nginx.nmd nomad run authorizer.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run discovery.nmd nomad run broker.nmd sleep 1 -#producer +echo "Start producer" mkdir -p ${receiver_folder} -$1 localhost:8400 ${beamtime_id} 100 1000 4 0 100 +$producer_bin localhost:8400 ${beamtime_id} 100 1000 4 0 100 #producerid=`echo $!` - -$2 ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 5000 1 > out +echo "Start consumer in $network_type mode" +$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 5000 1 | tee out cat out -cat out | grep "Processed 1000 file(s)" +cat out | grep "Processed 1000 file(s)" diff --git a/tests/automatic/full_chain/simple_chain/check_windows.bat b/tests/automatic/full_chain/simple_chain/check_windows.bat index fd9244556c2a3c0775a069d8d7aac95d63bfaa49..8a131a4da9deafdb22a54dfedc6c7e9427493a80 100644 --- a/tests/automatic/full_chain/simple_chain/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain/check_windows.bat @@ -21,7 +21,7 @@ start /B "" "%1" %proxy_address% %beamtime_id% 100 1000 4 0 100 ping 1.0.0.0 -n 1 -w 100 > nul REM consumer -"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 5000 1 > out.txt +"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 5000 1 > out.txt type out.txt findstr /i /l /c:"Processed 1000 file(s)" out.txt || goto :error diff --git a/tests/automatic/full_chain/simple_chain_dataset/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_dataset/CMakeLists.txt index c66bfad61d973da55b0573a5e1599d753853accb..cf7580f6ea6f586300e671d29792dd31600bed1a 100644 --- a/tests/automatic/full_chain/simple_chain_dataset/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_dataset/CMakeLists.txt @@ -4,4 +4,4 @@ set(TARGET_NAME full_chain_simple_chain_dataset) # Testing ################################ prepare_asapo() -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<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 cd32be6d23691f0fac8a943667eb82fcdf02868b..ef78b0f411a807bd9d62089a168394af63bb4600 100644 --- a/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh @@ -4,8 +4,13 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + beamtime_id=asapo_test -token=`$3 token -secret auth_secret.key $beamtime_id` +token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id` monitor_database_name=db_test proxy_address=127.0.0.1:8400 @@ -35,20 +40,18 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec nomad run nginx.nmd nomad run authorizer.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run discovery.nmd nomad run broker.nmd sleep 1 -#producer +echo "Start producer" mkdir -p ${receiver_folder} -$1 localhost:8400 ${beamtime_id} 100 100 4 0 100 5 & - - +$producer_bin localhost:8400 ${beamtime_id} 100 100 4 0 100 5 & -$2 ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 5000 1 1 > out -cat out +echo "Start consumer in $network_type mode" +$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 5000 1 1 | tee out cat out | grep "Processed 100 dataset(s)" cat out | grep "with 500 file(s)" 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 e1273b93924409a1e8e41093276405b4e3927861..ec20845c9567cac2e75913d69d97b0c1ab4e829d 100644 --- a/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat @@ -20,7 +20,7 @@ start /B "" "%1" %proxy_address% %beamtime_id% 100 100 4 0 100 5 ping 1.0.0.0 -n 1 -w 100 > nul REM consumer -"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 5000 1 1 > out.txt +"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 5000 1 1 > out.txt type out.txt findstr /i /l /c:"Processed 100 dataset(s)" out.txt || goto :error findstr /i /l /c:"with 500 file(s)" out.txt || goto :error diff --git a/tests/automatic/full_chain/simple_chain_filegen/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_filegen/CMakeLists.txt index 768562c03d2341c99607114de84028cef78ac9c6..8bd0d723e8f5e9fd26f0413495370b9391cf327c 100644 --- a/tests/automatic/full_chain/simple_chain_filegen/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_filegen/CMakeLists.txt @@ -12,4 +12,4 @@ endif() configure_file(test.json.in test.json @ONLY) -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" 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 4a560c00a6233125331108faab1d337becbc5316..8f1f34581b92b75bf6a6e89e14b9ed9395c060cb 100644 --- a/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh @@ -4,8 +4,13 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + beamtime_id=asapo_test -token=`$3 token -secret auth_secret.key $beamtime_id` +token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id` monitor_database_name=db_test proxy_address=127.0.0.1:8400 @@ -38,15 +43,15 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec nomad run nginx.nmd nomad run authorizer.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run discovery.nmd nomad run broker.nmd sleep 1 -#producer +echo "Start producer" mkdir -p ${receiver_folder} -$1 test.json & +$producer_bin test.json & producerid=`echo $!` sleep 1 @@ -55,7 +60,8 @@ echo hello > /tmp/asapo/test_in/test1/file1 echo hello > /tmp/asapo/test_in/test1/file2 echo hello > /tmp/asapo/test_in/test2/file2 -$2 ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 1000 1 | tee /dev/stderr | grep "Processed 3 file(s)" +echo "Start consumer in $network_type mode" +$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 1000 1 | tee /dev/stderr | grep "Processed 3 file(s)" test ! -f /tmp/asapo/test_in/test1/file1 test ! -f /tmp/asapo/test_in/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 500e19ccdfdafaaa065ad5b4f4898523fcd0642c..2db77cfb9bcec34eda2ca9b60df01ebd2b49b558 100644 --- a/tests/automatic/full_chain/simple_chain_filegen/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_filegen/check_windows.bat @@ -34,7 +34,7 @@ ping 1.0.0.0 -n 10 -w 100 > nul REM consumer -"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 1000 1 > out.txt +"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 1000 1 > out.txt type out.txt findstr /i /l /c:"Processed 3 file(s)" out.txt || goto :error 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 c319a11ec8fbd3ac56918c0879d365c47c277f81..6a8d10614a88cb7b2e722efe226c1a7d70d64b5c 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_batches/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_filegen_batches/CMakeLists.txt @@ -12,4 +12,4 @@ endif() configure_file(test.json.in test.json @ONLY) -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" 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 6b0e8f42b062b4c829c42b8f7a22041b899fcfd5..e745aaabc58c1006dc862d8e800009ecd75f36bc 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 @@ -4,8 +4,13 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + beamtime_id=asapo_test -token=`$3 token -secret auth_secret.key $beamtime_id` +token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id` monitor_database_name=db_test proxy_address=127.0.0.1:8400 @@ -39,15 +44,15 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec nomad run nginx.nmd nomad run authorizer.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run discovery.nmd nomad run broker.nmd sleep 1 -#producer +echo "Start producer" mkdir -p ${receiver_folder} -$1 test.json & +$producer_bin test.json & producerid=`echo $!` sleep 1 @@ -56,8 +61,8 @@ echo hello > /tmp/asapo/test_in/test1/file1 echo hello > /tmp/asapo/test_in/test1/file2 echo hello > /tmp/asapo/test_in/test2/file2 -$2 ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 2000 1 1 > out -cat out +echo "Start consumer in $network_type mode" +$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 2000 1 1 | tee out cat out | grep "Processed 1 dataset(s)" cat out | grep "with 3 file(s)" 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 5c5e7017ff72cda4c99cce9c5f30753bbdb60bfc..5a17e13932238e5d1fb92a3fd1ef96544d97b0ac 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 @@ -34,7 +34,7 @@ ping 1.0.0.0 -n 10 -w 100 > nul REM consumer -"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 1000 1 1 > out.txt +"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 1000 1 1 > out.txt type out.txt findstr /i /l /c:"Processed 1 dataset(s)" out.txt || goto :error findstr /i /l /c:"with 3 file(s)" out.txt || goto :error 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 16d6a270f0b362ddea8b6180f08e23427ff7599d..bd3159a78cce04b3127003b5f040d97f85ff1a19 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_multisource/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_filegen_multisource/CMakeLists.txt @@ -15,4 +15,4 @@ configure_file(test.json.in test1.json @ONLY) SET (ID 2) configure_file(test.json.in test2.json @ONLY) -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" 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 bcc11e5633157f571e53f61c9a1bd64d2135124c..526aba56a3152b28611a84c1fb986fe59e4cce15 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 @@ -4,8 +4,13 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + beamtime_id=asapo_test -token=`$3 token -secret auth_secret.key $beamtime_id` +token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id` monitor_database_name=db_test proxy_address=127.0.0.1:8400 @@ -40,20 +45,21 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec nomad run nginx.nmd nomad run authorizer.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run discovery.nmd nomad run broker.nmd sleep 1 mkdir -p ${receiver_folder} -#producer1 -$1 test1.json & + +echo "Start producer 1" +$producer_bin test1.json & producerid1=`echo $!` -#producer2 -$1 test2.json & -producerid2=`echo $!` +echo "Start producer 2" +$producer_bin test2.json & +producerid2=`echo $!` sleep 1 @@ -62,7 +68,7 @@ echo hello > /tmp/asapo/test_in/test1/file2 echo hello > /tmp/asapo/test_in/test2/file1 echo hello > /tmp/asapo/test_in/test2/file2 -$2 ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 2000 1 1 > out -cat out +echo "Start consumer in $network_type mode" +$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 2000 1 1 | tee out cat out | grep "Processed 2 dataset(s)" cat out | grep "with 4 file(s)" 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 a8cf1670079f3c700aa5e395cc4dd8d8fbb1f1eb..918ebbef320bc3f3679caba119a51c85a0c45838 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 @@ -40,7 +40,7 @@ ping 1.0.0.0 -n 10 -w 100 > nul REM consumer -"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 1000 1 1 > out.txt +"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 1000 1 1 > out.txt 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 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 7acab0298869b8bd336b8c6d5dd610aebd638451..88c78aa100caeb36cbd5e2243a16d48d16c2ceac 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 @@ -13,4 +13,8 @@ endif() configure_file(test.json.in test.json @ONLY) -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) + +if (ENABLE_LIBFABRIC) + add_script_test("${TARGET_NAME}-fabric" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> fabric" nomem) +endif() 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 e23dd713f4a359ea2388da8ec642550f04ecdcdf..adbae687c09f19e275e14dcf1f00ad1b99eef21f 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 @@ -4,6 +4,11 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + beamtime_id=asapo_test token=`$3 token -secret auth_secret.key $beamtime_id` @@ -40,15 +45,15 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec nomad run nginx.nmd nomad run authorizer.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run discovery.nmd nomad run broker.nmd sleep 1 -#producer +echo "Start producer" mkdir -p ${receiver_folder} -$1 test.json & +$producer_bin test.json & producerid=`echo $!` sleep 1 @@ -57,8 +62,8 @@ echo -n hello1 > /tmp/asapo/test_in/test1/file1 echo -n hello2 > /tmp/asapo/test_in/test1/file2 echo -n hello3 > /tmp/asapo/test_in/test2/file2 -$2 ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 1000 0 > out.txt -cat out.txt +echo "Start consumer in $network_type mode" +$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 1000 0 | tee out.txt grep "Processed 3 file(s)" out.txt grep "hello1" out.txt grep "hello2" out.txt 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 1e3fcd21031106b6e5fd830611bdfe60ffcd8ea6..d83c345113f4f9d976449a8570a1d504b45fa9a9 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 @@ -34,7 +34,7 @@ ping 1.0.0.0 -n 10 -w 100 > nul REM consumer -"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 1000 0 > out.txt +"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 1000 0 > out.txt type out.txt findstr /i /l /c:"Processed 3 file(s)" out.txt || goto :error findstr /i /l /c:"hello1" out.txt || goto :error 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 b5bfac21ef5109e54f34d314bcf07a4f9b7f9f93..c54130a4ac26bcdfb6c7b5adf3a92830141642c9 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 @@ -13,4 +13,4 @@ endif() configure_file(test.json.in test.json @ONLY) -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" 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 b0ea5b8c10833dacc54f48449bca1e13333877af..0212ef329acdd9e71d0260f90d57138020ed589d 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 @@ -4,8 +4,13 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + beamtime_id=asapo_test -token=`$3 token -secret auth_secret.key $beamtime_id` +token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id` monitor_database_name=db_test proxy_address=127.0.0.1:8400 @@ -39,15 +44,15 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec nomad run nginx.nmd nomad run authorizer.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run discovery.nmd nomad run broker.nmd sleep 1 -#producer +echo "Start producer" mkdir -p ${receiver_folder} -$1 test.json & +$producer_bin test.json & producerid=`echo $!` sleep 1 @@ -56,8 +61,8 @@ echo -n hello1 > /tmp/asapo/test_in/test1/file1 echo -n hello2 > /tmp/asapo/test_in/test1/file2 echo -n hello3 > /tmp/asapo/test_in/test2/file2 -$2 ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 1000 0 > out.txt -cat out.txt +echo "Start consumer in $network_type mode" +$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 1000 0 | tee out.txt grep "Processed 3 file(s)" out.txt grep "hello1" out.txt grep "hello2" 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 dc674898e8a6de37125f77147c700529e6628394..d83c345113f4f9d976449a8570a1d504b45fa9a9 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 @@ -34,7 +34,7 @@ ping 1.0.0.0 -n 10 -w 100 > nul REM consumer -"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 1000 0 > out.txt +"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 1000 0 > out.txt type out.txt findstr /i /l /c:"Processed 3 file(s)" out.txt || goto :error findstr /i /l /c:"hello1" out.txt || goto :error diff --git a/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt index 4ac8f929ab76fb3a26be3e2acbcccc5b6a7cb7b6..dfc7e117e50e98be1833b31ea12ef8be20e9850c 100644 --- a/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt @@ -4,4 +4,4 @@ set(TARGET_NAME full_chain_simple_chain_meta) # Testing ################################ prepare_asapo() -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" 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 9927a1974002f072100d13b5ae0dfd9b0d795f11..34d5eda326af0b073fe7c2599a06cd3318e2526e 100644 --- a/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh @@ -4,8 +4,13 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + beamtime_id=asapo_test -token=`$3 token -secret auth_secret.key $beamtime_id` +token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id` monitor_database_name=db_test proxy_address=127.0.0.1:8400 @@ -35,16 +40,16 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec nomad run nginx.nmd nomad run authorizer.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run discovery.nmd nomad run broker.nmd sleep 1 -#producer +echo "Start producer" mkdir -p ${receiver_folder} -$1 localhost:8400 ${beamtime_id} 100 0 1 0 1000 +$producer_bin localhost:8400 ${beamtime_id} 100 0 1 0 1000 -$2 ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 1000 1 > out -cat out +echo "Start consumer in $network_type mode" +$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 1000 1 | tee out cat out | grep "dummy_meta" 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 9dbba7db3e8c1d8487c9d0ccc19eb20d0e9226ea..030dcec927654af9192480d31ccdc6c93fa5f7b6 100644 --- a/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat +++ b/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat @@ -18,7 +18,7 @@ mkdir %receiver_folder% "%1" %proxy_address% %beamtime_id% 100 0 1 0 1000 REM consumer -"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 5000 1 > out.txt +"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 5000 1 > out.txt type out.txt findstr /i /l /c:"dummy_meta" out.txt || goto :error 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 956e8dea68e05bdafdb875447c7dfd4d6c857475..6ef2935a356916f5a7ec9409c9aa4cf70026d36d 100644 --- a/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt +++ b/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt @@ -12,4 +12,4 @@ else() endif() -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_PROPERTY:asapo,EXENAME> ${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_LIBS} ${Python_EXECUTABLE}" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_PROPERTY:asapo,EXENAME> ${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_LIBS} ${Python_EXECUTABLE} tcp" 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 8c50be8667a14fa758d43dceb67b93abab1e6bb0..3a64f5856e162b71834039c9916743ed92024584 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 @@ -4,8 +4,12 @@ set -e trap Cleanup EXIT +producer_bin=$1 +asapo_tool_bin=$2 +network_type=$6 + beamtime_id=asapo_test -token=`$2 token -secret auth_secret.key $beamtime_id` +token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id` monitor_database_name=db_test proxy_address=127.0.0.1:8400 @@ -35,21 +39,20 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec nomad run nginx.nmd nomad run authorizer.nmd -nomad run receiver_tcp.nmd +nomad run receiver_${network_type}.nmd nomad run discovery.nmd nomad run broker.nmd sleep 2 -#producer +echo "Start producer" mkdir -p ${receiver_folder} -$1 localhost:8400 ${beamtime_id} 100 100 1 0 100 +$producer_bin localhost:8400 ${beamtime_id} 100 100 1 0 100 export PYTHONPATH=$4:${PYTHONPATH} export Python_EXECUTABLE=$5 - -$Python_EXECUTABLE $3/get_user_meta.py $proxy_address $receiver_folder $beamtime_id $token new > out -cat out +echo "Start python consumer in $network_type mode" +$Python_EXECUTABLE $3/get_user_meta.py $proxy_address $network_type $receiver_folder $beamtime_id $token new | tee out cat out | grep "found images: 100" cat out | grep "test100" 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 3fc487795810b2546dc28f6a45a2ab93fe69f801..35b072e06cfcc9a005c1ef9391230afa48f37d99 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 @@ -21,7 +21,7 @@ mkdir %receiver_folder% REM consumer set PYTHONPATH=%4 -python3 %3/get_user_meta.py %proxy_address% %receiver_folder% %beamtime_id% %token% new > out +python3 %3/get_user_meta.py %proxy_address% "%6" %receiver_folder% %beamtime_id% %token% new > out type out type out | findstr /c:"found images: 100" || goto :error type out | findstr /c:"test100" || goto :error diff --git a/tests/automatic/full_chain/simple_chain_usermeta_python/get_user_meta.py b/tests/automatic/full_chain/simple_chain_usermeta_python/get_user_meta.py index 5fb497e041b462bf7290286f805bf1fe646c0737..b72fbbea3dbbbe5fc8b6acba214e4368c955d2cd 100644 --- a/tests/automatic/full_chain/simple_chain_usermeta_python/get_user_meta.py +++ b/tests/automatic/full_chain/simple_chain_usermeta_python/get_user_meta.py @@ -1,12 +1,11 @@ from __future__ import print_function import asapo_consumer -import json import sys -source, path, beamtime, token, group_id = sys.argv[1:] +source, network_type, path, beamtime, token, group_id = sys.argv[1:] -broker = asapo_consumer.create_server_broker(source,path,True, beamtime,"",token,60000) +broker = asapo_consumer.create_server_broker(source,path,True, beamtime,"",token,60000,network_type) images = broker.query_images("meta.user_meta regexp 'test*' order by _id") diff --git a/tests/automatic/full_chain/two_beamlines/CMakeLists.txt b/tests/automatic/full_chain/two_beamlines/CMakeLists.txt index 5a352cfc77a224b717ed42e5fe0b89efb086c1f2..6b3d480a5680cb18072491b48a51d37db9b2588a 100644 --- a/tests/automatic/full_chain/two_beamlines/CMakeLists.txt +++ b/tests/automatic/full_chain/two_beamlines/CMakeLists.txt @@ -4,4 +4,4 @@ set(TARGET_NAME full_chain_two_beamlines) # Testing ################################ prepare_asapo() -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) diff --git a/tests/automatic/full_chain/two_beamlines/check_linux.sh b/tests/automatic/full_chain/two_beamlines/check_linux.sh index 085acee5e3ef5b66f2f9a9993fa14c5538db5177..472f98e7ded93fd2fb209f4644a366fdebd1f792 100644 --- a/tests/automatic/full_chain/two_beamlines/check_linux.sh +++ b/tests/automatic/full_chain/two_beamlines/check_linux.sh @@ -4,13 +4,18 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + stream=detector beamtime_id1=asapo_test1 -token1=`$3 token -secret auth_secret.key $beamtime_id1` +token1=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id1` beamtime_id2=asapo_test2 -token2=`$3 token -secret auth_secret.key $beamtime_id2` +token2=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id2` monitor_database_name=db_test proxy_address=127.0.0.1:8400 @@ -51,13 +56,13 @@ nomad run broker.nmd sleep 3 -#producer +echo "Start producers" mkdir -p ${receiver_folder1} mkdir -p ${receiver_folder2} -$1 localhost:8400 ${beamtime_id1} 100 1000 4 0 100 & -$1 localhost:8400 ${beamtime_id2} 100 900 4 0 100 & +$producer_bin localhost:8400 ${beamtime_id1} 100 1000 4 0 100 & +$producer_bin localhost:8400 ${beamtime_id2} 100 900 4 0 100 & #producerid=`echo $!` -#consumers -$2 ${proxy_address} ${receiver_folder1} ${beamtime_id1} 2 $token1 12000 0 | tee /dev/stderr | grep "Processed 1000 file(s)" -$2 ${proxy_address} ${receiver_folder2} ${beamtime_id2} 2 $token2 12000 0 | tee /dev/stderr | grep "Processed 900 file(s)" +echo "Start consumers in $network_type mode" +$consumer_bin ${proxy_address} $network_type ${receiver_folder1} ${beamtime_id1} 2 $token1 12000 0 | tee /dev/stderr | grep "Processed 1000 file(s)" +$consumer_bin ${proxy_address} $network_type ${receiver_folder2} ${beamtime_id2} 2 $token2 12000 0 | tee /dev/stderr | grep "Processed 900 file(s)" diff --git a/tests/automatic/full_chain/two_beamlines/check_windows.bat b/tests/automatic/full_chain/two_beamlines/check_windows.bat index b0c5259143f98ad9710033b7a6fc13d6faf70425..cc8f94fe57dcc9fdffa3416f825b52a6a8cf187f 100644 --- a/tests/automatic/full_chain/two_beamlines/check_windows.bat +++ b/tests/automatic/full_chain/two_beamlines/check_windows.bat @@ -33,11 +33,11 @@ start /B "" "%1" %proxy_address% %beamtime_id2% 100 900 4 0 100 ping 1.0.0.0 -n 1 -w 100 > nul REM consumer -"%2" %proxy_address% %receiver_folder1% %beamtime_id1% 2 %token1% 12000 0 > out1.txt +"%2" %proxy_address% "%4" %receiver_folder1% %beamtime_id1% 2 %token1% 12000 0 > out1.txt type out1.txt findstr /i /l /c:"Processed 1000 file(s)" out1.txt || goto :error -"%2" %proxy_address% %receiver_folder2% %beamtime_id2% 2 %token2% 12000 0 > out2.txt +"%2" %proxy_address% "%4" %receiver_folder2% %beamtime_id2% 2 %token2% 12000 0 > out2.txt type out2.txt findstr /i /l /c:"Processed 900 file(s)" out2.txt || goto :error diff --git a/tests/automatic/full_chain/two_streams/CMakeLists.txt b/tests/automatic/full_chain/two_streams/CMakeLists.txt index 35ce65b50d944f713621826b17d82f8797ba1b87..505c1ff22dde1cbc00fcb4a4a1a08f62d4e04795 100644 --- a/tests/automatic/full_chain/two_streams/CMakeLists.txt +++ b/tests/automatic/full_chain/two_streams/CMakeLists.txt @@ -4,4 +4,4 @@ set(TARGET_NAME full_chain_two_streams) # Testing ################################ prepare_asapo() -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<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 eac8e3c4cb96a893037dcb3700146102777426ff..be07a78bd5751dbda366632f071586bd240d149f 100644 --- a/tests/automatic/full_chain/two_streams/check_linux.sh +++ b/tests/automatic/full_chain/two_streams/check_linux.sh @@ -4,8 +4,13 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + beamtime_id=asapo_test -token=`$3 token -secret auth_secret.key $beamtime_id` +token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id` stream1=s1 stream2=s2 @@ -44,12 +49,11 @@ nomad run broker.nmd sleep 3 -#producer +echo "Start producers" mkdir -p ${receiver_folder} -$1 localhost:8400 ${beamtime_id}%${stream1} 100 1000 4 0 100 & -$1 localhost:8400 ${beamtime_id}%${stream2} 100 900 4 0 100 & - +$producer_bin localhost:8400 ${beamtime_id}%${stream1} 100 1000 4 0 100 & +$producer_bin localhost:8400 ${beamtime_id}%${stream2} 100 900 4 0 100 & -#consumers -$2 ${proxy_address} ${receiver_folder} ${beamtime_id}%${stream1} 2 $token 10000 0 | tee /dev/stderr | grep "Processed 1000 file(s)" -$2 ${proxy_address} ${receiver_folder} ${beamtime_id}%${stream2} 2 $token 10000 0 | tee /dev/stderr | grep "Processed 900 file(s)" +echo "Start consumers in $network_type mode" +$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id}%${stream1} 2 $token 10000 0 | tee /dev/stderr | grep "Processed 1000 file(s)" +$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id}%${stream2} 2 $token 10000 0 | tee /dev/stderr | grep "Processed 900 file(s)" diff --git a/tests/automatic/full_chain/two_streams/check_windows.bat b/tests/automatic/full_chain/two_streams/check_windows.bat index fd2b9268da99a3c4ab0f715ae04b05fc0d095895..89dcd5dc4096e5e5f23288b77c0185db03b6a652 100644 --- a/tests/automatic/full_chain/two_streams/check_windows.bat +++ b/tests/automatic/full_chain/two_streams/check_windows.bat @@ -24,11 +24,11 @@ start /B "" "%1" %proxy_address% %beamtime_id%%%%stream2% 100 900 4 0 100 ping 1.0.0.0 -n 1 -w 100 > nul REM consumer -"%2" %proxy_address% %receiver_folder% %beamtime_id%%%%stream1% 2 %token% 12000 0 > out1.txt +"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id%%%%stream1% 2 %token% 12000 0 > out1.txt type out1.txt findstr /i /l /c:"Processed 1000 file(s)" out1.txt || goto :error -"%2" %proxy_address% %receiver_folder% %beamtime_id%%%%stream2% 2 %token% 12000 0 > out2.txt +"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id%%%%stream2% 2 %token% 12000 0 > out2.txt type out2.txt findstr /i /l /c:"Processed 900 file(s)" out2.txt || goto :error diff --git a/tests/automatic/high_avail/broker_mongo_restart/CMakeLists.txt b/tests/automatic/high_avail/broker_mongo_restart/CMakeLists.txt index 0ba1d0de4810af2b0cdc35cbb688b7a7e2f8f043..244d2522065c3899e612801b4eaddc32b93491f4 100644 --- a/tests/automatic/high_avail/broker_mongo_restart/CMakeLists.txt +++ b/tests/automatic/high_avail/broker_mongo_restart/CMakeLists.txt @@ -5,4 +5,4 @@ set(TARGET_NAME broker_mongo_restart) ################################ set(RECEIVER_WRITE_TO_DISK false) prepare_asapo() -add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem) +add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem) diff --git a/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh b/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh index 6e59dc8f27ce41fe799da1f39a14faa3b0d6fa45..0f455e6202c4fbad878b2d6b15d74d1a0d73dcbf 100755 --- a/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh +++ b/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh @@ -4,8 +4,13 @@ set -e trap Cleanup EXIT SIGHUP SIGINT SIGTERM +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$4 + beamtime_id=asapo_test -token=`$3 token -secret auth_secret.key $beamtime_id` +token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id` monitor_database_name=db_test proxy_address=127.0.0.1:8400 @@ -79,15 +84,15 @@ sleep 1 echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo --port 27016 ${beamtime_id}_detector - -#producer +echo "Start producer" mkdir -p ${receiver_folder} -$1 localhost:8400 ${beamtime_id} 100 1000 4 0 100 & +$producer_bin localhost:8400 ${beamtime_id} 100 1000 4 0 100 & producerid=`echo $!` wait -$2 ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 10000 0 &> output.txt & +echo "Start consumer in $network_type mode" +$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 10000 0 &> output.txt & workerid=`echo $!` sleep 2 diff --git a/tests/automatic/high_avail/services_restart/CMakeLists.txt b/tests/automatic/high_avail/services_restart/CMakeLists.txt index 145bef8eea3c490a6542bdff10ab239113239433..b62a7b6f95a462ad2a2d4ab4c384907e21436892 100644 --- a/tests/automatic/high_avail/services_restart/CMakeLists.txt +++ b/tests/automatic/high_avail/services_restart/CMakeLists.txt @@ -5,5 +5,5 @@ set(TARGET_NAME service_restart) ################################ set(RECEIVER_WRITE_TO_DISK false) prepare_asapo() -add_script_test("${TARGET_NAME}-all" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> broker 1000 998" nomem) -add_script_test("${TARGET_NAME}-all-but-broker" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> receiver_tcp 1000 1000" nomem) +add_script_test("${TARGET_NAME}-all-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<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_broker> $<TARGET_PROPERTY:asapo,EXENAME> receiver 1000 1000 tcp" nomem) diff --git a/tests/automatic/high_avail/services_restart/check_linux.sh b/tests/automatic/high_avail/services_restart/check_linux.sh index 8fbbed131376e42ccde20fa51f2d3d8a0014c4c2..434e13eb1123559347678f51db3e109c9a016da3 100644 --- a/tests/automatic/high_avail/services_restart/check_linux.sh +++ b/tests/automatic/high_avail/services_restart/check_linux.sh @@ -4,8 +4,13 @@ set -e trap Cleanup EXIT +producer_bin=$1 +consumer_bin=$2 +asapo_tool_bin=$3 +network_type=$7 + beamtime_id=asapo_test -token=`$3 token -secret auth_secret.key $beamtime_id` +token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id` monitor_database_name=db_test proxy_address=127.0.0.1:8400 @@ -36,15 +41,12 @@ sleep 1 echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detector - - -#producer -$1 localhost:8400 ${beamtime_id} 100 $5 4 0 100 & +echo "Start producer" +$producer_bin localhost:8400 ${beamtime_id} 100 $5 4 0 100 & #producerid=`echo $!` - -#consumer -$2 ${proxy_address} dummy_path ${beamtime_id} 2 $token 30000 1 &> output.txt & +echo "Start consumer in $network_type mode" +$consumer_bin ${proxy_address} $network_type dummy_path ${beamtime_id} 2 $token 30000 1 &> output.txt & sleep 1 @@ -58,9 +60,13 @@ nomad stop receiver nomad run nginx.nmd nomad run authorizer.nmd nomad run discovery.nmd -nomad run receiver_tcp.nmd +nomad run receiver_$7.nmd -nomad run $4.nmd +if ["$4" = "receiver"]; then + nomad run $4_$7.nmd +else + nomad run $4.nmd +fi wait diff --git a/tests/manual/python_tests/consumer/consumer_api.py b/tests/manual/python_tests/consumer/consumer_api.py index 0aa14cb8dbd215b7fe7538d8815a8180af9c6d39..b11cb9907707fd44c44f9e4616e655b21b919305 100644 --- a/tests/manual/python_tests/consumer/consumer_api.py +++ b/tests/manual/python_tests/consumer/consumer_api.py @@ -3,8 +3,8 @@ from __future__ import print_function import asapo_consumer import sys -source, path,beamtime, token = sys.argv[1:] -broker = asapo_consumer.create_server_broker(source,path,False, beamtime,"",token,1000) +source, network_type, path, beamtime, token = sys.argv[1:] +broker = asapo_consumer.create_server_broker(source,path,False, beamtime,"",token,1000,network_type) group_id = broker.generate_group_id() @@ -17,4 +17,4 @@ print (meta) print (len(data),data[0:100]) data.tofile("out") -sys.exit(0) \ No newline at end of file +sys.exit(0) diff --git a/tests/manual/python_tests/consumer/test.sh b/tests/manual/python_tests/consumer/test.sh index 6b5254e86fc977cf3afda84823a48a00f5ae6386..b093b5757b0a7eaeaadf858dfc05fab6193365eb 100644 --- a/tests/manual/python_tests/consumer/test.sh +++ b/tests/manual/python_tests/consumer/test.sh @@ -1 +1 @@ -python3 consumer_api.py asapo-services.desy.de:8400 asapo_test /shared_data/test_facility/gpfs/test/2019/data/asapo_test KmUDdacgBzaOD3NIJvN1NmKGqWKtx0DK-NyPjdpeWkc= \ No newline at end of file +python3 consumer_api.py asapo-services.desy.de:8400 tcp asapo_test /shared_data/test_facility/gpfs/test/2019/data/asapo_test KmUDdacgBzaOD3NIJvN1NmKGqWKtx0DK-NyPjdpeWkc= diff --git a/tests/manual/python_tests/consumer/test_asap3.sh b/tests/manual/python_tests/consumer/test_asap3.sh index 6f43030a3abde5128a9d4ba282437cddd0ab4785..1f22a9782ed42c3c032717cbe117b3e6db5d62a0 100755 --- a/tests/manual/python_tests/consumer/test_asap3.sh +++ b/tests/manual/python_tests/consumer/test_asap3.sh @@ -1,3 +1,3 @@ export PYTHONPATH=/Users/yakubov/projects/asapo/cmake-build-debug/consumer/api/python export token=KmUDdacgBzaOD3NIJvN1NmKGqWKtx0DK-NyPjdpeWkc= -python3 consumer_api.py asap3-utl.desy.de:8400 /gpfs/asapo/shared/test_dir/test_facility/gpfs/test/2019/data/asapo_test asapo_test $token +python3 consumer_api.py asap3-utl.desy.de:8400 tcp /gpfs/asapo/shared/test_dir/test_facility/gpfs/test/2019/data/asapo_test asapo_test $token diff --git a/tests/manual/python_tests/consumer/test_k8s.sh b/tests/manual/python_tests/consumer/test_k8s.sh index 3cd69a940ae900b7c389d53eff4922a05bf30eb3..fc1052a555f6772a9c34bc708d9f3a3f8dda4b87 100755 --- a/tests/manual/python_tests/consumer/test_k8s.sh +++ b/tests/manual/python_tests/consumer/test_k8s.sh @@ -1,4 +1,4 @@ export PYTHONPATH=/Users/yakubov/projects/asapo/cmake-build-debug/consumer/api/python export token=IEfwsWa0GXky2S3MkxJSUHJT1sI8DD5teRdjBUXVRxk= -python3 consumer_api.py gest-k8s-test2.desy.de/yakser /test_offline/test_facility/gpfs/test/2019/data/asapo_test asapo_test $token -#python3 getnext.py gest-k8s-test2.desy.de/yakser /test_offline/test_facility/gpfs/test/2019/data/asapo_test asapo_test $token new \ No newline at end of file +python3 consumer_api.py tcp gest-k8s-test2.desy.de/yakser /test_offline/test_facility/gpfs/test/2019/data/asapo_test asapo_test $token +#python3 getnext.py gest-k8s-test2.desy.de/yakser /test_offline/test_facility/gpfs/test/2019/data/asapo_test asapo_test $token new