Skip to content
Snippets Groups Projects
Commit 25769d40 authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

Merge pull request #147 in ASAPO/asapo from migrate_to_bamboo5 to develop

* commit 'c9e734f9':
  win tests
  update win tests
  fix test
  fix test
  fix test
  fix test
  fix test
  increase timeout
  update tests
  start migration
parents 8c93c41d c9e734f9
No related branches found
No related tags found
No related merge requests found
Showing
with 64 additions and 43 deletions
......@@ -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)
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -7,10 +7,7 @@ echo db.data_default.insert({"_id":2}) | %mongo_exe% %database_name% || goto :e
set full_name="%1"
set short_name="%~nx1"
c:\opt\consul\nomad run authorizer.nmd
c:\opt\consul\nomad run nginx.nmd
ping 192.0.2.1 -n 1 -w 2000 > nul
call start_authorizer.bat
start /B "" "%full_name%" -config settings.json
......@@ -53,6 +50,4 @@ exit /b 1
Taskkill /IM "%short_name%" /F
echo db.dropDatabase() | %mongo_exe% %database_name%
del /f groupid
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
call stop_authorizer.bat
......@@ -6,10 +6,7 @@ echo db.meta.insert({"_id":0}) | %mongo_exe% %database_name% || goto :error
set full_name="%1"
set short_name="%~nx1"
c:\opt\consul\nomad run authorizer.nmd
c:\opt\consul\nomad run nginx.nmd
ping 192.0.2.1 -n 1 -w 2000 > nul
call start_authorizer.bat
start /B "" "%full_name%" -config settings.json
......@@ -32,6 +29,4 @@ exit /b 1
Taskkill /IM "%short_name%" /F
echo db.dropDatabase() | %mongo_exe% %database_name%
del /f groupid
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
call stop_authorizer.bat
......@@ -9,10 +9,7 @@ set short_name="%~nx1"
set token=%BT_DATA_TOKEN%
c:\opt\consul\nomad run authorizer.nmd
c:\opt\consul\nomad run nginx.nmd
ping 192.0.2.1 -n 1 -w 2000 > nul
call start_authorizer.bat
start /B "" "%full_name%" -config settings.json
......@@ -39,6 +36,4 @@ Taskkill /IM "%short_name%" /F
echo db.dropDatabase() | %mongo_exe% %database_name%
del /f token
del /f groupid
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
call stop_authorizer.bat
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
......@@ -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
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
......@@ -7,7 +7,7 @@ set file_transfer_folder=%file_transfer_folder:\=\\%
c:\opt\consul\nomad run authorizer.nmd
c:\opt\consul\nomad run file_transfer.nmd
ping 192.0.2.1 -n 1 -w 1000 > nul
ping 192.0.2.1 -n 1 -w 5000 > nul
set token=%BT_AAA_TOKEN%
......
......@@ -46,7 +46,7 @@ nomad run receiver_tcp.nmd # Only use TCP because the consumer will only use met
nomad run discovery.nmd
nomad run broker.nmd
sleep 1
sleep 5
token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id`
......
......@@ -43,7 +43,7 @@ nomad run receiver_${network_type}.nmd
nomad run discovery.nmd
nomad run broker.nmd
sleep 1
sleep 5
token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id`
......
......@@ -44,7 +44,7 @@ nomad run receiver_${network_type}.nmd
nomad run discovery.nmd
nomad run broker.nmd
sleep 1
sleep 5
token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id`
......@@ -63,6 +63,8 @@ echo hello > /tmp/asapo/test_in/processed/test1/file1
echo hello > /tmp/asapo/test_in/processed/test1/file2
echo hello > /tmp/asapo/test_in/processed/test2/file1
sleep 1
echo "Start consumer in metadata only mode"
$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 1000 1 | tee /dev/stderr out
grep "Processed 3 file(s)" out
......
......@@ -47,14 +47,10 @@ nomad run receiver_tcp.nmd
nomad run discovery.nmd
nomad run broker.nmd
sleep 1
sleep 5
token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id`
mkdir /tmp/asapo/test_in/processed/test1
mkdir /tmp/asapo/test_in/processed/test2
#producer
echo "Start producer"
mkdir -p ${receiver_folder}
......@@ -63,6 +59,10 @@ producerid=`echo $!`
sleep 1
mkdir /tmp/asapo/test_in/processed/test1
mkdir /tmp/asapo/test_in/processed/test2
echo hello > /tmp/asapo/test_in/processed/test1/file1
echo hello > /tmp/asapo/test_in/processed/test1/file2
echo hello > /tmp/asapo/test_in/processed/test2/file1
......
......@@ -45,7 +45,7 @@ nomad run receiver_tcp.nmd
nomad run discovery.nmd
nomad run broker.nmd
sleep 1
sleep 5
token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id`
......
......@@ -47,7 +47,7 @@ nomad run receiver_${network_type}.nmd
nomad run discovery.nmd
nomad run broker.nmd
sleep 1
sleep 5
token=`$3 token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id`
......@@ -60,6 +60,8 @@ sleep 1
mkdir /tmp/asapo/test_in/processed/test1
mkdir /tmp/asapo/test_in/processed/test2
sleep 1
echo -n hello1 > /tmp/asapo/test_in/processed/test1/file1
echo -n hello2 > /tmp/asapo/test_in/processed/test1/file2
echo -n hello3 > /tmp/asapo/test_in/processed/test2/file1
......@@ -71,7 +73,3 @@ grep "hello1" out.txt
grep "hello2" out.txt
grep "hello3" out.txt
grep -i "Using connection type: $network_type" out.txt
sleep 12
influx -execute "select sum(n_requests) from statistics where receiver_ds_tag !=''" -database=${monitor_database_name} -format=json | jq .results[0].series[0].values[0][1] | tee /dev/stderr | grep 3
......@@ -47,7 +47,7 @@ nomad run receiver_${network_type}.nmd
nomad run discovery.nmd
nomad run broker.nmd
sleep 1
sleep 5
token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id`
......
......@@ -42,7 +42,7 @@ nomad run receiver_tcp.nmd # Only use TCP because the consumer will only use met
nomad run discovery.nmd
nomad run broker.nmd
sleep 1
sleep 5
token=`$asapo_tool_bin token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id`
......
......@@ -37,7 +37,7 @@ nomad run receiver_tcp.nmd
nomad run discovery.nmd
nomad run broker.nmd
sleep 1
sleep 5
token=`$3 token -endpoint http://localhost:8400/asapo-authorizer -secret admin_token.key -types read $beamtime_id`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment