From 5a0f4dcae6cdd9e40449f6d96a50b641dd0a7bbd Mon Sep 17 00:00:00 2001
From: Sergey Yakubov <sergey.yakubov@desy.de>
Date: Mon, 10 Feb 2020 13:36:33 +0100
Subject: [PATCH] get rid of using python2/python3 explicitly

---
 CMakeLists.txt                                 | 10 ++++++++++
 CMakeModules/CodeCoverage.cmake                |  5 -----
 consumer/api/cpp/src/server_data_broker.cpp    |  8 ++++----
 .../api/cpp/unittests/test_server_broker.cpp   | 10 +++++-----
 docs/sphinx/CMakeLists.txt                     |  4 ++--
 .../getnext_broker_python/CMakeLists.txt       |  4 ++--
 .../getnext_broker_python/check_linux.sh       | 18 ++++--------------
 .../pipeline/in_to_out_python/CMakeLists.txt   |  6 +++---
 .../consumer_python_memleak/CMakeLists.txt     |  4 ++--
 .../consumer_python_memleak/check_linux.sh     |  5 ++---
 .../CMakeLists.txt                             |  6 +++---
 .../check_linux.sh                             |  2 +-
 tests/automatic/common/cpp/src/testing.cpp     |  2 +-
 .../consumer/consumer_api/consumer_api.cpp     |  4 ++--
 .../consumer_api_python/CMakeLists.txt         |  4 ++--
 .../consumer_api_python/check_linux.sh         |  6 +++---
 .../CMakeLists.txt                             |  4 ++--
 .../check_linux.sh                             |  3 ++-
 .../producer/python_api/CMakeLists.txt         |  5 ++---
 .../producer/python_api/check_linux.sh         |  4 ++--
 .../python_tests/producer/asapo_producer.so    |  1 -
 .../producer_wait_bug_mongo/asapo_producer.so  |  1 -
 .../producer_wait_threads/asapo_producer.so    |  1 -
 23 files changed, 54 insertions(+), 63 deletions(-)
 delete mode 120000 tests/manual/python_tests/producer/asapo_producer.so
 delete mode 120000 tests/manual/python_tests/producer_wait_bug_mongo/asapo_producer.so
 delete mode 120000 tests/manual/python_tests/producer_wait_threads/asapo_producer.so

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e24c017ad..adfc8069e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,6 +53,16 @@ message (STATUS "Found cURL libraries: ${CURL_LIBRARIES}")
 message (STATUS "cURL include: ${CURL_INCLUDE_DIRS}")
 
 
+if ("${Python_EXECUTABLE}" STREQUAL "")
+    find_package (Python COMPONENTS Interpreter Development)
+    if (NOT Python_FOUND)
+        message (FATAL "Cannot find Python")
+    endif()
+endif()
+message (STATUS "Using Python: ${Python_EXECUTABLE}")
+
+
+
 # format sources
 include(astyle)
 
diff --git a/CMakeModules/CodeCoverage.cmake b/CMakeModules/CodeCoverage.cmake
index c170c6a0a..c170a8a58 100644
--- a/CMakeModules/CodeCoverage.cmake
+++ b/CMakeModules/CodeCoverage.cmake
@@ -73,7 +73,6 @@ find_program( GCOV_PATH gcov )
 find_program( LCOV_PATH lcov )
 find_program( GENHTML_PATH genhtml )
 find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
-find_program( SIMPLE_PYTHON_EXECUTABLE python )
 
 if(NOT GCOV_PATH)
     message(FATAL_ERROR "gcov not found! Aborting...")
@@ -204,10 +203,6 @@ function(SETUP_TARGET_FOR_COVERAGE_COBERTURA)
     set(multiValueArgs EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
     cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
 
-    if(NOT SIMPLE_PYTHON_EXECUTABLE)
-        message(FATAL_ERROR "python not found! Aborting...")
-    endif() # NOT SIMPLE_PYTHON_EXECUTABLE
-
     if(NOT GCOVR_PATH)
         message(FATAL_ERROR "gcovr not found! Aborting...")
     endif() # NOT GCOVR_PATH
diff --git a/consumer/api/cpp/src/server_data_broker.cpp b/consumer/api/cpp/src/server_data_broker.cpp
index 016965490..685aafb10 100644
--- a/consumer/api/cpp/src/server_data_broker.cpp
+++ b/consumer/api/cpp/src/server_data_broker.cpp
@@ -481,12 +481,12 @@ DataSet ServerDataBroker::GetDatasetById(uint64_t id, std::string group_id, std:
     return GetDatasetFromServer(GetImageServerOperation::GetID, id, std::move(group_id), std::move(substream), err);
 }
 
-std::vector<std::string> ParseSubstreamsFromResponse(std::string response,Error* err) {
+std::vector<std::string> ParseSubstreamsFromResponse(std::string response, Error* err) {
     auto parser = JsonStringParser(std::move(response));
     std::vector<std::string> substreams;
     *err = parser.GetArrayString("substreams", &substreams);
     if (*err) {
-        return std::vector<std::string>{};
+        return std::vector<std::string> {};
     }
     return substreams;
 }
@@ -500,10 +500,10 @@ std::vector<std::string> ServerDataBroker::GetSubstreamList(Error* err) {
 
     auto response = BrokerRequestWithTimeout(ri, err);
     if (*err) {
-        return std::vector<std::string>{};
+        return std::vector<std::string> {};
     }
 
-    return ParseSubstreamsFromResponse(std::move(response),err);
+    return ParseSubstreamsFromResponse(std::move(response), err);
 }
 
 }
diff --git a/consumer/api/cpp/unittests/test_server_broker.cpp b/consumer/api/cpp/unittests/test_server_broker.cpp
index f51aa3700..4d9e641ad 100644
--- a/consumer/api/cpp/unittests/test_server_broker.cpp
+++ b/consumer/api/cpp/unittests/test_server_broker.cpp
@@ -987,17 +987,17 @@ TEST_F(ServerDataBrokerTests, GetSubstreamListUsesCorrectUri) {
     MockGetBrokerUri();
 
     EXPECT_CALL(mock_http_client, Get_t(expected_broker_uri + "/database/beamtime_id/" + expected_stream + "/0/substreams"
-     + "?token="+ expected_token, _,
+                                        + "?token=" + expected_token, _,
                                         _)).WillOnce(DoAll(
-        SetArgPointee<1>(HttpCode::OK),
-        SetArgPointee<2>(nullptr),
-        Return("{\"substreams\":[\"s1\",\"s2\"]}")));
+                                                SetArgPointee<1>(HttpCode::OK),
+                                                SetArgPointee<2>(nullptr),
+                                                Return("{\"substreams\":[\"s1\",\"s2\"]}")));
 
     asapo::Error err;
     auto substreams = data_broker->GetSubstreamList(&err);
     ASSERT_THAT(err, Eq(nullptr));
     ASSERT_THAT(substreams.size(), Eq(2));
-    ASSERT_THAT(substreams, testing::ElementsAre("s1","s2"));
+    ASSERT_THAT(substreams, testing::ElementsAre("s1", "s2"));
 
 }
 
diff --git a/docs/sphinx/CMakeLists.txt b/docs/sphinx/CMakeLists.txt
index a04cdcb69..77fda050e 100644
--- a/docs/sphinx/CMakeLists.txt
+++ b/docs/sphinx/CMakeLists.txt
@@ -8,5 +8,5 @@ add_custom_target(
         WORKING_DIRECTORY sphinx
 )
 
-add_dependencies(docs-py python-lib3-producer)
-add_dependencies(docs-py python-lib3)
+add_dependencies(docs-py python-lib-producer)
+add_dependencies(docs-py python-lib)
diff --git a/examples/consumer/getnext_broker_python/CMakeLists.txt b/examples/consumer/getnext_broker_python/CMakeLists.txt
index 2e13a9d90..bf53e51c5 100644
--- a/examples/consumer/getnext_broker_python/CMakeLists.txt
+++ b/examples/consumer/getnext_broker_python/CMakeLists.txt
@@ -4,12 +4,12 @@ set(TARGET_NAME getnext_broker_python)
 prepare_asapo()
 
 if (UNIX)
-    get_target_property(PYTHON_LIBS python-lib2 BINARY_DIR)
+    get_target_property(PYTHON_LIBS python-lib BINARY_DIR)
 else()
     get_target_property(PYTHON_LIBS asapo_consumer BINARY_DIR)
 endif()
 
-add_script_test("${TARGET_NAME}" ${PYTHON_LIBS} nomem)
+add_script_test("${TARGET_NAME}" "${PYTHON_LIBS} ${Python_EXECUTABLE}" nomem)
 
 configure_file(getnext.py getnext.py COPYONLY)
 
diff --git a/examples/consumer/getnext_broker_python/check_linux.sh b/examples/consumer/getnext_broker_python/check_linux.sh
index 2217862e5..b1a508025 100644
--- a/examples/consumer/getnext_broker_python/check_linux.sh
+++ b/examples/consumer/getnext_broker_python/check_linux.sh
@@ -8,8 +8,6 @@ token_test_run=K38Mqc90iRv8fC7prcFHd994mF_wfUiJnWBfIjIzieo=
 group_id=bif31l2uiddd4r0q6b40
 set -e
 
-
-
 trap Cleanup EXIT
 
 Cleanup() {
@@ -35,27 +33,19 @@ echo 'db.meta.insert({"_id":0,"meta_test":"test"})' | mongo ${database_name}
 sleep 1
 
 export PYTHONPATH=$1:${PYTHONPATH}
+Python_EXECUTABLE=$2
+
 
-python 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 $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 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 $source_path $beamtime_id $token_test_run $group_id> out
 cat out
 cat out | grep '"_id": 2'
 
-python3 getnext.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run $group_id> out
-cat out
-cat out | grep '"_id": 3'
-
-
-python3 getnext.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run new> out
-cat out
-cat out | grep '"_id": 1'
-
-
 #echo $?
 
 
diff --git a/examples/pipeline/in_to_out_python/CMakeLists.txt b/examples/pipeline/in_to_out_python/CMakeLists.txt
index c52a878b0..9ab39455b 100644
--- a/examples/pipeline/in_to_out_python/CMakeLists.txt
+++ b/examples/pipeline/in_to_out_python/CMakeLists.txt
@@ -3,8 +3,8 @@ set(TARGET_NAME pipeline_inout_python)
 prepare_asapo()
 
 if (UNIX)
-    get_target_property(PYTHON_LIBS_CONSUMER python-lib2 BINARY_DIR)
-    get_target_property(PYTHON_LIBS_PRODUCER python-lib2-producer BINARY_DIR)
+    get_target_property(PYTHON_LIBS_CONSUMER python-lib BINARY_DIR)
+    get_target_property(PYTHON_LIBS_PRODUCER python-lib-producer BINARY_DIR)
 else()
     get_target_property(PYTHON_LIBS_CONSUMER asapo_consumer BINARY_DIR)
     get_target_property(PYTHON_LIBS_PRODUCER asapo_producer BINARY_DIR)
@@ -12,5 +12,5 @@ endif()
 
 file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/in_to_out.py TEST_SCRIPT )
 
-add_script_test("${TARGET_NAME}" "python ${PYTHON_LIBS_CONSUMER} ${PYTHON_LIBS_PRODUCER} ${TEST_SCRIPT} " nomem)
+add_script_test("${TARGET_NAME}" "${Python_EXECUTABLE} ${PYTHON_LIBS_CONSUMER} ${PYTHON_LIBS_PRODUCER} ${TEST_SCRIPT} " nomem)
 
diff --git a/tests/automatic/bug_fixes/consumer_python_memleak/CMakeLists.txt b/tests/automatic/bug_fixes/consumer_python_memleak/CMakeLists.txt
index b139ef5eb..6c6b66006 100644
--- a/tests/automatic/bug_fixes/consumer_python_memleak/CMakeLists.txt
+++ b/tests/automatic/bug_fixes/consumer_python_memleak/CMakeLists.txt
@@ -4,12 +4,12 @@ set(TARGET_NAME consumer_python_memleak)
 prepare_asapo()
 
 if (UNIX)
-    get_target_property(PYTHON_LIBS python-lib2 BINARY_DIR)
+    get_target_property(PYTHON_LIBS python-lib BINARY_DIR)
 else()
     get_target_property(PYTHON_LIBS asapo_consumer BINARY_DIR)
 endif()
 
-add_script_test("${TARGET_NAME}" ${PYTHON_LIBS} nomem)
+add_script_test("${TARGET_NAME}" "${PYTHON_LIBS} ${Python_EXECUTABLE}" nomem)
 
 configure_file(memleak.py memleak.py COPYONLY)
 
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 c3dff6e8a..6b81cebc3 100644
--- a/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh
+++ b/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh
@@ -32,11 +32,10 @@ echo 'db.data_default.insert({"_id":'1',"size":'$size',"name":"'$fname'","lastch
 dd if=/dev/zero of=$fname bs=$size count=1
 
 export PYTHONPATH=$1:${PYTHONPATH}
+export Python_EXECUTABLE=$2
 
-export PYTHONPATH=/home/yakubov/projects/asapo/cmake-build-debug/consumer/api/python:${PYTHONPATH}
 
-
-python memleak.py $endpoint $path $beamtime_id $token &> out &
+$Python_EXECUTABLE memleak.py $endpoint $path $beamtime_id $token &> out &
 pid=`echo $!`
 
 sleep 1
diff --git a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/CMakeLists.txt b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/CMakeLists.txt
index d3cd169bb..08bd8372e 100644
--- a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/CMakeLists.txt
+++ b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/CMakeLists.txt
@@ -8,7 +8,7 @@ prepare_asapo()
 prepare_asapo()
 
 if (UNIX)
-    get_target_property(PYTHON_LIBS python-lib2-producer BINARY_DIR)
+    get_target_property(PYTHON_LIBS python-lib-producer BINARY_DIR)
 else()
     get_target_property(PYTHON_LIBS asapo_producer BINARY_DIR)
 endif()
@@ -16,8 +16,8 @@ endif()
 
 file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bugfix_callback.py TEST_SCRIPT )
 
-add_script_test("${TARGET_NAME}-python2" "python ${PYTHON_LIBS} ${TEST_SCRIPT} " nomem)
+add_script_test("${TARGET_NAME}-python" "${Python_EXECUTABLE} ${PYTHON_LIBS} ${TEST_SCRIPT} " nomem)
 
-add_script_test("${TARGET_NAME}-python3" "python3 ${PYTHON_LIBS} ${TEST_SCRIPT} " nomem)
+#add_script_test("${TARGET_NAME}-python3" "python3 ${PYTHON_LIBS} ${TEST_SCRIPT} " nomem)
 
 
diff --git a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_linux.sh b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_linux.sh
index 61baf3c85..67bf2b9a4 100644
--- a/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_linux.sh
+++ b/tests/automatic/bug_fixes/error-sending-data-using-callback-method/check_linux.sh
@@ -5,7 +5,7 @@ set -e
 trap Cleanup EXIT
 
 beamtime_id=asapo_test
-stream=$1
+stream=python
 beamline=test
 receiver_root_folder=/tmp/asapo/receiver/files
 facility=test_facility
diff --git a/tests/automatic/common/cpp/src/testing.cpp b/tests/automatic/common/cpp/src/testing.cpp
index 72a0b23b5..ca14d633b 100644
--- a/tests/automatic/common/cpp/src/testing.cpp
+++ b/tests/automatic/common/cpp/src/testing.cpp
@@ -16,7 +16,7 @@ void T_AssertEq(const T& expected, const T& got) {
 }
 
 void M_AssertTrue(bool value, std::string name) {
-    std::cout<<"asserting "<<name<<std::endl;
+    std::cout << "asserting " << name << std::endl;
     if (!value) {
         std::cerr << "Assert failed: " << name << "\n"
                   << "Expected:\t'" << "1" << "'\n"
diff --git a/tests/automatic/consumer/consumer_api/consumer_api.cpp b/tests/automatic/consumer/consumer_api/consumer_api.cpp
index d47e75812..9a51b41a1 100644
--- a/tests/automatic/consumer/consumer_api/consumer_api.cpp
+++ b/tests/automatic/consumer/consumer_api/consumer_api.cpp
@@ -126,7 +126,7 @@ void TestSingle(const std::unique_ptr<asapo::DataBroker>& broker, const std::str
 
 //streams
 
-    err = broker->GetNext(&fi, group_id,"stream1", nullptr);
+    err = broker->GetNext(&fi, group_id, "stream1", nullptr);
     if (err) {
         std::cout << err->Explain() << std::endl;
     }
@@ -134,7 +134,7 @@ void TestSingle(const std::unique_ptr<asapo::DataBroker>& broker, const std::str
     M_AssertTrue(err == nullptr, "GetNext stream1 no error");
     M_AssertTrue(fi.name == "11", "GetNext stream1 filename");
 
-    err = broker->GetNext(&fi, group_id,"stream2", nullptr);
+    err = broker->GetNext(&fi, group_id, "stream2", nullptr);
     M_AssertTrue(err == nullptr, "GetNext stream2 no error");
     M_AssertTrue(fi.name == "21", "GetNext stream2 filename");
 
diff --git a/tests/automatic/consumer/consumer_api_python/CMakeLists.txt b/tests/automatic/consumer/consumer_api_python/CMakeLists.txt
index 02e91a3f3..03b6ff483 100644
--- a/tests/automatic/consumer/consumer_api_python/CMakeLists.txt
+++ b/tests/automatic/consumer/consumer_api_python/CMakeLists.txt
@@ -4,11 +4,11 @@ set(TARGET_NAME consumer_api_python)
 prepare_asapo()
 
 if (UNIX)
-    get_target_property(PYTHON_LIBS python-lib2 BINARY_DIR)
+    get_target_property(PYTHON_LIBS python-lib BINARY_DIR)
 else()
     get_target_property(PYTHON_LIBS asapo_consumer BINARY_DIR)
 endif()
 
-add_script_test("${TARGET_NAME}" ${PYTHON_LIBS} nomem)
+add_script_test("${TARGET_NAME}" "${PYTHON_LIBS} ${Python_EXECUTABLE}" nomem)
 configure_file(consumer_api.py consumer_api.py COPYONLY)
 
diff --git a/tests/automatic/consumer/consumer_api_python/check_linux.sh b/tests/automatic/consumer/consumer_api_python/check_linux.sh
index 90b7d62f2..df7485701 100644
--- a/tests/automatic/consumer/consumer_api_python/check_linux.sh
+++ b/tests/automatic/consumer/consumer_api_python/check_linux.sh
@@ -44,8 +44,8 @@ done
 sleep 1
 
 export PYTHONPATH=$1:${PYTHONPATH}
-
-python consumer_api.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run single
+export Python_EXECUTABLE=$2
+$Python_EXECUTABLE consumer_api.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run single
 
 
 #check datasets
@@ -65,4 +65,4 @@ do
 done
 
 
-python consumer_api.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run datasets
+$Python_EXECUTABLE consumer_api.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run datasets
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 abb01d4f6..956e8dea6 100644
--- a/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt
+++ b/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt
@@ -6,10 +6,10 @@ set(TARGET_NAME full_chain_usermeta_python)
 prepare_asapo()
 
 if (UNIX)
-    get_target_property(PYTHON_LIBS python-lib2 BINARY_DIR)
+    get_target_property(PYTHON_LIBS python-lib BINARY_DIR)
 else()
     get_target_property(PYTHON_LIBS asapo_consumer BINARY_DIR)
 endif()
 
 
-add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_PROPERTY:asapo,EXENAME> ${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_LIBS}" nomem)
+add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_PROPERTY:asapo,EXENAME> ${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_LIBS} ${Python_EXECUTABLE}" 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 fe028afa2..fca9fca04 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
@@ -46,9 +46,10 @@ mkdir -p ${receiver_folder}
 $1 localhost:8400 ${beamtime_id} 100 100 1 0 100
 
 export PYTHONPATH=$4:${PYTHONPATH}
+export Python_EXECUTABLE=$5
 
 
-python $3/get_user_meta.py $proxy_address $receiver_folder $beamtime_id $token new > out
+$Python_EXECUTABLE $3/get_user_meta.py $proxy_address $receiver_folder $beamtime_id $token new > out
 cat out
 cat out | grep "found images: 100"
 cat out | grep "test100"
diff --git a/tests/automatic/producer/python_api/CMakeLists.txt b/tests/automatic/producer/python_api/CMakeLists.txt
index 0fccc0377..8e8282c91 100644
--- a/tests/automatic/producer/python_api/CMakeLists.txt
+++ b/tests/automatic/producer/python_api/CMakeLists.txt
@@ -8,7 +8,7 @@ prepare_asapo()
 prepare_asapo()
 
 if (UNIX)
-    get_target_property(PYTHON_LIBS python-lib2-producer BINARY_DIR)
+    get_target_property(PYTHON_LIBS python-lib-producer BINARY_DIR)
 else()
     get_target_property(PYTHON_LIBS asapo_producer BINARY_DIR)
 endif()
@@ -16,8 +16,7 @@ endif()
 
 file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/producer_api.py TEST_SCRIPT )
 
-add_script_test("${TARGET_NAME}-python2" "python ${PYTHON_LIBS} ${TEST_SCRIPT} " nomem)
+add_script_test("${TARGET_NAME}-python" "${Python_EXECUTABLE} ${PYTHON_LIBS} ${TEST_SCRIPT} " nomem)
 
-add_script_test("${TARGET_NAME}-python3" "python3 ${PYTHON_LIBS} ${TEST_SCRIPT} " nomem)
 
 
diff --git a/tests/automatic/producer/python_api/check_linux.sh b/tests/automatic/producer/python_api/check_linux.sh
index 4989ca00a..3a332e03d 100644
--- a/tests/automatic/producer/python_api/check_linux.sh
+++ b/tests/automatic/producer/python_api/check_linux.sh
@@ -5,7 +5,7 @@ set -e
 trap Cleanup EXIT
 
 beamtime_id=asapo_test
-stream=$1
+stream=python
 beamline=test
 receiver_root_folder=/tmp/asapo/receiver/files
 facility=test_facility
@@ -26,7 +26,7 @@ Cleanup() {
 
 export PYTHONPATH=$2:${PYTHONPATH}
 
-echo "db.${beamtime_id}_${stream}.insert({dummy:1})" | mongo ${beamtime_id}_${stream} >/dev/null
+echo "db.${beamtime_id}_${stream}.insert({dummy:1})" | mongo ${beamtime_id}_${stream}  >/dev/null
 
 nomad run authorizer.nmd >/dev/null
 nomad run nginx.nmd >/dev/null
diff --git a/tests/manual/python_tests/producer/asapo_producer.so b/tests/manual/python_tests/producer/asapo_producer.so
deleted file mode 120000
index cd186e180..000000000
--- a/tests/manual/python_tests/producer/asapo_producer.so
+++ /dev/null
@@ -1 +0,0 @@
-/home/yakubov/projects/asapo/cmake-build-debug/producer/api/python/asapo_producer.so
\ No newline at end of file
diff --git a/tests/manual/python_tests/producer_wait_bug_mongo/asapo_producer.so b/tests/manual/python_tests/producer_wait_bug_mongo/asapo_producer.so
deleted file mode 120000
index cd186e180..000000000
--- a/tests/manual/python_tests/producer_wait_bug_mongo/asapo_producer.so
+++ /dev/null
@@ -1 +0,0 @@
-/home/yakubov/projects/asapo/cmake-build-debug/producer/api/python/asapo_producer.so
\ No newline at end of file
diff --git a/tests/manual/python_tests/producer_wait_threads/asapo_producer.so b/tests/manual/python_tests/producer_wait_threads/asapo_producer.so
deleted file mode 120000
index cd186e180..000000000
--- a/tests/manual/python_tests/producer_wait_threads/asapo_producer.so
+++ /dev/null
@@ -1 +0,0 @@
-/home/yakubov/projects/asapo/cmake-build-debug/producer/api/python/asapo_producer.so
\ No newline at end of file
-- 
GitLab