Loading .gitlab-ci.yml +50 −2 Original line number Diff line number Diff line Loading @@ -33,13 +33,61 @@ build:ubuntu_latest: libyaml-cpp-dev libyaml-dev libcap2-bin valgrind # Build and test script: - ./bootstrap.sh - mkdir build && cd build - ../configure --enable-tests - ../configure --enable-tests CFLAGS="-fsanitize=address" CXXFLAGS="-fsanitize=address" LDFLAGS="-fsanitize=address" CPPFLAGS="-D__LOGGER_ENABLE_DEBUG__" - make -j4 - cd tests - make -j4 api - NORNS_DEBUG_OUTPUT_TO_STDERR=1 NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api 2> /tmp/test_logs/stderr.log - whoami # - NORNS_DEBUG_OUTPUT_TO_STDERR=1 NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_register_namespace]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_unregister_namespace]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_submit_copy_local_posix_files]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_submit_copy_buffer_to_file]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_register_job]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_update_job]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_unregister_job]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_ping]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_add_process]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_remove_process]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_resource_init]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_iotask_init]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::NORNS_TASK]" ## - valgrind ## --leak-check=full ## -v ## env NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_submit]" || (cat $(tail -1 tests.log)/config/urd.log && ls -lr && exit 1) # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_status]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_status]" tests/test-env.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,11 @@ test_env::test_env() : bool res = bfs::create_directory(m_base_dir); REQUIRE(res == true); { bfs::ofstream file("tests.log", std::ios_base::out | std::ios_base::trunc); file << m_uid << "\n"; } #ifndef USE_REAL_DAEMON const auto config_file = patch_libraries(m_base_dir); m_td.configure(config_file); Loading @@ -107,6 +112,11 @@ test_env::test_env(const fake_daemon_cfg& cfg) : bool res = bfs::create_directory(m_base_dir); REQUIRE(res == true); { bfs::ofstream file("tests.log", std::ios_base::out | std::ios_base::trunc); file << m_uid << "\n"; } #ifndef USE_REAL_DAEMON const auto config_file = patch_libraries(m_base_dir); m_td.configure(config_file, cfg); Loading Loading @@ -137,6 +147,11 @@ void test_env::cleanup() { } bfs::remove_all(m_base_dir); if(bfs::exists("tests.log")) { bfs::remove("tests.log"); } } test_env::~test_env() { Loading Loading
.gitlab-ci.yml +50 −2 Original line number Diff line number Diff line Loading @@ -33,13 +33,61 @@ build:ubuntu_latest: libyaml-cpp-dev libyaml-dev libcap2-bin valgrind # Build and test script: - ./bootstrap.sh - mkdir build && cd build - ../configure --enable-tests - ../configure --enable-tests CFLAGS="-fsanitize=address" CXXFLAGS="-fsanitize=address" LDFLAGS="-fsanitize=address" CPPFLAGS="-D__LOGGER_ENABLE_DEBUG__" - make -j4 - cd tests - make -j4 api - NORNS_DEBUG_OUTPUT_TO_STDERR=1 NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api 2> /tmp/test_logs/stderr.log - whoami # - NORNS_DEBUG_OUTPUT_TO_STDERR=1 NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_register_namespace]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_unregister_namespace]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_submit_copy_local_posix_files]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_submit_copy_buffer_to_file]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_register_job]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_update_job]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_unregister_job]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_ping]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_add_process]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_remove_process]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_resource_init]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_iotask_init]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::NORNS_TASK]" ## - valgrind ## --leak-check=full ## -v ## env NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_submit]" || (cat $(tail -1 tests.log)/config/urd.log && ls -lr && exit 1) # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::norns_status]" # - NORNS_DEBUG_CONFIG_FILE_OVERRIDE=1 ./api -as "[api::nornsctl_status]"
tests/test-env.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,11 @@ test_env::test_env() : bool res = bfs::create_directory(m_base_dir); REQUIRE(res == true); { bfs::ofstream file("tests.log", std::ios_base::out | std::ios_base::trunc); file << m_uid << "\n"; } #ifndef USE_REAL_DAEMON const auto config_file = patch_libraries(m_base_dir); m_td.configure(config_file); Loading @@ -107,6 +112,11 @@ test_env::test_env(const fake_daemon_cfg& cfg) : bool res = bfs::create_directory(m_base_dir); REQUIRE(res == true); { bfs::ofstream file("tests.log", std::ios_base::out | std::ios_base::trunc); file << m_uid << "\n"; } #ifndef USE_REAL_DAEMON const auto config_file = patch_libraries(m_base_dir); m_td.configure(config_file, cfg); Loading Loading @@ -137,6 +147,11 @@ void test_env::cleanup() { } bfs::remove_all(m_base_dir); if(bfs::exists("tests.log")) { bfs::remove("tests.log"); } } test_env::~test_env() { Loading