From e16405403fc83ed0cf8339d6d6fb0cf5ea8edc53 Mon Sep 17 00:00:00 2001
From: Sergey Yakubov <sergey.yakubov@desy.de>
Date: Thu, 1 Mar 2018 10:52:31 +0100
Subject: [PATCH] added manual test for broker performance

---
 .../hidra2_broker/server/server_nottested.go  |  4 +-
 examples/worker/getnext_broker/CMakeLists.txt |  2 +-
 tests/CMakeLists.txt                          | 20 +------
 tests/automatic/CMakeLists.txt                | 21 +++++++
 tests/{ => automatic}/broker/CMakeLists.txt   |  0
 .../broker/check_monitoring/CMakeLists.txt    |  2 +-
 .../broker/check_monitoring/check_linux.sh    |  0
 .../broker/get_next/CMakeLists.txt            |  2 +-
 .../broker/get_next/check_linux.sh            |  0
 .../broker/get_next/check_windows.bat         |  0
 .../broker/read_config/CMakeLists.txt         |  2 +-
 .../broker/read_config/check_linux.sh         |  0
 .../broker/read_config/check_windows.bat      |  0
 .../broker/read_config/settings_bad.json      |  0
 .../{ => automatic}/common/cpp/CMakeLists.txt |  0
 .../common/cpp/include/testing.h              |  0
 .../common/cpp/src/testing.cpp                |  0
 .../json_parser/CMakeLists.txt                |  0
 .../parse_config_file/CMakeLists.txt          |  0
 .../json_parser/parse_config_file/config.json |  0
 .../parse_config_file/config_bad.json         |  0
 .../parse_config_file/parse_config_file.cpp   |  0
 tests/{ => automatic}/mongo_db/CMakeLists.txt |  0
 .../mongo_db/connect/CMakeLists.txt           |  0
 .../mongo_db/connect/connect_mongodb.cpp      |  0
 .../mongo_db/insert/CMakeLists.txt            |  0
 .../mongo_db/insert/cleanup_linux.sh          |  0
 .../mongo_db/insert/cleanup_windows.bat       |  0
 .../mongo_db/insert/insert_mongodb.cpp        |  0
 .../settings/broker_settings.json             |  0
 .../{ => automatic}/system_io/CMakeLists.txt  |  0
 .../read_file_content/CMakeLists.txt          |  0
 .../read_file_content/cleanup_linux.sh        |  0
 .../read_file_content/cleanup_windows.bat     |  0
 .../read_file_content/read_file_content.cpp   |  0
 .../read_file_content/setup_linux.sh          |  0
 .../read_file_content/setup_windows.bat       |  0
 .../read_folder_content/CMakeLists.txt        |  0
 .../read_folder_content/cleanup_linux.sh      |  0
 .../read_folder_content/cleanup_windows.bat   |  0
 .../read_folder_content.cpp                   |  0
 .../read_folder_content/setup_linux.sh        |  0
 .../read_folder_content/setup_windows.bat     |  0
 .../read_string_from_file/CMakeLists.txt      |  0
 .../read_string_from_file/cleanup_linux.sh    |  0
 .../read_string_from_file/cleanup_windows.bat |  0
 .../read_string_from_file.cpp                 |  0
 .../read_string_from_file/setup_linux.sh      |  0
 .../read_string_from_file/setup_windows.bat   |  0
 tests/{ => automatic}/worker/CMakeLists.txt   |  0
 .../worker/connect_multithread/CMakeLists.txt |  0
 .../connect_multithread/cleanup_linux.sh      |  0
 .../connect_multithread/cleanup_windows.bat   |  0
 .../content_multithread.cpp                   |  0
 .../worker/connect_multithread/setup_linux.sh |  0
 .../connect_multithread/setup_windows.bat     |  0
 .../curl_http_client_get/CMakeLists.txt       |  0
 .../curl_httpclient_get.cpp                   |  0
 .../worker/folder_to_db/CMakeLists.txt        |  0
 .../worker/folder_to_db/check_linux.sh        |  0
 .../worker/folder_to_db/check_windows.bat     |  0
 .../next_multithread_broker/CMakeLists.txt    |  2 +-
 .../next_multithread_broker/check_linux.sh    |  0
 .../next_multithread_broker/check_windows.bat |  0
 .../next_multithread_broker.cpp               |  0
 .../next_multithread_folder/CMakeLists.txt    |  0
 .../next_multithread_folder/cleanup_linux.sh  |  0
 .../cleanup_windows.bat                       |  0
 .../next_multithread_folder.cpp               |  0
 .../next_multithread_folder/setup_linux.sh    |  0
 .../next_multithread_folder/setup_windows.bat |  0
 tests/manual/performance_broker/settings.json |  6 ++
 tests/manual/performance_broker/test.sh       | 58 +++++++++++++++++++
 73 files changed, 93 insertions(+), 26 deletions(-)
 create mode 100644 tests/automatic/CMakeLists.txt
 rename tests/{ => automatic}/broker/CMakeLists.txt (100%)
 rename tests/{ => automatic}/broker/check_monitoring/CMakeLists.txt (66%)
 rename tests/{ => automatic}/broker/check_monitoring/check_linux.sh (100%)
 rename tests/{ => automatic}/broker/get_next/CMakeLists.txt (66%)
 rename tests/{ => automatic}/broker/get_next/check_linux.sh (100%)
 rename tests/{ => automatic}/broker/get_next/check_windows.bat (100%)
 rename tests/{ => automatic}/broker/read_config/CMakeLists.txt (71%)
 rename tests/{ => automatic}/broker/read_config/check_linux.sh (100%)
 rename tests/{ => automatic}/broker/read_config/check_windows.bat (100%)
 rename tests/{ => automatic}/broker/read_config/settings_bad.json (100%)
 rename tests/{ => automatic}/common/cpp/CMakeLists.txt (100%)
 rename tests/{ => automatic}/common/cpp/include/testing.h (100%)
 rename tests/{ => automatic}/common/cpp/src/testing.cpp (100%)
 rename tests/{ => automatic}/json_parser/CMakeLists.txt (100%)
 rename tests/{ => automatic}/json_parser/parse_config_file/CMakeLists.txt (100%)
 rename tests/{ => automatic}/json_parser/parse_config_file/config.json (100%)
 rename tests/{ => automatic}/json_parser/parse_config_file/config_bad.json (100%)
 rename tests/{ => automatic}/json_parser/parse_config_file/parse_config_file.cpp (100%)
 rename tests/{ => automatic}/mongo_db/CMakeLists.txt (100%)
 rename tests/{ => automatic}/mongo_db/connect/CMakeLists.txt (100%)
 rename tests/{ => automatic}/mongo_db/connect/connect_mongodb.cpp (100%)
 rename tests/{ => automatic}/mongo_db/insert/CMakeLists.txt (100%)
 rename tests/{ => automatic}/mongo_db/insert/cleanup_linux.sh (100%)
 rename tests/{ => automatic}/mongo_db/insert/cleanup_windows.bat (100%)
 rename tests/{ => automatic}/mongo_db/insert/insert_mongodb.cpp (100%)
 rename tests/{ => automatic}/settings/broker_settings.json (100%)
 rename tests/{ => automatic}/system_io/CMakeLists.txt (100%)
 rename tests/{ => automatic}/system_io/read_file_content/CMakeLists.txt (100%)
 rename tests/{ => automatic}/system_io/read_file_content/cleanup_linux.sh (100%)
 rename tests/{ => automatic}/system_io/read_file_content/cleanup_windows.bat (100%)
 rename tests/{ => automatic}/system_io/read_file_content/read_file_content.cpp (100%)
 rename tests/{ => automatic}/system_io/read_file_content/setup_linux.sh (100%)
 rename tests/{ => automatic}/system_io/read_file_content/setup_windows.bat (100%)
 rename tests/{ => automatic}/system_io/read_folder_content/CMakeLists.txt (100%)
 rename tests/{ => automatic}/system_io/read_folder_content/cleanup_linux.sh (100%)
 rename tests/{ => automatic}/system_io/read_folder_content/cleanup_windows.bat (100%)
 rename tests/{ => automatic}/system_io/read_folder_content/read_folder_content.cpp (100%)
 rename tests/{ => automatic}/system_io/read_folder_content/setup_linux.sh (100%)
 rename tests/{ => automatic}/system_io/read_folder_content/setup_windows.bat (100%)
 rename tests/{ => automatic}/system_io/read_string_from_file/CMakeLists.txt (100%)
 rename tests/{ => automatic}/system_io/read_string_from_file/cleanup_linux.sh (100%)
 rename tests/{ => automatic}/system_io/read_string_from_file/cleanup_windows.bat (100%)
 rename tests/{ => automatic}/system_io/read_string_from_file/read_string_from_file.cpp (100%)
 rename tests/{ => automatic}/system_io/read_string_from_file/setup_linux.sh (100%)
 rename tests/{ => automatic}/system_io/read_string_from_file/setup_windows.bat (100%)
 rename tests/{ => automatic}/worker/CMakeLists.txt (100%)
 rename tests/{ => automatic}/worker/connect_multithread/CMakeLists.txt (100%)
 rename tests/{ => automatic}/worker/connect_multithread/cleanup_linux.sh (100%)
 rename tests/{ => automatic}/worker/connect_multithread/cleanup_windows.bat (100%)
 rename tests/{ => automatic}/worker/connect_multithread/content_multithread.cpp (100%)
 rename tests/{ => automatic}/worker/connect_multithread/setup_linux.sh (100%)
 rename tests/{ => automatic}/worker/connect_multithread/setup_windows.bat (100%)
 rename tests/{ => automatic}/worker/curl_http_client_get/CMakeLists.txt (100%)
 rename tests/{ => automatic}/worker/curl_http_client_get/curl_httpclient_get.cpp (100%)
 rename tests/{ => automatic}/worker/folder_to_db/CMakeLists.txt (100%)
 rename tests/{ => automatic}/worker/folder_to_db/check_linux.sh (100%)
 rename tests/{ => automatic}/worker/folder_to_db/check_windows.bat (100%)
 rename tests/{ => automatic}/worker/next_multithread_broker/CMakeLists.txt (82%)
 rename tests/{ => automatic}/worker/next_multithread_broker/check_linux.sh (100%)
 rename tests/{ => automatic}/worker/next_multithread_broker/check_windows.bat (100%)
 rename tests/{ => automatic}/worker/next_multithread_broker/next_multithread_broker.cpp (100%)
 rename tests/{ => automatic}/worker/next_multithread_folder/CMakeLists.txt (100%)
 rename tests/{ => automatic}/worker/next_multithread_folder/cleanup_linux.sh (100%)
 rename tests/{ => automatic}/worker/next_multithread_folder/cleanup_windows.bat (100%)
 rename tests/{ => automatic}/worker/next_multithread_folder/next_multithread_folder.cpp (100%)
 rename tests/{ => automatic}/worker/next_multithread_folder/setup_linux.sh (100%)
 rename tests/{ => automatic}/worker/next_multithread_folder/setup_windows.bat (100%)
 create mode 100644 tests/manual/performance_broker/settings.json
 create mode 100755 tests/manual/performance_broker/test.sh

diff --git a/broker/src/hidra2_broker/server/server_nottested.go b/broker/src/hidra2_broker/server/server_nottested.go
index 39320081e..35ed53f93 100644
--- a/broker/src/hidra2_broker/server/server_nottested.go
+++ b/broker/src/hidra2_broker/server/server_nottested.go
@@ -3,11 +3,11 @@
 package server
 
 import (
+	"errors"
 	"hidra2_broker/utils"
 	"log"
 	"net/http"
 	"strconv"
-	"errors"
 )
 
 func StartStatistics() {
@@ -19,7 +19,7 @@ func StartStatistics() {
 func Start() {
 	StartStatistics()
 	mux := utils.NewRouter(listRoutes)
-	log.Fatal(http.ListenAndServe("localhost:"+strconv.Itoa(settings.Port), http.HandlerFunc(mux.ServeHTTP)))
+	log.Fatal(http.ListenAndServe(":"+strconv.Itoa(settings.Port), http.HandlerFunc(mux.ServeHTTP)))
 }
 
 func ReadConfig(fname string) error {
diff --git a/examples/worker/getnext_broker/CMakeLists.txt b/examples/worker/getnext_broker/CMakeLists.txt
index 58f244cf8..903ff9db5 100644
--- a/examples/worker/getnext_broker/CMakeLists.txt
+++ b/examples/worker/getnext_broker/CMakeLists.txt
@@ -10,7 +10,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
 
 get_target_property(VAR ${TARGET_NAME} RUNTIME_OUTPUT_DIRECTORY)
 
-configure_file(${CMAKE_SOURCE_DIR}/tests/settings/broker_settings.json settings.json COPYONLY)
+configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/broker_settings.json settings.json COPYONLY)
 add_script_test("${TARGET_NAME}" "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME} $<TARGET_PROPERTY:hidra2-broker,EXENAME>")
 
 set (dir examples/worker/${TARGET_NAME})
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 0fb714182..47f40c7bc 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,21 +1,3 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 3.7) # needed for fixtures
-find_package(Threads)
-
-add_subdirectory(common/cpp)
-add_subdirectory(system_io)
-
-add_subdirectory(json_parser)
-
-if(BUILD_MONGODB_CLIENTLIB)
-    add_subdirectory(mongo_db)
-endif()
-
-
-if(BUILD_BROKER)
-    add_subdirectory(broker)
-endif()
-
-
-add_subdirectory(worker)
+add_subdirectory(automatic)
 
 
diff --git a/tests/automatic/CMakeLists.txt b/tests/automatic/CMakeLists.txt
new file mode 100644
index 000000000..0fb714182
--- /dev/null
+++ b/tests/automatic/CMakeLists.txt
@@ -0,0 +1,21 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 3.7) # needed for fixtures
+find_package(Threads)
+
+add_subdirectory(common/cpp)
+add_subdirectory(system_io)
+
+add_subdirectory(json_parser)
+
+if(BUILD_MONGODB_CLIENTLIB)
+    add_subdirectory(mongo_db)
+endif()
+
+
+if(BUILD_BROKER)
+    add_subdirectory(broker)
+endif()
+
+
+add_subdirectory(worker)
+
+
diff --git a/tests/broker/CMakeLists.txt b/tests/automatic/broker/CMakeLists.txt
similarity index 100%
rename from tests/broker/CMakeLists.txt
rename to tests/automatic/broker/CMakeLists.txt
diff --git a/tests/broker/check_monitoring/CMakeLists.txt b/tests/automatic/broker/check_monitoring/CMakeLists.txt
similarity index 66%
rename from tests/broker/check_monitoring/CMakeLists.txt
rename to tests/automatic/broker/check_monitoring/CMakeLists.txt
index de66ca8b3..19c68e39b 100644
--- a/tests/broker/check_monitoring/CMakeLists.txt
+++ b/tests/automatic/broker/check_monitoring/CMakeLists.txt
@@ -3,6 +3,6 @@ set(TARGET_NAME hidra2-broker)
 ################################
 # Testing
 ################################
-configure_file(${CMAKE_SOURCE_DIR}/tests/settings/broker_settings.json settings.json COPYONLY)
+configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/broker_settings.json settings.json COPYONLY)
 add_script_test("${TARGET_NAME}-monitoring" "$<TARGET_PROPERTY:${TARGET_NAME},EXENAME>" nomem
         )
diff --git a/tests/broker/check_monitoring/check_linux.sh b/tests/automatic/broker/check_monitoring/check_linux.sh
similarity index 100%
rename from tests/broker/check_monitoring/check_linux.sh
rename to tests/automatic/broker/check_monitoring/check_linux.sh
diff --git a/tests/broker/get_next/CMakeLists.txt b/tests/automatic/broker/get_next/CMakeLists.txt
similarity index 66%
rename from tests/broker/get_next/CMakeLists.txt
rename to tests/automatic/broker/get_next/CMakeLists.txt
index 4eb27c114..8b5f3b6f0 100644
--- a/tests/broker/get_next/CMakeLists.txt
+++ b/tests/automatic/broker/get_next/CMakeLists.txt
@@ -3,6 +3,6 @@ set(TARGET_NAME hidra2-broker)
 ################################
 # Testing
 ################################
-configure_file(${CMAKE_SOURCE_DIR}/tests/settings/broker_settings.json settings.json COPYONLY)
+configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/broker_settings.json settings.json COPYONLY)
 add_script_test("${TARGET_NAME}-getnext" "$<TARGET_PROPERTY:${TARGET_NAME},EXENAME>" nomem
         )
diff --git a/tests/broker/get_next/check_linux.sh b/tests/automatic/broker/get_next/check_linux.sh
similarity index 100%
rename from tests/broker/get_next/check_linux.sh
rename to tests/automatic/broker/get_next/check_linux.sh
diff --git a/tests/broker/get_next/check_windows.bat b/tests/automatic/broker/get_next/check_windows.bat
similarity index 100%
rename from tests/broker/get_next/check_windows.bat
rename to tests/automatic/broker/get_next/check_windows.bat
diff --git a/tests/broker/read_config/CMakeLists.txt b/tests/automatic/broker/read_config/CMakeLists.txt
similarity index 71%
rename from tests/broker/read_config/CMakeLists.txt
rename to tests/automatic/broker/read_config/CMakeLists.txt
index a8949ad81..76f6467cf 100644
--- a/tests/broker/read_config/CMakeLists.txt
+++ b/tests/automatic/broker/read_config/CMakeLists.txt
@@ -3,7 +3,7 @@ set(TARGET_NAME hidra2-broker)
 ################################
 # Testing
 ################################
-configure_file(${CMAKE_SOURCE_DIR}/tests/settings/broker_settings.json settings_good.json COPYONLY)
+configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/broker_settings.json settings_good.json COPYONLY)
 configure_file(settings_bad.json settings_bad.json COPYONLY)
 add_script_test("${TARGET_NAME}-readconfig" "$<TARGET_PROPERTY:${TARGET_NAME},EXENAME>" nomem
         )
diff --git a/tests/broker/read_config/check_linux.sh b/tests/automatic/broker/read_config/check_linux.sh
similarity index 100%
rename from tests/broker/read_config/check_linux.sh
rename to tests/automatic/broker/read_config/check_linux.sh
diff --git a/tests/broker/read_config/check_windows.bat b/tests/automatic/broker/read_config/check_windows.bat
similarity index 100%
rename from tests/broker/read_config/check_windows.bat
rename to tests/automatic/broker/read_config/check_windows.bat
diff --git a/tests/broker/read_config/settings_bad.json b/tests/automatic/broker/read_config/settings_bad.json
similarity index 100%
rename from tests/broker/read_config/settings_bad.json
rename to tests/automatic/broker/read_config/settings_bad.json
diff --git a/tests/common/cpp/CMakeLists.txt b/tests/automatic/common/cpp/CMakeLists.txt
similarity index 100%
rename from tests/common/cpp/CMakeLists.txt
rename to tests/automatic/common/cpp/CMakeLists.txt
diff --git a/tests/common/cpp/include/testing.h b/tests/automatic/common/cpp/include/testing.h
similarity index 100%
rename from tests/common/cpp/include/testing.h
rename to tests/automatic/common/cpp/include/testing.h
diff --git a/tests/common/cpp/src/testing.cpp b/tests/automatic/common/cpp/src/testing.cpp
similarity index 100%
rename from tests/common/cpp/src/testing.cpp
rename to tests/automatic/common/cpp/src/testing.cpp
diff --git a/tests/json_parser/CMakeLists.txt b/tests/automatic/json_parser/CMakeLists.txt
similarity index 100%
rename from tests/json_parser/CMakeLists.txt
rename to tests/automatic/json_parser/CMakeLists.txt
diff --git a/tests/json_parser/parse_config_file/CMakeLists.txt b/tests/automatic/json_parser/parse_config_file/CMakeLists.txt
similarity index 100%
rename from tests/json_parser/parse_config_file/CMakeLists.txt
rename to tests/automatic/json_parser/parse_config_file/CMakeLists.txt
diff --git a/tests/json_parser/parse_config_file/config.json b/tests/automatic/json_parser/parse_config_file/config.json
similarity index 100%
rename from tests/json_parser/parse_config_file/config.json
rename to tests/automatic/json_parser/parse_config_file/config.json
diff --git a/tests/json_parser/parse_config_file/config_bad.json b/tests/automatic/json_parser/parse_config_file/config_bad.json
similarity index 100%
rename from tests/json_parser/parse_config_file/config_bad.json
rename to tests/automatic/json_parser/parse_config_file/config_bad.json
diff --git a/tests/json_parser/parse_config_file/parse_config_file.cpp b/tests/automatic/json_parser/parse_config_file/parse_config_file.cpp
similarity index 100%
rename from tests/json_parser/parse_config_file/parse_config_file.cpp
rename to tests/automatic/json_parser/parse_config_file/parse_config_file.cpp
diff --git a/tests/mongo_db/CMakeLists.txt b/tests/automatic/mongo_db/CMakeLists.txt
similarity index 100%
rename from tests/mongo_db/CMakeLists.txt
rename to tests/automatic/mongo_db/CMakeLists.txt
diff --git a/tests/mongo_db/connect/CMakeLists.txt b/tests/automatic/mongo_db/connect/CMakeLists.txt
similarity index 100%
rename from tests/mongo_db/connect/CMakeLists.txt
rename to tests/automatic/mongo_db/connect/CMakeLists.txt
diff --git a/tests/mongo_db/connect/connect_mongodb.cpp b/tests/automatic/mongo_db/connect/connect_mongodb.cpp
similarity index 100%
rename from tests/mongo_db/connect/connect_mongodb.cpp
rename to tests/automatic/mongo_db/connect/connect_mongodb.cpp
diff --git a/tests/mongo_db/insert/CMakeLists.txt b/tests/automatic/mongo_db/insert/CMakeLists.txt
similarity index 100%
rename from tests/mongo_db/insert/CMakeLists.txt
rename to tests/automatic/mongo_db/insert/CMakeLists.txt
diff --git a/tests/mongo_db/insert/cleanup_linux.sh b/tests/automatic/mongo_db/insert/cleanup_linux.sh
similarity index 100%
rename from tests/mongo_db/insert/cleanup_linux.sh
rename to tests/automatic/mongo_db/insert/cleanup_linux.sh
diff --git a/tests/mongo_db/insert/cleanup_windows.bat b/tests/automatic/mongo_db/insert/cleanup_windows.bat
similarity index 100%
rename from tests/mongo_db/insert/cleanup_windows.bat
rename to tests/automatic/mongo_db/insert/cleanup_windows.bat
diff --git a/tests/mongo_db/insert/insert_mongodb.cpp b/tests/automatic/mongo_db/insert/insert_mongodb.cpp
similarity index 100%
rename from tests/mongo_db/insert/insert_mongodb.cpp
rename to tests/automatic/mongo_db/insert/insert_mongodb.cpp
diff --git a/tests/settings/broker_settings.json b/tests/automatic/settings/broker_settings.json
similarity index 100%
rename from tests/settings/broker_settings.json
rename to tests/automatic/settings/broker_settings.json
diff --git a/tests/system_io/CMakeLists.txt b/tests/automatic/system_io/CMakeLists.txt
similarity index 100%
rename from tests/system_io/CMakeLists.txt
rename to tests/automatic/system_io/CMakeLists.txt
diff --git a/tests/system_io/read_file_content/CMakeLists.txt b/tests/automatic/system_io/read_file_content/CMakeLists.txt
similarity index 100%
rename from tests/system_io/read_file_content/CMakeLists.txt
rename to tests/automatic/system_io/read_file_content/CMakeLists.txt
diff --git a/tests/system_io/read_file_content/cleanup_linux.sh b/tests/automatic/system_io/read_file_content/cleanup_linux.sh
similarity index 100%
rename from tests/system_io/read_file_content/cleanup_linux.sh
rename to tests/automatic/system_io/read_file_content/cleanup_linux.sh
diff --git a/tests/system_io/read_file_content/cleanup_windows.bat b/tests/automatic/system_io/read_file_content/cleanup_windows.bat
similarity index 100%
rename from tests/system_io/read_file_content/cleanup_windows.bat
rename to tests/automatic/system_io/read_file_content/cleanup_windows.bat
diff --git a/tests/system_io/read_file_content/read_file_content.cpp b/tests/automatic/system_io/read_file_content/read_file_content.cpp
similarity index 100%
rename from tests/system_io/read_file_content/read_file_content.cpp
rename to tests/automatic/system_io/read_file_content/read_file_content.cpp
diff --git a/tests/system_io/read_file_content/setup_linux.sh b/tests/automatic/system_io/read_file_content/setup_linux.sh
similarity index 100%
rename from tests/system_io/read_file_content/setup_linux.sh
rename to tests/automatic/system_io/read_file_content/setup_linux.sh
diff --git a/tests/system_io/read_file_content/setup_windows.bat b/tests/automatic/system_io/read_file_content/setup_windows.bat
similarity index 100%
rename from tests/system_io/read_file_content/setup_windows.bat
rename to tests/automatic/system_io/read_file_content/setup_windows.bat
diff --git a/tests/system_io/read_folder_content/CMakeLists.txt b/tests/automatic/system_io/read_folder_content/CMakeLists.txt
similarity index 100%
rename from tests/system_io/read_folder_content/CMakeLists.txt
rename to tests/automatic/system_io/read_folder_content/CMakeLists.txt
diff --git a/tests/system_io/read_folder_content/cleanup_linux.sh b/tests/automatic/system_io/read_folder_content/cleanup_linux.sh
similarity index 100%
rename from tests/system_io/read_folder_content/cleanup_linux.sh
rename to tests/automatic/system_io/read_folder_content/cleanup_linux.sh
diff --git a/tests/system_io/read_folder_content/cleanup_windows.bat b/tests/automatic/system_io/read_folder_content/cleanup_windows.bat
similarity index 100%
rename from tests/system_io/read_folder_content/cleanup_windows.bat
rename to tests/automatic/system_io/read_folder_content/cleanup_windows.bat
diff --git a/tests/system_io/read_folder_content/read_folder_content.cpp b/tests/automatic/system_io/read_folder_content/read_folder_content.cpp
similarity index 100%
rename from tests/system_io/read_folder_content/read_folder_content.cpp
rename to tests/automatic/system_io/read_folder_content/read_folder_content.cpp
diff --git a/tests/system_io/read_folder_content/setup_linux.sh b/tests/automatic/system_io/read_folder_content/setup_linux.sh
similarity index 100%
rename from tests/system_io/read_folder_content/setup_linux.sh
rename to tests/automatic/system_io/read_folder_content/setup_linux.sh
diff --git a/tests/system_io/read_folder_content/setup_windows.bat b/tests/automatic/system_io/read_folder_content/setup_windows.bat
similarity index 100%
rename from tests/system_io/read_folder_content/setup_windows.bat
rename to tests/automatic/system_io/read_folder_content/setup_windows.bat
diff --git a/tests/system_io/read_string_from_file/CMakeLists.txt b/tests/automatic/system_io/read_string_from_file/CMakeLists.txt
similarity index 100%
rename from tests/system_io/read_string_from_file/CMakeLists.txt
rename to tests/automatic/system_io/read_string_from_file/CMakeLists.txt
diff --git a/tests/system_io/read_string_from_file/cleanup_linux.sh b/tests/automatic/system_io/read_string_from_file/cleanup_linux.sh
similarity index 100%
rename from tests/system_io/read_string_from_file/cleanup_linux.sh
rename to tests/automatic/system_io/read_string_from_file/cleanup_linux.sh
diff --git a/tests/system_io/read_string_from_file/cleanup_windows.bat b/tests/automatic/system_io/read_string_from_file/cleanup_windows.bat
similarity index 100%
rename from tests/system_io/read_string_from_file/cleanup_windows.bat
rename to tests/automatic/system_io/read_string_from_file/cleanup_windows.bat
diff --git a/tests/system_io/read_string_from_file/read_string_from_file.cpp b/tests/automatic/system_io/read_string_from_file/read_string_from_file.cpp
similarity index 100%
rename from tests/system_io/read_string_from_file/read_string_from_file.cpp
rename to tests/automatic/system_io/read_string_from_file/read_string_from_file.cpp
diff --git a/tests/system_io/read_string_from_file/setup_linux.sh b/tests/automatic/system_io/read_string_from_file/setup_linux.sh
similarity index 100%
rename from tests/system_io/read_string_from_file/setup_linux.sh
rename to tests/automatic/system_io/read_string_from_file/setup_linux.sh
diff --git a/tests/system_io/read_string_from_file/setup_windows.bat b/tests/automatic/system_io/read_string_from_file/setup_windows.bat
similarity index 100%
rename from tests/system_io/read_string_from_file/setup_windows.bat
rename to tests/automatic/system_io/read_string_from_file/setup_windows.bat
diff --git a/tests/worker/CMakeLists.txt b/tests/automatic/worker/CMakeLists.txt
similarity index 100%
rename from tests/worker/CMakeLists.txt
rename to tests/automatic/worker/CMakeLists.txt
diff --git a/tests/worker/connect_multithread/CMakeLists.txt b/tests/automatic/worker/connect_multithread/CMakeLists.txt
similarity index 100%
rename from tests/worker/connect_multithread/CMakeLists.txt
rename to tests/automatic/worker/connect_multithread/CMakeLists.txt
diff --git a/tests/worker/connect_multithread/cleanup_linux.sh b/tests/automatic/worker/connect_multithread/cleanup_linux.sh
similarity index 100%
rename from tests/worker/connect_multithread/cleanup_linux.sh
rename to tests/automatic/worker/connect_multithread/cleanup_linux.sh
diff --git a/tests/worker/connect_multithread/cleanup_windows.bat b/tests/automatic/worker/connect_multithread/cleanup_windows.bat
similarity index 100%
rename from tests/worker/connect_multithread/cleanup_windows.bat
rename to tests/automatic/worker/connect_multithread/cleanup_windows.bat
diff --git a/tests/worker/connect_multithread/content_multithread.cpp b/tests/automatic/worker/connect_multithread/content_multithread.cpp
similarity index 100%
rename from tests/worker/connect_multithread/content_multithread.cpp
rename to tests/automatic/worker/connect_multithread/content_multithread.cpp
diff --git a/tests/worker/connect_multithread/setup_linux.sh b/tests/automatic/worker/connect_multithread/setup_linux.sh
similarity index 100%
rename from tests/worker/connect_multithread/setup_linux.sh
rename to tests/automatic/worker/connect_multithread/setup_linux.sh
diff --git a/tests/worker/connect_multithread/setup_windows.bat b/tests/automatic/worker/connect_multithread/setup_windows.bat
similarity index 100%
rename from tests/worker/connect_multithread/setup_windows.bat
rename to tests/automatic/worker/connect_multithread/setup_windows.bat
diff --git a/tests/worker/curl_http_client_get/CMakeLists.txt b/tests/automatic/worker/curl_http_client_get/CMakeLists.txt
similarity index 100%
rename from tests/worker/curl_http_client_get/CMakeLists.txt
rename to tests/automatic/worker/curl_http_client_get/CMakeLists.txt
diff --git a/tests/worker/curl_http_client_get/curl_httpclient_get.cpp b/tests/automatic/worker/curl_http_client_get/curl_httpclient_get.cpp
similarity index 100%
rename from tests/worker/curl_http_client_get/curl_httpclient_get.cpp
rename to tests/automatic/worker/curl_http_client_get/curl_httpclient_get.cpp
diff --git a/tests/worker/folder_to_db/CMakeLists.txt b/tests/automatic/worker/folder_to_db/CMakeLists.txt
similarity index 100%
rename from tests/worker/folder_to_db/CMakeLists.txt
rename to tests/automatic/worker/folder_to_db/CMakeLists.txt
diff --git a/tests/worker/folder_to_db/check_linux.sh b/tests/automatic/worker/folder_to_db/check_linux.sh
similarity index 100%
rename from tests/worker/folder_to_db/check_linux.sh
rename to tests/automatic/worker/folder_to_db/check_linux.sh
diff --git a/tests/worker/folder_to_db/check_windows.bat b/tests/automatic/worker/folder_to_db/check_windows.bat
similarity index 100%
rename from tests/worker/folder_to_db/check_windows.bat
rename to tests/automatic/worker/folder_to_db/check_windows.bat
diff --git a/tests/worker/next_multithread_broker/CMakeLists.txt b/tests/automatic/worker/next_multithread_broker/CMakeLists.txt
similarity index 82%
rename from tests/worker/next_multithread_broker/CMakeLists.txt
rename to tests/automatic/worker/next_multithread_broker/CMakeLists.txt
index e97403117..15b5b8ebb 100644
--- a/tests/worker/next_multithread_broker/CMakeLists.txt
+++ b/tests/automatic/worker/next_multithread_broker/CMakeLists.txt
@@ -11,7 +11,7 @@ target_link_libraries(${TARGET_NAME} test_common hidra2-worker  ${CMAKE_THREAD_L
 ################################
 # Testing
 ################################
-configure_file(${CMAKE_SOURCE_DIR}/tests/settings/broker_settings.json settings.json COPYONLY)
+configure_file(${CMAKE_SOURCE_DIR}/tests/automatic/settings/broker_settings.json settings.json COPYONLY)
 add_script_test("${TARGET_NAME}" "$<TARGET_FILE:${TARGET_NAME}> $<TARGET_PROPERTY:hidra2-broker,EXENAME>"
         )
 
diff --git a/tests/worker/next_multithread_broker/check_linux.sh b/tests/automatic/worker/next_multithread_broker/check_linux.sh
similarity index 100%
rename from tests/worker/next_multithread_broker/check_linux.sh
rename to tests/automatic/worker/next_multithread_broker/check_linux.sh
diff --git a/tests/worker/next_multithread_broker/check_windows.bat b/tests/automatic/worker/next_multithread_broker/check_windows.bat
similarity index 100%
rename from tests/worker/next_multithread_broker/check_windows.bat
rename to tests/automatic/worker/next_multithread_broker/check_windows.bat
diff --git a/tests/worker/next_multithread_broker/next_multithread_broker.cpp b/tests/automatic/worker/next_multithread_broker/next_multithread_broker.cpp
similarity index 100%
rename from tests/worker/next_multithread_broker/next_multithread_broker.cpp
rename to tests/automatic/worker/next_multithread_broker/next_multithread_broker.cpp
diff --git a/tests/worker/next_multithread_folder/CMakeLists.txt b/tests/automatic/worker/next_multithread_folder/CMakeLists.txt
similarity index 100%
rename from tests/worker/next_multithread_folder/CMakeLists.txt
rename to tests/automatic/worker/next_multithread_folder/CMakeLists.txt
diff --git a/tests/worker/next_multithread_folder/cleanup_linux.sh b/tests/automatic/worker/next_multithread_folder/cleanup_linux.sh
similarity index 100%
rename from tests/worker/next_multithread_folder/cleanup_linux.sh
rename to tests/automatic/worker/next_multithread_folder/cleanup_linux.sh
diff --git a/tests/worker/next_multithread_folder/cleanup_windows.bat b/tests/automatic/worker/next_multithread_folder/cleanup_windows.bat
similarity index 100%
rename from tests/worker/next_multithread_folder/cleanup_windows.bat
rename to tests/automatic/worker/next_multithread_folder/cleanup_windows.bat
diff --git a/tests/worker/next_multithread_folder/next_multithread_folder.cpp b/tests/automatic/worker/next_multithread_folder/next_multithread_folder.cpp
similarity index 100%
rename from tests/worker/next_multithread_folder/next_multithread_folder.cpp
rename to tests/automatic/worker/next_multithread_folder/next_multithread_folder.cpp
diff --git a/tests/worker/next_multithread_folder/setup_linux.sh b/tests/automatic/worker/next_multithread_folder/setup_linux.sh
similarity index 100%
rename from tests/worker/next_multithread_folder/setup_linux.sh
rename to tests/automatic/worker/next_multithread_folder/setup_linux.sh
diff --git a/tests/worker/next_multithread_folder/setup_windows.bat b/tests/automatic/worker/next_multithread_folder/setup_windows.bat
similarity index 100%
rename from tests/worker/next_multithread_folder/setup_windows.bat
rename to tests/automatic/worker/next_multithread_folder/setup_windows.bat
diff --git a/tests/manual/performance_broker/settings.json b/tests/manual/performance_broker/settings.json
new file mode 100644
index 000000000..c45d16f2f
--- /dev/null
+++ b/tests/manual/performance_broker/settings.json
@@ -0,0 +1,6 @@
+{
+  "BrokerDbAddress":"localhost:27017",
+  "MonitorDbAddress": "localhost:8086",
+  "MonitorDbName": "db_test",
+  "port":5005
+}
\ No newline at end of file
diff --git a/tests/manual/performance_broker/test.sh b/tests/manual/performance_broker/test.sh
new file mode 100755
index 000000000..3083e4e00
--- /dev/null
+++ b/tests/manual/performance_broker/test.sh
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+
+# starts broker, mongodb on $service_node
+# reads fileset into database
+# calls getnext_broker example from $worker_node
+
+nthreads=16
+# a directory with many files in it
+dir=/gpfs/petra3/scratch/yakubov/test
+run_name=test
+service_node=max-wgs
+
+monitor_node=zitpcx27016
+monitor_port=8086
+
+worker_node=max-display
+#worker_node=max-wgs
+
+worker_dir=~/broker_test
+service_dir=~/broker_test
+
+
+cat settings.json |
+  jq "to_entries |
+       map(if .key == \"MonitorDbAddress\"
+          then . + {value:\"${monitor_node}:${monitor_port}\"}
+          else .
+          end
+         ) |
+      from_entries" > settings_tmp.json
+
+ssh ${monitor_node} influx -execute \"create database db_test\"
+
+ssh ${service_node} docker run -d -p 27017:27017 --name mongo mongo
+#ssh ${service_node} docker run -d -p 8086 -p 8086 --name influxdb influxdb
+
+ssh ${service_node} mkdir ${service_dir}
+ssh ${worker_node} mkdir ${worker_dir}
+
+
+scp settings_tmp.json ${service_node}:${service_dir}/settings.json
+rm settings_tmp.json
+scp ../../../cmake-build-release/broker/hidra2-broker ${service_node}:${service_dir}
+ssh ${service_node} "bash -c 'cd ${service_dir}; nohup ./hidra2-broker settings.json &> ${service_dir}/broker.log &'"
+sleep 0.3
+scp ../../../cmake-build-release/worker/tools/folder_to_db/folder2db ${worker_node}:${worker_dir}
+ssh ${worker_node} ${worker_dir}/folder2db -n ${nthreads} ${dir} ${run_name} ${service_node}
+
+sleep 3
+
+scp ../../../cmake-build-release/examples/worker/getnext_broker/getnext_broker ${worker_node}:${worker_dir}
+ssh ${worker_node} ${worker_dir}/getnext_broker ${service_node}:5005 ${run_name} ${nthreads}
+
+
+
+ssh ${service_node} killall hidra2-broker
+ssh ${service_node} docker rm -f mongo
+#ssh ${service_node} docker rm -f influxdb
-- 
GitLab