diff --git a/CMakeModules/testing_cpp.cmake b/CMakeModules/testing_cpp.cmake index debb3ece28e074479f5afc17cec93f3ed281ea08..3a34148ced6ffc3cebbaffcc4db746719d08bbfd 100644 --- a/CMakeModules/testing_cpp.cmake +++ b/CMakeModules/testing_cpp.cmake @@ -13,7 +13,7 @@ set (TOKENS "${TOKENS};BLP07_W_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdG set (TOKENS "${TOKENS};BT_DATA_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjMTkybXEzaXB0MzBnbGp0YzlzMCIsInN1YiI6ImJ0X2RhdGEiLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlcyI6WyJyZWFkIl19fQ.A5lLIJl-F6BGdWHdD9o0YOs5E9UPPFTylIdJocB10HI") set (TOKENS "${TOKENS};BT_TEST_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjMTkybnViaXB0MzBsMjlpcXNxMCIsInN1YiI6ImJ0X3Rlc3QiLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlcyI6WyJyZWFkIl19fQ.8dh4KIusIVk75MGiWjoj23_cesLLWSMDjU8vb0RHVtU") set (TOKENS "${TOKENS};BT_AAA_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjMTkycDFiaXB0MzBub3AwcTNlZyIsInN1YiI6ImJ0X2FhYSIsIkV4dHJhQ2xhaW1zIjp7IkFjY2Vzc1R5cGVzIjpbInJlYWQiXX19.dt3ifrG3zqQP4uM2kaoe7ydDjUdFeasOB07fVRfFApE") - +set (TOKENS "${TOKENS};BT_TEST_RUN_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjMTk0NjYzaXB0Mzdma2w0YmVrMCIsInN1YiI6ImJ0X3Rlc3RfcnVuIiwiRXh0cmFDbGFpbXMiOnsiQWNjZXNzVHlwZXMiOlsicmVhZCJdfX0.QJjoGOlzMvOUk7dK2bbDgSEM5-1mO6wmpmESYL6McdU") endif() diff --git a/authorizer/src/asapo_authorizer/cli/command_test.go b/authorizer/src/asapo_authorizer/cli/command_test.go index a87d90c21acbaa0a7be2b4599597044b7cc25167..dd457455f141710adbc4ffed143ad0bdc8d045a6 100644 --- a/authorizer/src/asapo_authorizer/cli/command_test.go +++ b/authorizer/src/asapo_authorizer/cli/command_test.go @@ -14,7 +14,7 @@ var CommandTests = []struct { ok bool msg string }{ - {command{"create-token", []string{"-types", "user-token", "-beamtime","123","-access-types","read","-duration-days","1"}}, true,"ok"}, + {command{"create-token", []string{"-type", "user-token", "-beamtime","123","-access-types","read","-duration-days","1"}}, true,"ok"}, {command{"dummy", []string{"description"}}, false,"wrong command"}, } diff --git a/authorizer/src/asapo_authorizer/cli/create_token_test.go b/authorizer/src/asapo_authorizer/cli/create_token_test.go index ce41324dfdd53e89a7fddc5a4e63ececdf390e34..ca16f199ed5c20d2a0f0946c76bd00c06d168778 100644 --- a/authorizer/src/asapo_authorizer/cli/create_token_test.go +++ b/authorizer/src/asapo_authorizer/cli/create_token_test.go @@ -22,20 +22,20 @@ var tokenTests = []struct { msg string }{ // good - {command{args: []string{"-types", "user-token", "-beamtime","123","-access-types","read","-duration-days","10"}}, + {command{args: []string{"-type", "user-token", "-beamtime","123","-access-types","read","-duration-days","10"}}, "secret_user",true, []string{"read"}, "bt_123", true,"user token beamtime ok"}, - {command{args: []string{"-types", "user-token", "-beamline","123","-access-types","read","-duration-days","10"}}, + {command{args: []string{"-type", "user-token", "-beamline","123","-access-types","read","-duration-days","10"}}, "secret_user", true, []string{"read"}, "bl_123", true,"user token beamline ok"}, - {command{args: []string{"-types", "admin-token","-access-types","create"}}, + {command{args: []string{"-type", "admin-token","-access-types","create"}}, "secret_admin",true, []string{"create"}, "admin", false,"admin token ok"}, // bad - {command{args: []string{"-types", "user-token", "-beamtime","123","-access-types","create","-duration-days","10"}}, + {command{args: []string{"-type", "user-token", "-beamtime","123","-access-types","create","-duration-days","10"}}, "secret_user",false, nil, "", true,"user token wrong type"}, - {command{args: []string{"-types", "user-token", "-access-types","create","-duration-days","10"}}, + {command{args: []string{"-type", "user-token", "-access-types","create","-duration-days","10"}}, "secret_user",false, nil, "", true,"user token no beamtime or beamline"}, - {command{args: []string{"-types", "user-token", "-beamtime","123","-beamline","1234", "-access-types","create","-duration-days","10"}}, + {command{args: []string{"-type", "user-token", "-beamtime","123","-beamline","1234", "-access-types","create","-duration-days","10"}}, "secret_user",false, nil, "", true,"user token both beamtime and beamline"}, - {command{args: []string{"-types", "admin-token","-access-types","bla"}}, + {command{args: []string{"-type", "admin-token","-access-types","bla"}}, "secret_admin",false, nil ,"", false,"admin token wrong type"}, } diff --git a/examples/consumer/getnext/check_linux.sh b/examples/consumer/getnext/check_linux.sh index 049a9c4c9fa9e242990937d1759924b1936400c5..a8c0ec75089eeff7ab9ca5049ea4dbbc530abd27 100644 --- a/examples/consumer/getnext/check_linux.sh +++ b/examples/consumer/getnext/check_linux.sh @@ -4,7 +4,7 @@ source_path=dummy beamtime_id=test_run data_source=detector database_name=${beamtime_id}_${data_source} -token_test_run=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5NDI0MjQsImp0aSI6ImMxNGVkbTNpcHQzZHQ4Y2JhczVnIiwic3ViIjoiYnRfdGVzdF9ydW4iLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlIjoicmVhZCJ9fQ.SBzrEy-d3ayhVZMSskYUMLM2LVHw3yiM32mIOcITh0g +token_test_run=$BT_TEST_RUN_TOKEN set -e diff --git a/examples/consumer/getnext/check_windows.bat b/examples/consumer/getnext/check_windows.bat index b9cc3044bfeed8936605ead243ef803d020f358b..1a3db40dff18fa2808fcdf3c3957eeb40f990e58 100644 --- a/examples/consumer/getnext/check_windows.bat +++ b/examples/consumer/getnext/check_windows.bat @@ -5,7 +5,7 @@ SET data_source=detector SET database_name=%beamtime_id%_%data_source% SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" -set token_test_run=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5NDI0MjQsImp0aSI6ImMxNGVkbTNpcHQzZHQ4Y2JhczVnIiwic3ViIjoiYnRfdGVzdF9ydW4iLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlIjoicmVhZCJ9fQ.SBzrEy-d3ayhVZMSskYUMLM2LVHw3yiM32mIOcITh0g +set token_test_run=%BT_TEST_RUN_TOKEN% call start_services.bat diff --git a/examples/consumer/getnext_python/check_linux.sh b/examples/consumer/getnext_python/check_linux.sh index 2ac44afddabac4641741cbb6214294b0500eff2b..50c4b25cfa5364a5566b8440a6296649cb043497 100644 --- a/examples/consumer/getnext_python/check_linux.sh +++ b/examples/consumer/getnext_python/check_linux.sh @@ -4,7 +4,7 @@ source_path=dummy beamtime_id=test_run data_source=detector database_name=${beamtime_id}_${data_source} -token_test_run=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5NDI0MjQsImp0aSI6ImMxNGVkbTNpcHQzZHQ4Y2JhczVnIiwic3ViIjoiYnRfdGVzdF9ydW4iLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlIjoicmVhZCJ9fQ.SBzrEy-d3ayhVZMSskYUMLM2LVHw3yiM32mIOcITh0g +token_test_run=$BT_TEST_RUN_TOKEN group_id=bif31l2uiddd4r0q6b40 set -e diff --git a/examples/consumer/getnext_python/check_windows.bat b/examples/consumer/getnext_python/check_windows.bat index 448e1c2652f18e99c1772b6289e96b7d35528fac..9b96ec00e6ddc2373237820eb86ee333f0f2b7b0 100644 --- a/examples/consumer/getnext_python/check_windows.bat +++ b/examples/consumer/getnext_python/check_windows.bat @@ -4,7 +4,7 @@ SET data_source=detector SET database_name=%beamtime_id%_%data_source% SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" -set token_test_run=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5NDI0MjQsImp0aSI6ImMxNGVkbTNpcHQzZHQ4Y2JhczVnIiwic3ViIjoiYnRfdGVzdF9ydW4iLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlIjoicmVhZCJ9fQ.SBzrEy-d3ayhVZMSskYUMLM2LVHw3yiM32mIOcITh0g +set token_test_run=%BT_TEST_RUN_TOKEN% set group_id=bif31l2uiddd4r0q6b40 call start_services.bat diff --git a/tests/automatic/consumer/consumer_api/check_linux.sh b/tests/automatic/consumer/consumer_api/check_linux.sh index f674a67ed37f4b94c8428100c51d165cd30254fb..7e0f342a598a82b8de05a33e95ad617a981cbce8 100644 --- a/tests/automatic/consumer/consumer_api/check_linux.sh +++ b/tests/automatic/consumer/consumer_api/check_linux.sh @@ -3,7 +3,9 @@ beamtime_id=test_run data_source=detector database_name=${beamtime_id}_${data_source} -token_test_run=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5NDI0MjQsImp0aSI6ImMxNGVkbTNpcHQzZHQ4Y2JhczVnIiwic3ViIjoiYnRfdGVzdF9ydW4iLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlIjoicmVhZCJ9fQ.SBzrEy-d3ayhVZMSskYUMLM2LVHw3yiM32mIOcITh0g +token_test_run=$BT_TEST_RUN_TOKEN + + set -e diff --git a/tests/automatic/consumer/consumer_api/check_windows.bat b/tests/automatic/consumer/consumer_api/check_windows.bat index 4764a3852817ba8eb4f4e14030b62c6be40a6ec3..9e3be222df17dbb674d4c7312abc02fe46a584cc 100644 --- a/tests/automatic/consumer/consumer_api/check_windows.bat +++ b/tests/automatic/consumer/consumer_api/check_windows.bat @@ -4,7 +4,7 @@ SET data_source=detector SET database_name=%beamtime_id%_%data_source% SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" -set token_test_run=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5NDI0MjQsImp0aSI6ImMxNGVkbTNpcHQzZHQ4Y2JhczVnIiwic3ViIjoiYnRfdGVzdF9ydW4iLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlIjoicmVhZCJ9fQ.SBzrEy-d3ayhVZMSskYUMLM2LVHw3yiM32mIOcITh0g +set token_test_run=%BT_TEST_RUN_TOKEN% call start_services.bat diff --git a/tests/automatic/consumer/consumer_api_python/check_linux.sh b/tests/automatic/consumer/consumer_api_python/check_linux.sh index 47396174ee2d5d7d7c5a61d60a53786fdb0dec65..fabcbdc2e737426d4d2b1843c73685498dc84660 100644 --- a/tests/automatic/consumer/consumer_api_python/check_linux.sh +++ b/tests/automatic/consumer/consumer_api_python/check_linux.sh @@ -4,10 +4,9 @@ beamtime_id=test_run source_path=`pwd`/asap3/petra3/gpfs/p01/2019/data/$beamtime_id data_source=detector database_name=${beamtime_id}_${data_source} -token_test_run=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5NDI0MjQsImp0aSI6ImMxNGVkbTNpcHQzZHQ4Y2JhczVnIiwic3ViIjoiYnRfdGVzdF9ydW4iLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlIjoicmVhZCJ9fQ.SBzrEy-d3ayhVZMSskYUMLM2LVHw3yiM32mIOcITh0g +token_test_run=$BT_TEST_RUN_TOKEN set -e - trap Cleanup EXIT Cleanup() { diff --git a/tests/automatic/consumer/consumer_api_python/check_windows.bat b/tests/automatic/consumer/consumer_api_python/check_windows.bat index 055a5efafc2ef849e7313f30436993d481ec8ae0..6f56883eb624186cf375822f27c913f558e7817e 100644 --- a/tests/automatic/consumer/consumer_api_python/check_windows.bat +++ b/tests/automatic/consumer/consumer_api_python/check_windows.bat @@ -8,8 +8,7 @@ SET data_source=detector SET database_name=%beamtime_id%_%data_source% SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" -set token_test_run=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5NDI0MjQsImp0aSI6ImMxNGVkbTNpcHQzZHQ4Y2JhczVnIiwic3ViIjoiYnRfdGVzdF9ydW4iLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlIjoicmVhZCJ9fQ.SBzrEy-d3ayhVZMSskYUMLM2LVHw3yiM32mIOcITh0g - +set token_test_run=%BT_TEST_RUN_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 diff --git a/tests/automatic/consumer/next_multithread_broker/check_linux.sh b/tests/automatic/consumer/next_multithread_broker/check_linux.sh index 7da3c8b69223aa8d239bc56fb72f6a63488ab0e6..d507f1e9fc261b660e7a5a77cd32eff4868c7436 100644 --- a/tests/automatic/consumer/next_multithread_broker/check_linux.sh +++ b/tests/automatic/consumer/next_multithread_broker/check_linux.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash database_name=test_run_detector -token_test_run=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5NDI0MjQsImp0aSI6ImMxNGVkbTNpcHQzZHQ4Y2JhczVnIiwic3ViIjoiYnRfdGVzdF9ydW4iLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlIjoicmVhZCJ9fQ.SBzrEy-d3ayhVZMSskYUMLM2LVHw3yiM32mIOcITh0g - +token_test_run=$BT_TEST_RUN_TOKEN set -e trap Cleanup EXIT diff --git a/tests/automatic/consumer/next_multithread_broker/check_windows.bat b/tests/automatic/consumer/next_multithread_broker/check_windows.bat index 607adcff43d61835865d1840a4161ee9de3f47c1..d995d7cec883a1b6a71059035d6b52d094fe682e 100644 --- a/tests/automatic/consumer/next_multithread_broker/check_windows.bat +++ b/tests/automatic/consumer/next_multithread_broker/check_windows.bat @@ -1,6 +1,6 @@ SET database_name=test_run_detector SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" -set token_test_run=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5NDI0MjQsImp0aSI6ImMxNGVkbTNpcHQzZHQ4Y2JhczVnIiwic3ViIjoiYnRfdGVzdF9ydW4iLCJFeHRyYUNsYWltcyI6eyJBY2Nlc3NUeXBlIjoicmVhZCJ9fQ.SBzrEy-d3ayhVZMSskYUMLM2LVHw3yiM32mIOcITh0g +set token_test_run=%BT_TEST_RUN_TOKEN% call start_services.bat 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 95473b96dfdf4d0a70a893e0edf106f7efb807a9..0bd69ff985116b9f46df3ace65571196af175243 100644 --- a/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh @@ -50,7 +50,7 @@ token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -s echo "Start producer" mkdir -p ${receiver_folder} -$producer_bin test.json & +$producer_bin test.json & producerid=`echo $!` sleep 1 diff --git a/tests/automatic/producer/aai/check_linux.sh b/tests/automatic/producer/aai/check_linux.sh index db89820bd85cdad1c9ebf8d1414c8f34de9c5f51..d5aeba38c60264f46a24053b42c9976280b9fd98 100644 --- a/tests/automatic/producer/aai/check_linux.sh +++ b/tests/automatic/producer/aai/check_linux.sh @@ -13,7 +13,7 @@ facility=test_facility year=2019 receiver_folder=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/data/${beamtime_id} receiver_folder2=${receiver_root_folder}/${facility}/gpfs/${beamline}/${year}/data/${beamtime_id2} -token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjMTRhbHRyaXB0MzltZTRqcXB0ZyIsInN1YiI6ImJsX3AwNyIsIkV4dHJhQ2xhaW1zIjp7IkFjY2Vzc1R5cGUiOiJ3cml0ZSJ9fQ._yy0E42cOGMv81GDj3WKZJlF8mBmjKtHNDPnN5NTxvk # write token for bl_p07 +token=$BLP07_W_TOKEN Cleanup() { echo cleanup diff --git a/tests/automatic/producer/aai/check_windows.bat b/tests/automatic/producer/aai/check_windows.bat index 3b07ae5774d32f4319717a690e1304774f9d0233..fa0c3b90200640a4b293687a05da34cb7c47639f 100644 --- a/tests/automatic/producer/aai/check_windows.bat +++ b/tests/automatic/producer/aai/check_windows.bat @@ -8,7 +8,7 @@ SET receiver_folder="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\d SET receiver_folder2="%receiver_root_folder%\test_facility\gpfs\%beamline%\2019\data\%beamtime_id2%" SET dbname=%beamtime_id%_%data_source% SET dbname2=%beamtime_id2%_%data_source% -SET token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjMTRhbHRyaXB0MzltZTRqcXB0ZyIsInN1YiI6ImJsX3AwNyIsIkV4dHJhQ2xhaW1zIjp7IkFjY2Vzc1R5cGUiOiJ3cml0ZSJ9fQ._yy0E42cOGMv81GDj3WKZJlF8mBmjKtHNDPnN5NTxvk +SET token=%BLP07_W_TOKEN% echo db.%dbname%.insert({dummy:1})" | %mongo_exe% %dbname%