From 0e60afe075699c129077e30f53ef24aa73c821b0 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Mon, 11 Dec 2023 09:09:08 -0500 Subject: [PATCH 01/20] GitHub Actions: stop on first failure and cat ctest log --- .github/workflows/docker/build_test_ntf.sh | 64 ++++++++++++++++------ repository.cmake | 2 +- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index e6c61a176..dc140eb97 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -1,28 +1,60 @@ -#!/bin/bash +#!/usr/bin/env bash -set -e - -configure() { - cd /workspace - PATH="$PATH:$(realpath srcs/bde-tools/bin)" - export PATH - eval "$(bbs_build_env -u opt_64_cpp17)" -} +# configure() { +# cd /workspace +# PATH="$PATH:$(realpath srcs/bde-tools/bin)" +# export PATH +# eval "$(bbs_build_env -u opt_64_cpp17)" +# } build_ntf() { + local rc=0 + cd /workspace/ntf-core - sed -i s/CMakeLists.txt//g ./configure + rc=${?} + if [ ${rc} -ne 0 ]; then + echo "Failed to change directory: rc = ${rc}" + exit ${rc} + fi + + # sed -i s/CMakeLists.txt//g ./configure + ./configure --prefix /opt/bb - make -j8 - make test | tee test.log + rc=${?} + if [ ${rc} -ne 0 ]; then + echo "Failed to configure: rc = ${rc}" + exit ${rc} + fi - if cat test.log | grep -q "Errors while running CTest"; then - echo "There are errors while running UTs, exiting..." - exit 1 + make build + rc=${?} + if [ ${rc} -ne 0 ]; then + echo "Failed to build: rc = ${rc}" + exit ${rc} + fi + + make build_test + rc=${?} + if [ ${rc} -ne 0 ]; then + echo "Failed to build tests: rc = ${rc}" + exit ${rc} + fi + + make test + rc=${?} + if [ ${rc} -ne 0 ]; then + cat /workspace/ntf-core/build/Testing/Temporary/LastTest.log + echo "Failed to build tests: rc = ${rc}" + exit ${rc} fi make install + rc=${?} + if [ ${rc} -ne 0 ]; then + echo "Failed to install: rc = ${rc}" + exit ${rc} + fi } -configure +# configure build_ntf diff --git a/repository.cmake b/repository.cmake index 8ddf616dc..d0e7822d7 100644 --- a/repository.cmake +++ b/repository.cmake @@ -4696,7 +4696,7 @@ function (ntf_repository) ntf_repository_doxygen_output_path_set(VALUE ${doxygenOutputDirectory}) set(cmake_ctest_arguments ${CMAKE_CTEST_ARGUMENTS}) - list(APPEND cmake_ctest_arguments --output-junit Testing/Temporary/Test.xml) + list(APPEND cmake_ctest_arguments --stop-on-failure --output-on-failure --output-junit Testing/Temporary/Test.xml) set(CMAKE_CTEST_ARGUMENTS ${cmake_ctest_arguments} PARENT_SCOPE) set(CPACK_OUTPUT_FILE_PREFIX ${packageOutputDirectory} PARENT_SCOPE) From 79c1f8ab96f7dcd6ecc9949f547e7e108280121d Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Mon, 11 Dec 2023 13:34:23 -0500 Subject: [PATCH 02/20] GitHub Actions: cosmetica --- .github/workflows/docker/build_test_ntf.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index dc140eb97..6860d8c74 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -21,6 +21,7 @@ build_ntf() { ./configure --prefix /opt/bb rc=${?} + echo "configure: rc = ${rc}" if [ ${rc} -ne 0 ]; then echo "Failed to configure: rc = ${rc}" exit ${rc} @@ -28,6 +29,7 @@ build_ntf() { make build rc=${?} + echo "Make build: rc = ${rc}" if [ ${rc} -ne 0 ]; then echo "Failed to build: rc = ${rc}" exit ${rc} @@ -35,6 +37,7 @@ build_ntf() { make build_test rc=${?} + echo "Make build_test: rc = ${rc}" if [ ${rc} -ne 0 ]; then echo "Failed to build tests: rc = ${rc}" exit ${rc} @@ -42,6 +45,7 @@ build_ntf() { make test rc=${?} + echo "Make test: rc = ${rc}" if [ ${rc} -ne 0 ]; then cat /workspace/ntf-core/build/Testing/Temporary/LastTest.log echo "Failed to build tests: rc = ${rc}" From 813d0ad2bd59d53b980cb6230a0d07ddaa5dec5c Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Mon, 11 Dec 2023 15:06:34 -0500 Subject: [PATCH 03/20] GitHub Actions: do not tee to log files from standard makefile --- configure | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 1d597e92d..a33dc5cb5 100755 --- a/configure +++ b/configure @@ -948,7 +948,7 @@ cd ${NTF_CONFIGURE_OUTPUT} echo "${NTF_CONFIGURE_CMAKE}${NTF_CONFIGURE_CMAKE_OPTION_DISTRIBUTION_REFROOT}${NTF_CONFIGURE_CMAKE_OPTION_UFID}${NTF_CONFIGURE_CMAKE_OPTION_BUILD_TYPE}${NTF_CONFIGURE_CMAKE_OPTION_INSTALL_PREFIX}${NTF_CONFIGURE_CMAKE_OPTION_PREFIX_PATH}${NTF_CONFIGURE_CMAKE_OPTION_VERBOSE_MAKEFILE} -DCMAKE_TOOLCHAIN_FILE:PATH=${NTF_CONFIGURE_REPOSITORY}/toolchain.cmake -G \"${NTF_CONFIGURE_GENERATOR}\" -S ${NTF_CONFIGURE_REPOSITORY}" -${NTF_CONFIGURE_CMAKE}${NTF_CONFIGURE_CMAKE_OPTION_DISTRIBUTION_REFROOT}${NTF_CONFIGURE_CMAKE_OPTION_UFID}${NTF_CONFIGURE_CMAKE_OPTION_BUILD_TYPE}${NTF_CONFIGURE_CMAKE_OPTION_INSTALL_PREFIX}${NTF_CONFIGURE_CMAKE_OPTION_PREFIX_PATH}${NTF_CONFIGURE_CMAKE_OPTION_VERBOSE_MAKEFILE} -DCMAKE_TOOLCHAIN_FILE:PATH=${NTF_CONFIGURE_REPOSITORY}/toolchain.cmake -G "${NTF_CONFIGURE_GENERATOR}" -S ${NTF_CONFIGURE_REPOSITORY} 2>&1 | tee -a ${NTF_CONFIGURE_LOG_PREFIX}configure.log +${NTF_CONFIGURE_CMAKE}${NTF_CONFIGURE_CMAKE_OPTION_DISTRIBUTION_REFROOT}${NTF_CONFIGURE_CMAKE_OPTION_UFID}${NTF_CONFIGURE_CMAKE_OPTION_BUILD_TYPE}${NTF_CONFIGURE_CMAKE_OPTION_INSTALL_PREFIX}${NTF_CONFIGURE_CMAKE_OPTION_PREFIX_PATH}${NTF_CONFIGURE_CMAKE_OPTION_VERBOSE_MAKEFILE} -DCMAKE_TOOLCHAIN_FILE:PATH=${NTF_CONFIGURE_REPOSITORY}/toolchain.cmake -G "${NTF_CONFIGURE_GENERATOR}" -S ${NTF_CONFIGURE_REPOSITORY} if [ ${?} -ne 0 ]; then echo "Failed to configure" exit 1 @@ -966,21 +966,21 @@ MAKEFLAGS+=${NTF_CONFIGURE_MAKEFLAGS} all: build build: - @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel ${NTF_CONFIGURE_JOBS} 2>&1 | tee -a ${NTF_CONFIGURE_LOG_PREFIX}build.log + @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel ${NTF_CONFIGURE_JOBS} build_test: - @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel ${NTF_CONFIGURE_JOBS} --target build_test 2>&1 | tee -a ${NTF_CONFIGURE_LOG_PREFIX}build.log + @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel ${NTF_CONFIGURE_JOBS} --target build_test test: @export CTEST_PARALLEL_LEVEL=1 - @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel ${NTF_CONFIGURE_JOBS} --target build_test 2>&1 | tee -a ${NTF_CONFIGURE_LOG_PREFIX}build.log - @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel 1 --target test 2>&1 | tee -a ${NTF_CONFIGURE_LOG_PREFIX}test.log + @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel ${NTF_CONFIGURE_JOBS} --target build_test + @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel 1 --target test test_usage: - @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel 1 --target test_usage 2>&1 | tee -a ${NTF_CONFIGURE_LOG_PREFIX}test_usage.log + @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel 1 --target test_usage coverage: - @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel 1 --target coverage 2>&1 | tee -a ${NTF_CONFIGURE_LOG_PREFIX}test.log + @${NTF_CONFIGURE_CMAKE} --build ${NTF_CONFIGURE_OUTPUT} --parallel 1 --target coverage install: @${NTF_CONFIGURE_CMAKE} --install ${NTF_CONFIGURE_OUTPUT} --prefix ${NTF_CONFIGURE_INSTALL_PREFIX_OVERRIDE} From 54c4f6898459813ca402e6e75b9fad9b6740fff6 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Mon, 11 Dec 2023 15:08:14 -0500 Subject: [PATCH 04/20] GitHub Actions: tweak title --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ad1ef666a..55fab05e3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,7 +14,7 @@ concurrency: jobs: build-check: - name: "Check whether NTF builds and passes unit tests" + name: "Test/Linux" runs-on: ubuntu-latest timeout-minutes: 60 steps: From e42ff6640eced1964e82674299bd5a2dd1fba373 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Mon, 11 Dec 2023 20:42:38 -0500 Subject: [PATCH 05/20] GitHub Actions: show environment --- .github/workflows/build.yaml | 16 ++++++++-------- .github/workflows/docker/build_test_ntf.sh | 14 +++++++++++++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 55fab05e3..37a3746f2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,36 +14,36 @@ concurrency: jobs: build-check: - name: "Test/Linux" + name: "Linux" runs-on: ubuntu-latest timeout-minutes: 60 steps: - uses: actions/checkout@v3 - - name: Get cache name + - name: Cache-Identify id: get-hash run: echo "ntf_deps_hash=`cat .github/workflows/docker/build_deps.sh .github/workflows/docker/build_test_ntf.sh .github/workflows/docker/Dockerfile | shasum`" >> $GITHUB_OUTPUT - - name: Get cached dependencies docker image + - name: Cache-Lookup id: cache-restore uses: actions/cache/restore@v3 with: path: ntf_deps_image.tar.gz key: ${{ steps.get-hash.outputs.ntf_deps_hash }} - - name: Build dependencies docker image + - name: Cache-Build if: steps.cache-restore.outputs.cache-hit != 'true' run: docker build --tag ntf-deps --platform linux/amd64 .github/workflows/docker - - name: Load dependencies docker image from cache + - name: Cache-Restore if: steps.cache-restore.outputs.cache-hit == 'true' run: docker load < ntf_deps_image.tar.gz - - name: Save built dependencies docker image + - name: Cache-Save if: steps.cache-restore.outputs.cache-hit != 'true' run: docker save ntf-deps:latest | gzip > ntf_deps_image.tar.gz - - name: Cache built dependencies docker image + - name: Cache-Commit id: cache-save if: steps.cache-restore.outputs.cache-hit != 'true' uses: actions/cache/save@v3 @@ -51,6 +51,6 @@ jobs: path: ntf_deps_image.tar.gz key: ${{ steps.get-hash.outputs.ntf_deps_hash }} - - name: Run dependencies docker container + - name: Build id: ntf-deps-run run: docker run -v $(pwd):/workspace/ntf-core --name ntf-deps ntf-deps /bin/bash -c "/workspace/ntf-core/.github/workflows/docker/build_test_ntf.sh" diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index 6860d8c74..b8c0db8ab 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -17,9 +17,21 @@ build_ntf() { exit ${rc} fi + echo "Environment" + env + + echo "File: /etc/hosts" + cat /etc/hosts + + echo "File: /etc/services" + cat /etc/services + + echo "File: /etc/resolv.conf" + cat /etc/resolv.conf + # sed -i s/CMakeLists.txt//g ./configure - ./configure --prefix /opt/bb + ./configure --prefix /opt/bb --standalone rc=${?} echo "configure: rc = ${rc}" if [ ${rc} -ne 0 ]; then From 12d5c0b1812184c65343d1d818385b2aa1bc4533 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Mon, 11 Dec 2023 21:21:22 -0500 Subject: [PATCH 06/20] GitHub Actions: only test native port name resolution if /etc/servces exists --- groups/nts/ntscfg/ntscfg_platform.cpp | 31 +++++++++++++++++++++++++ groups/nts/ntscfg/ntscfg_platform.h | 8 +++++++ groups/nts/ntsu/ntsu_resolverutil.t.cpp | 18 ++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/groups/nts/ntscfg/ntscfg_platform.cpp b/groups/nts/ntscfg/ntscfg_platform.cpp index b0f2fbe79..28531d3fc 100644 --- a/groups/nts/ntscfg/ntscfg_platform.cpp +++ b/groups/nts/ntscfg/ntscfg_platform.cpp @@ -18,6 +18,7 @@ #include BSLS_IDENT_RCSID(ntscfg_platform_cpp, "$Id$ $CSID$") +#include #include #include #include @@ -187,5 +188,35 @@ bool Platform::supportsTimestamps() return s_supportsTimestamps; } +#if defined(BSLS_PLATFORM_OS_UNIX) + +bool Platform::hasHostDatabase() +{ + return bdls::FilesystemUtil::exists("/etc/hosts"); +} + +bool Platform::hasPortDatabase() +{ + return bdls::FilesystemUtil::exists("/etc/services"); +} + +#elif defined(BSLS_PLATFORM_OS_WINDOWS) + +bool Platform::hasHostDatabase() +{ + return bdls::FilesystemUtil::exists( + "C:\\Windows\\System32\\drivers\\etc\\hosts"); +} + +bool Platform::hasPortDatabase() +{ + return bdls::FilesystemUtil::exists( + "C:\\Windows\\System32\\drivers\\etc\\services"); +} + +#else +#error Not implemented +#endif + } // close package namespace } // close enterprise namespace diff --git a/groups/nts/ntscfg/ntscfg_platform.h b/groups/nts/ntscfg/ntscfg_platform.h index 042334710..04a08e2da 100644 --- a/groups/nts/ntscfg/ntscfg_platform.h +++ b/groups/nts/ntscfg/ntscfg_platform.h @@ -219,6 +219,14 @@ struct Platform { /// Return true if the version of the operating system running the current /// process supports timestamping incoming and outgoing data, otherwise return false. static bool supportsTimestamps(); + + /// Return true if the local host database (i.e. "/etc/hosts" or the + /// platform equivalent) exists, otherwise return false. + static bool hasHostDatabase(); + + /// Return true if the local host database (i.e. "/etc/hosts" or the + /// platform equivalent) exists, otherwise return false. + static bool hasPortDatabase(); }; /// @internal @brief diff --git a/groups/nts/ntsu/ntsu_resolverutil.t.cpp b/groups/nts/ntsu/ntsu_resolverutil.t.cpp index 70c890eeb..67e548421 100644 --- a/groups/nts/ntsu/ntsu_resolverutil.t.cpp +++ b/groups/nts/ntsu/ntsu_resolverutil.t.cpp @@ -16,6 +16,8 @@ #include #include +#include + #include #include #include @@ -422,6 +424,10 @@ NTSCFG_TEST_CASE(11) // Concern: Test resolution of service names to port numbers for use by // an unspecified transport. + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + ntscfg::TestAllocator ta; { ntsa::Error error; @@ -470,6 +476,10 @@ NTSCFG_TEST_CASE(12) // Concern: Test resolution of service names to port numbers for use by // a specific TCP-based transport. + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + ntscfg::TestAllocator ta; { ntsa::Error error; @@ -511,6 +521,10 @@ NTSCFG_TEST_CASE(13) // Concern: Test resolution of service names to port numbers for use by // a specific UDP-based transport. + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + ntscfg::TestAllocator ta; { ntsa::Error error; @@ -551,6 +565,10 @@ NTSCFG_TEST_CASE(14) // Concern: Test resolution of port numbers to service names. // Plan: + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + ntscfg::TestAllocator ta; { ntsa::Error error; From 0188cc1b915f1d04e6941b43cc8f341229fbeef5 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Mon, 11 Dec 2023 21:41:22 -0500 Subject: [PATCH 07/20] GitHub Actions: only test native port name resolution if /etc/servces exists --- .github/workflows/docker/build_test_ntf.sh | 3 +++ groups/ntc/ntcdns/ntcdns_database.t.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index b8c0db8ab..0d79d7807 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -17,6 +17,9 @@ build_ntf() { exit ${rc} fi + echo "CPU: $(getconf _NPROCESSORS_ONLN)" + echo "RAM: $(free -h)" + echo "Environment" env diff --git a/groups/ntc/ntcdns/ntcdns_database.t.cpp b/groups/ntc/ntcdns/ntcdns_database.t.cpp index cf4a2f1e7..934cb5788 100644 --- a/groups/ntc/ntcdns/ntcdns_database.t.cpp +++ b/groups/ntc/ntcdns/ntcdns_database.t.cpp @@ -2125,6 +2125,10 @@ NTCCFG_TEST_CASE(3) // Concern: Host database configurations from "/etc/hosts". // Plan: + if (!ntscfg::Platform::hasHostDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; @@ -2158,6 +2162,10 @@ NTCCFG_TEST_CASE(4) // Concern: Port database configurations from "/etc/services". // Plan: + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; From 8ca9143d053d060d793b91e061e3ead79808fc90 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Mon, 11 Dec 2023 22:06:55 -0500 Subject: [PATCH 08/20] GitHub Actions: only test native port name resolution if /etc/servces exists --- .github/workflows/docker/build_test_ntf.sh | 8 +++-- groups/ntc/ntcdns/ntcdns_resolver.t.cpp | 40 ++++++++++++++++++++++ groups/nts/ntsu/ntsu_resolverutil.t.cpp | 6 ++-- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index 0d79d7807..646057139 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -17,8 +17,10 @@ build_ntf() { exit ${rc} fi - echo "CPU: $(getconf _NPROCESSORS_ONLN)" - echo "RAM: $(free -h)" + local concurrency=$(getconf _NPROCESSORS_ONLN) + + echo "Cores: ${concurrency}" + free -h echo "Environment" env @@ -34,7 +36,7 @@ build_ntf() { # sed -i s/CMakeLists.txt//g ./configure - ./configure --prefix /opt/bb --standalone + ./configure --prefix /opt/bb --jobs ${concurrency} --standalone rc=${?} echo "configure: rc = ${rc}" if [ ${rc} -ne 0 ]; then diff --git a/groups/ntc/ntcdns/ntcdns_resolver.t.cpp b/groups/ntc/ntcdns/ntcdns_resolver.t.cpp index e2ff1ee70..9130d32c9 100644 --- a/groups/ntc/ntcdns/ntcdns_resolver.t.cpp +++ b/groups/ntc/ntcdns/ntcdns_resolver.t.cpp @@ -633,6 +633,14 @@ NTCCFG_TEST_CASE(6) // Concern: Test 'getIpAddress' from database. // Plan: + if (!ntscfg::Platform::hasHostDatabase()) { + return; + } + + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; @@ -731,6 +739,14 @@ NTCCFG_TEST_CASE(7) // Concern: Test 'getDomainName' from database. // Plan: + if (!ntscfg::Platform::hasHostDatabase()) { + return; + } + + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; @@ -832,6 +848,14 @@ NTCCFG_TEST_CASE(8) // Concern: Test 'getPort' from database. // Plan: + if (!ntscfg::Platform::hasHostDatabase()) { + return; + } + + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; @@ -929,6 +953,14 @@ NTCCFG_TEST_CASE(9) // Concern: Test 'getServiceName' from database. // Plan: + if (!ntscfg::Platform::hasHostDatabase()) { + return; + } + + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; @@ -1027,6 +1059,14 @@ NTCCFG_TEST_CASE(10) // Concern: Test 'getEndpoint' from database. // Plan: + if (!ntscfg::Platform::hasHostDatabase()) { + return; + } + + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; diff --git a/groups/nts/ntsu/ntsu_resolverutil.t.cpp b/groups/nts/ntsu/ntsu_resolverutil.t.cpp index 67e548421..35bad8c3a 100644 --- a/groups/nts/ntsu/ntsu_resolverutil.t.cpp +++ b/groups/nts/ntsu/ntsu_resolverutil.t.cpp @@ -674,7 +674,7 @@ NTSCFG_TEST_CASE(17) ipAddressOptions); if (error) { - NTSCFG_TEST_LOG_ERROR << "Error: " << error << NTSCFG_TEST_LOG_END; + NTSCFG_TEST_LOG_DEBUG << "Error: " << error << NTSCFG_TEST_LOG_END; } else { for (bsl::vector::const_iterator it = @@ -776,7 +776,7 @@ NTSCFG_TEST_CASE(20) ipAddressOptions); if (error) { - NTSCFG_TEST_LOG_ERROR << "Error: " << error << NTSCFG_TEST_LOG_END; + NTSCFG_TEST_LOG_DEBUG << "Error: " << error << NTSCFG_TEST_LOG_END; } else { for (bsl::vector::const_iterator it = @@ -810,7 +810,7 @@ NTSCFG_TEST_CASE(21) ipAddressOptions); if (error) { - NTSCFG_TEST_LOG_ERROR << "Error: " << error << NTSCFG_TEST_LOG_END; + NTSCFG_TEST_LOG_DEBUG << "Error: " << error << NTSCFG_TEST_LOG_END; } else { for (bsl::vector::const_iterator it = From 06d14de4c44ecf0a1798014f5b264a1bfb706839 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Mon, 11 Dec 2023 22:26:30 -0500 Subject: [PATCH 09/20] GitHub Actions: only test native port name resolution if /etc/servces exists --- groups/ntc/ntcdns/ntcdns_resolver.t.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/groups/ntc/ntcdns/ntcdns_resolver.t.cpp b/groups/ntc/ntcdns/ntcdns_resolver.t.cpp index 9130d32c9..edea0093e 100644 --- a/groups/ntc/ntcdns/ntcdns_resolver.t.cpp +++ b/groups/ntc/ntcdns/ntcdns_resolver.t.cpp @@ -1774,6 +1774,10 @@ NTCCFG_TEST_CASE(18) // Concern: Test 'getPort' from system. // Plan: + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; @@ -1850,6 +1854,10 @@ NTCCFG_TEST_CASE(19) // Concern: Test 'getServiceName' from system. // Plan: + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; @@ -1927,6 +1935,14 @@ NTCCFG_TEST_CASE(20) // Concern: Test 'getEndpoint' from system. // Plan: + if (!ntscfg::Platform::hasHostDatabase()) { + return; + } + + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; From a8b2f685947471555dfb7d6569b235c801ecc550 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Mon, 11 Dec 2023 22:48:25 -0500 Subject: [PATCH 10/20] GitHub Actions: only test native port name resolution if /etc/servces exists --- groups/ntc/ntcdns/ntcdns_utility.t.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/groups/ntc/ntcdns/ntcdns_utility.t.cpp b/groups/ntc/ntcdns/ntcdns_utility.t.cpp index e37df5e24..a51c2f58f 100644 --- a/groups/ntc/ntcdns/ntcdns_utility.t.cpp +++ b/groups/ntc/ntcdns/ntcdns_utility.t.cpp @@ -67,6 +67,10 @@ NTCCFG_TEST_CASE(2) { // Concern: Host database configurations. + if (!ntscfg::Platform::hasHostDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; @@ -88,6 +92,10 @@ NTCCFG_TEST_CASE(3) { // Concern: Port database configurations. + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); ntsa::Error error; From c32ee91c8882164314be897e793490c48d7e835e Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Tue, 12 Dec 2023 05:22:03 -0500 Subject: [PATCH 11/20] GitHub Actions: configure the build to indicate it runs during continuous integration --- .github/workflows/docker/build_test_ntf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index 646057139..69513478d 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -36,7 +36,7 @@ build_ntf() { # sed -i s/CMakeLists.txt//g ./configure - ./configure --prefix /opt/bb --jobs ${concurrency} --standalone + ./configure --prefix /opt/bb --jobs ${concurrency} --standalone --from-continuous-integration rc=${?} echo "configure: rc = ${rc}" if [ ${rc} -ne 0 ]; then From 22d71e391ac6aabf5daec619c06c5d6f52ba2a16 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Tue, 12 Dec 2023 07:53:02 -0500 Subject: [PATCH 12/20] GitHub Actions: only test native port name resolution if /etc/servces exists --- configure | 1 - groups/ntc/ntcdns/ntcdns_utility.cpp | 55 +++++++++++++++++++++----- groups/ntc/ntcdns/ntcdns_utility.t.cpp | 8 ++-- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/configure b/configure index a33dc5cb5..528c7fe8e 100755 --- a/configure +++ b/configure @@ -732,7 +732,6 @@ while true ; do --from-continuous-integration) NTF_CONFIGURE_FROM_CONTINUOUS_INTEGRATION=1 - NTF_CONFIGURE_VERBOSE=1 shift ;; --from-packaging) NTF_CONFIGURE_FROM_PACKAGING=1 ; shift ;; diff --git a/groups/ntc/ntcdns/ntcdns_utility.cpp b/groups/ntc/ntcdns/ntcdns_utility.cpp index d6972f6cd..efa0f2ade 100644 --- a/groups/ntc/ntcdns/ntcdns_utility.cpp +++ b/groups/ntc/ntcdns/ntcdns_utility.cpp @@ -1317,7 +1317,16 @@ ntsa::Error Utility::loadClientConfig(ntcdns::ClientConfig* result) { #if defined(BSLS_PLATFORM_OS_UNIX) - return loadClientConfigFromPath(result, "/etc/resolv.conf"); + const bsl::string path = "/etc/resolv.conf"; + + if (bdls::FilesystemUtil::exists(path)) { + return loadClientConfigFromPath(result, path); + } + else { + result->reset(); + sanitizeClientConfig(result); + return ntsa::Error(); + } #elif defined(BSLS_PLATFORM_OS_WINDOWS) @@ -1404,13 +1413,27 @@ ntsa::Error Utility::loadHostDatabaseConfig(ntcdns::HostDatabaseConfig* result) { #if defined(BSLS_PLATFORM_OS_UNIX) - return loadHostDatabaseConfigFromPath(result, "/etc/hosts"); + const bsl::string path = "/etc/hosts"; + + if (bdls::FilesystemUtil::exists(path)) { + return loadHostDatabaseConfigFromPath(result, path); + } + else { + result->reset(); + return ntsa::Error(); + } #elif defined(BSLS_PLATFORM_OS_WINDOWS) - return loadHostDatabaseConfigFromPath( - result, - "C:\\Windows\\System32\\drivers\\etc\\hosts"); + const bsl::string path = "C:\\Windows\\System32\\drivers\\etc\\hosts"; + + if (bdls::FilesystemUtil::exists(path)) { + return loadHostDatabaseConfigFromPath(result, path); + } + else { + result->reset(); + return ntsa::Error(); + } #else #error Not implemented @@ -1487,13 +1510,27 @@ ntsa::Error Utility::loadPortDatabaseConfig(ntcdns::PortDatabaseConfig* result) { #if defined(BSLS_PLATFORM_OS_UNIX) - return loadPortDatabaseConfigFromPath(result, "/etc/services"); + const bsl::string path = "/etc/services"; + + if (bdls::FilesystemUtil::exists(path)) { + return loadPortDatabaseConfigFromPath(result, path); + } + else { + result->reset(); + return ntsa::Error(); + } #elif defined(BSLS_PLATFORM_OS_WINDOWS) - return loadPortDatabaseConfigFromPath( - result, - "C:\\Windows\\System32\\drivers\\etc\\services"); + const bsl::string path = "C:\\Windows\\System32\\drivers\\etc\\services"; + + if (bdls::FilesystemUtil::exists(path)) { + return loadPortDatabaseConfigFromPath(result, path); + } + else { + result->reset(); + return ntsa::Error(); + } #else #error Not implemented diff --git a/groups/ntc/ntcdns/ntcdns_utility.t.cpp b/groups/ntc/ntcdns/ntcdns_utility.t.cpp index a51c2f58f..62f67b29a 100644 --- a/groups/ntc/ntcdns/ntcdns_utility.t.cpp +++ b/groups/ntc/ntcdns/ntcdns_utility.t.cpp @@ -55,7 +55,7 @@ NTCCFG_TEST_CASE(1) { ntcdns::ClientConfig clientConfig(&ta); error = ntcdns::Utility::loadClientConfig(&clientConfig); - NTCCFG_TEST_ASSERT(!error); + NTCCFG_TEST_OK(error); NTCI_LOG_STREAM_TRACE << "Client configuration = " << clientConfig << NTCI_LOG_STREAM_END; @@ -80,7 +80,7 @@ NTCCFG_TEST_CASE(2) { ntcdns::HostDatabaseConfig hostDatabaseConfig(&ta); error = ntcdns::Utility::loadHostDatabaseConfig(&hostDatabaseConfig); - NTCCFG_TEST_ASSERT(!error); + NTCCFG_TEST_OK(error); NTCI_LOG_STREAM_TRACE << "Host database = " << hostDatabaseConfig << NTCI_LOG_STREAM_END; @@ -105,7 +105,7 @@ NTCCFG_TEST_CASE(3) { ntcdns::PortDatabaseConfig portDatabaseConfig(&ta); error = ntcdns::Utility::loadPortDatabaseConfig(&portDatabaseConfig); - NTCCFG_TEST_ASSERT(!error); + NTCCFG_TEST_OK(error); NTCI_LOG_STREAM_TRACE << "Port database = " << portDatabaseConfig << NTCI_LOG_STREAM_END; @@ -126,7 +126,7 @@ NTCCFG_TEST_CASE(4) { ntcdns::ResolverConfig resolverConfig(&ta); error = ntcdns::Utility::loadResolverConfig(&resolverConfig); - NTCCFG_TEST_ASSERT(!error); + NTCCFG_TEST_OK(error); NTCI_LOG_STREAM_TRACE << "Resolver configuration = " << resolverConfig << NTCI_LOG_STREAM_END; From 5288383d2e01d5767c935464ae9a85b2ed4f45eb Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Tue, 12 Dec 2023 08:27:40 -0500 Subject: [PATCH 13/20] GitHub Actions: debug test failures --- .github/workflows/docker/build_test_ntf.sh | 8 +------- groups/ntc/ntcf/ntcf_system.t.cpp | 2 ++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index 69513478d..2aa522de6 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -33,12 +33,9 @@ build_ntf() { echo "File: /etc/resolv.conf" cat /etc/resolv.conf - - # sed -i s/CMakeLists.txt//g ./configure ./configure --prefix /opt/bb --jobs ${concurrency} --standalone --from-continuous-integration rc=${?} - echo "configure: rc = ${rc}" if [ ${rc} -ne 0 ]; then echo "Failed to configure: rc = ${rc}" exit ${rc} @@ -46,7 +43,6 @@ build_ntf() { make build rc=${?} - echo "Make build: rc = ${rc}" if [ ${rc} -ne 0 ]; then echo "Failed to build: rc = ${rc}" exit ${rc} @@ -54,15 +50,13 @@ build_ntf() { make build_test rc=${?} - echo "Make build_test: rc = ${rc}" if [ ${rc} -ne 0 ]; then echo "Failed to build tests: rc = ${rc}" exit ${rc} fi - make test + make test_ntcf_system rc=${?} - echo "Make test: rc = ${rc}" if [ ${rc} -ne 0 ]; then cat /workspace/ntf-core/build/Testing/Temporary/LastTest.log echo "Failed to build tests: rc = ${rc}" diff --git a/groups/ntc/ntcf/ntcf_system.t.cpp b/groups/ntc/ntcf/ntcf_system.t.cpp index bfdff27e4..e48ee8a73 100644 --- a/groups/ntc/ntcf/ntcf_system.t.cpp +++ b/groups/ntc/ntcf/ntcf_system.t.cpp @@ -12948,6 +12948,8 @@ void concernListenerSocketAcceptRateLimitTimerEventNotifications( NTCCFG_TEST_CASE(1) { + bsls::Log::setSeverityThreshold(bsls::LogSeverity::e_INFO); + ntccfg::TestAllocator ta; { test::concernExample1(&ta); From 20673aae872b942a172e2ae556043b02f9fccd03 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Tue, 12 Dec 2023 08:59:02 -0500 Subject: [PATCH 14/20] GitHub Actions: debug test failures --- .github/workflows/docker/build_test_ntf.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index 2aa522de6..b640c4105 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -55,7 +55,9 @@ build_ntf() { exit ${rc} fi - make test_ntcf_system + # make test_ntcf_system + + ctest --test-dir /workspace/ntf-core/build --test-timeout 600 -R ntcf_system -V rc=${?} if [ ${rc} -ne 0 ]; then cat /workspace/ntf-core/build/Testing/Temporary/LastTest.log From f945fdc9682ff1b65dea681b83c48057b1a7bbc9 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Tue, 12 Dec 2023 10:17:30 -0500 Subject: [PATCH 15/20] GitHub Actions: debug test failures --- .github/workflows/docker/build_test_ntf.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index b640c4105..1e3408c55 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -7,9 +7,9 @@ # eval "$(bbs_build_env -u opt_64_cpp17)" # } -build_ntf() { +build_ntf() { local rc=0 - + cd /workspace/ntf-core rc=${?} if [ ${rc} -ne 0 ]; then @@ -21,7 +21,7 @@ build_ntf() { echo "Cores: ${concurrency}" free -h - + echo "Environment" env @@ -33,7 +33,7 @@ build_ntf() { echo "File: /etc/resolv.conf" cat /etc/resolv.conf - + ./configure --prefix /opt/bb --jobs ${concurrency} --standalone --from-continuous-integration rc=${?} if [ ${rc} -ne 0 ]; then @@ -56,8 +56,8 @@ build_ntf() { fi # make test_ntcf_system - - ctest --test-dir /workspace/ntf-core/build --test-timeout 600 -R ntcf_system -V + # ctest --test-dir /workspace/ntf-core/build --test-timeout 600 -R ntcf_system -V + /workspace/ntf-core/build/bin/ntcf_system.t 0 1 1 rc=${?} if [ ${rc} -ne 0 ]; then cat /workspace/ntf-core/build/Testing/Temporary/LastTest.log From 8ccb6099c042395295672f152a8188fe08243b28 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Tue, 12 Dec 2023 12:50:50 -0500 Subject: [PATCH 16/20] GitHub Actions: debug test failures --- .github/workflows/docker/build_test_ntf.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index 1e3408c55..8f31f82f5 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -57,7 +57,8 @@ build_ntf() { # make test_ntcf_system # ctest --test-dir /workspace/ntf-core/build --test-timeout 600 -R ntcf_system -V - /workspace/ntf-core/build/bin/ntcf_system.t 0 1 1 + #/workspace/ntf-core/build/bin/ntcf_system.t 0 1 1 1 + for test_number in {1..10}; do echo "------- TEST CASE ${test_number}"; ./build/bin/ntcf_system.t ${test_number} 1 1 1; done rc=${?} if [ ${rc} -ne 0 ]; then cat /workspace/ntf-core/build/Testing/Temporary/LastTest.log From a9f8c5c5d1eb81c8ddcae71715fb33756c12d506 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Tue, 12 Dec 2023 13:14:13 -0500 Subject: [PATCH 17/20] GitHub Actions: debug test failures --- .github/workflows/docker/build_test_ntf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index 8f31f82f5..c5214d0f2 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -58,7 +58,7 @@ build_ntf() { # make test_ntcf_system # ctest --test-dir /workspace/ntf-core/build --test-timeout 600 -R ntcf_system -V #/workspace/ntf-core/build/bin/ntcf_system.t 0 1 1 1 - for test_number in {1..10}; do echo "------- TEST CASE ${test_number}"; ./build/bin/ntcf_system.t ${test_number} 1 1 1; done + for test_number in {1..81}; do echo "------- TEST CASE ${test_number}"; ./build/bin/ntcf_system.t ${test_number}; done rc=${?} if [ ${rc} -ne 0 ]; then cat /workspace/ntf-core/build/Testing/Temporary/LastTest.log From d2d30e87b624147e87b71ac5a9c7124626c580e0 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Thu, 14 Dec 2023 08:33:51 -0500 Subject: [PATCH 18/20] GitHub Actions: debug test failures --- .github/workflows/docker/build_test_ntf.sh | 22 +++++++++----- groups/ntc/ntcf/ntcf_system.t.cpp | 34 +++++++++++++--------- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index c5214d0f2..d33865821 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -17,7 +17,7 @@ build_ntf() { exit ${rc} fi - local concurrency=$(getconf _NPROCESSORS_ONLN) + local jobs=$(getconf _NPROCESSORS_ONLN) echo "Cores: ${concurrency}" free -h @@ -34,7 +34,16 @@ build_ntf() { echo "File: /etc/resolv.conf" cat /etc/resolv.conf - ./configure --prefix /opt/bb --jobs ${concurrency} --standalone --from-continuous-integration + unset DISTRIBUTION_REFROOT + unset PREFIX + + ./configure --prefix /opt/bb \ + --output /workspace/ntf-core/build + --jobs ${jobs} \ + --standalone \ + --without-warnings \ + --without-warnings-as-errors \ + --from-continuous-integration rc=${?} if [ ${rc} -ne 0 ]; then echo "Failed to configure: rc = ${rc}" @@ -55,14 +64,11 @@ build_ntf() { exit ${rc} fi - # make test_ntcf_system - # ctest --test-dir /workspace/ntf-core/build --test-timeout 600 -R ntcf_system -V - #/workspace/ntf-core/build/bin/ntcf_system.t 0 1 1 1 - for test_number in {1..81}; do echo "------- TEST CASE ${test_number}"; ./build/bin/ntcf_system.t ${test_number}; done + make test rc=${?} if [ ${rc} -ne 0 ]; then - cat /workspace/ntf-core/build/Testing/Temporary/LastTest.log - echo "Failed to build tests: rc = ${rc}" + # cat /workspace/ntf-core/build/Testing/Temporary/LastTest.log + echo "Failed to run tests successfully: rc = ${rc}" exit ${rc} fi diff --git a/groups/ntc/ntcf/ntcf_system.t.cpp b/groups/ntc/ntcf/ntcf_system.t.cpp index e48ee8a73..8492c44cc 100644 --- a/groups/ntc/ntcf/ntcf_system.t.cpp +++ b/groups/ntc/ntcf/ntcf_system.t.cpp @@ -6454,6 +6454,10 @@ void concernResolverGetPort(bslma::Allocator* allocator) // Concern: Test 'Resolver::getPort' // Plan: + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); const bsl::size_t k_NUM_ITERATIONS = 2; @@ -6512,6 +6516,10 @@ void concernResolverGetServiceName(bslma::Allocator* allocator) // Concern: Test 'Resolver::getServiceName' // Plan: + if (!ntscfg::Platform::hasPortDatabase()) { + return; + } + NTCI_LOG_CONTEXT(); const bsl::size_t k_NUM_ITERATIONS = 2; @@ -11575,7 +11583,7 @@ void concernDatagramSocketReceiveRateLimitTimerClose( ntsa::SocketOption socketOption; socketOption.makeSendBufferSize(k_MESSAGE_SIZE); - error = ntsf::System::setOption(basicClientSocket->handle(), + error = ntsf::System::setOption(basicClientSocket->handle(), socketOption); NTCCFG_TEST_FALSE(error); } @@ -11583,8 +11591,8 @@ void concernDatagramSocketReceiveRateLimitTimerClose( { ntsa::SocketOption socketOption; error = ntsf::System::getOption( - &socketOption, - basicClientSocket->handle(), + &socketOption, + basicClientSocket->handle(), ntsa::SocketOptionType::e_SEND_BUFFER_SIZE); NTCCFG_TEST_FALSE(error); @@ -11843,7 +11851,7 @@ void concernDatagramSocketSendRateLimitTimerClose( ntsa::SocketOption socketOption; socketOption.makeSendBufferSize(k_MESSAGE_SIZE); - error = ntsf::System::setOption(basicClientSocket->handle(), + error = ntsf::System::setOption(basicClientSocket->handle(), socketOption); NTCCFG_TEST_FALSE(error); } @@ -11851,8 +11859,8 @@ void concernDatagramSocketSendRateLimitTimerClose( { ntsa::SocketOption socketOption; error = ntsf::System::getOption( - &socketOption, - basicClientSocket->handle(), + &socketOption, + basicClientSocket->handle(), ntsa::SocketOptionType::e_SEND_BUFFER_SIZE); NTCCFG_TEST_FALSE(error); @@ -12343,7 +12351,7 @@ void concernDatagramSocketReceiveRateLimitTimerEventNotifications( ntsa::SocketOption socketOption; socketOption.makeSendBufferSize(k_MESSAGE_SIZE); - error = ntsf::System::setOption(basicClientSocket->handle(), + error = ntsf::System::setOption(basicClientSocket->handle(), socketOption); NTCCFG_TEST_FALSE(error); } @@ -12351,8 +12359,8 @@ void concernDatagramSocketReceiveRateLimitTimerEventNotifications( { ntsa::SocketOption socketOption; error = ntsf::System::getOption( - &socketOption, - basicClientSocket->handle(), + &socketOption, + basicClientSocket->handle(), ntsa::SocketOptionType::e_SEND_BUFFER_SIZE); NTCCFG_TEST_FALSE(error); @@ -12496,7 +12504,7 @@ void concernDatagramSocketSendRateLimitTimerEventNotifications( ntsa::SocketOption socketOption; socketOption.makeSendBufferSize(k_MESSAGE_SIZE); - error = ntsf::System::setOption(basicClientSocket->handle(), + error = ntsf::System::setOption(basicClientSocket->handle(), socketOption); NTCCFG_TEST_FALSE(error); } @@ -12504,8 +12512,8 @@ void concernDatagramSocketSendRateLimitTimerEventNotifications( { ntsa::SocketOption socketOption; error = ntsf::System::getOption( - &socketOption, - basicClientSocket->handle(), + &socketOption, + basicClientSocket->handle(), ntsa::SocketOptionType::e_SEND_BUFFER_SIZE); NTCCFG_TEST_FALSE(error); @@ -12594,7 +12602,7 @@ void concernStreamSocketReceiveRateLimitTimerEventNotifications( NTCI_LOG_CONTEXT(); NTCI_LOG_DEBUG("Test started"); - + const ntsa::Transport::Value transport = ntsa::Transport::e_TCP_IPV4_STREAM; From 56199ff38cd9129535dc5fb7e5282de9a4c1e41a Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Thu, 14 Dec 2023 08:58:50 -0500 Subject: [PATCH 19/20] GitHub Actions: debug test failures --- .github/workflows/docker/build_test_ntf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index d33865821..933bb86f9 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -38,7 +38,7 @@ build_ntf() { unset PREFIX ./configure --prefix /opt/bb \ - --output /workspace/ntf-core/build + --output /workspace/ntf-core/build \ --jobs ${jobs} \ --standalone \ --without-warnings \ From 2ceedbb683cdc7c6ece62e5d5e16d19c44bb8427 Mon Sep 17 00:00:00 2001 From: Matt Millett Date: Thu, 14 Dec 2023 09:31:45 -0500 Subject: [PATCH 20/20] GitHub Actions: debug test failures --- .github/workflows/docker/build_test_ntf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker/build_test_ntf.sh b/.github/workflows/docker/build_test_ntf.sh index 933bb86f9..4aba1eba6 100755 --- a/.github/workflows/docker/build_test_ntf.sh +++ b/.github/workflows/docker/build_test_ntf.sh @@ -67,7 +67,7 @@ build_ntf() { make test rc=${?} if [ ${rc} -ne 0 ]; then - # cat /workspace/ntf-core/build/Testing/Temporary/LastTest.log + cat /workspace/ntf-core/build/Testing/Temporary/LastTest.log echo "Failed to run tests successfully: rc = ${rc}" exit ${rc} fi