diff options
-rw-r--r-- | ctrl/libhicnctrl/src/objects/face.c | 5 | ||||
-rw-r--r-- | hicn-light/src/hicn/test/test-loop.cc | 2 | ||||
-rw-r--r-- | hicn-light/src/hicn/test/test-strategy-local-remote.cc | 5 | ||||
-rw-r--r-- | lib/src/test/test_khash.cc | 4 | ||||
-rw-r--r-- | libtransport/src/core/udp_connector.cc | 4 | ||||
-rw-r--r-- | libtransport/src/protocols/fec/fec.cc | 4 | ||||
-rw-r--r-- | scripts/Dockerfile.sonarcloud | 2 | ||||
-rwxr-xr-x | tests/config.sh | 4 |
8 files changed, 19 insertions, 11 deletions
diff --git a/ctrl/libhicnctrl/src/objects/face.c b/ctrl/libhicnctrl/src/objects/face.c index b0dbcd7a5..5dbe1c8dc 100644 --- a/ctrl/libhicnctrl/src/objects/face.c +++ b/ctrl/libhicnctrl/src/objects/face.c @@ -141,10 +141,13 @@ int _hc_face_snprintf(char *s, size_t size, const hc_object_t *object) { } int hc_face_create(hc_sock_t *s, hc_face_t *face) { + int rc; hc_object_t object; memset(&object, 0, sizeof(hc_object_t)); object.face = *face; - return hc_execute(s, ACTION_CREATE, OBJECT_TYPE_FACE, &object, NULL); + rc = hc_execute(s, ACTION_CREATE, OBJECT_TYPE_FACE, &object, NULL); + face->id = object.face.id; + return rc; } int hc_face_get(hc_sock_t *s, hc_face_t *face, hc_data_t **pdata) { diff --git a/hicn-light/src/hicn/test/test-loop.cc b/hicn-light/src/hicn/test/test-loop.cc index 0ebf7a22a..71635c929 100644 --- a/hicn-light/src/hicn/test/test-loop.cc +++ b/hicn-light/src/hicn/test/test-loop.cc @@ -121,7 +121,7 @@ class LoopTest : public ::testing::Test { int client_fd = accept(test->connection_socket_, (struct sockaddr *)(&addr), &addr_len); if (client_fd == -1) { - if (errno != EAGAIN && errno != EWOULDBLOCK) { + if (errno != EAGAIN && errno != EWOULDBLOCK) { // NOSONAR fprintf(stderr, "accept failed"); } diff --git a/hicn-light/src/hicn/test/test-strategy-local-remote.cc b/hicn-light/src/hicn/test/test-strategy-local-remote.cc index 413ac4080..6693e29c8 100644 --- a/hicn-light/src/hicn/test/test-strategy-local-remote.cc +++ b/hicn-light/src/hicn/test/test-strategy-local-remote.cc @@ -131,9 +131,12 @@ TEST_F(StrategyLocalRemoteTest, InputRemoteOutputRemote) { // fake two remote connections conn = connection_table_get_by_id(forwarder_get_connection_table(fwd_), prod_conn_id); + ASSERT_TRUE(conn != NULL); conn->local = false; + conn = connection_table_get_by_id(forwarder_get_connection_table(fwd_), cons_conn_id); + ASSERT_TRUE(conn != NULL); conn->local = false; msgbuf_.connection_id = cons_conn_id; @@ -171,9 +174,11 @@ TEST_F(StrategyLocalRemoteTest, InputLocalOutputRemote) { conn = connection_table_get_by_id(forwarder_get_connection_table(fwd_), prod_conn_id); + ASSERT_TRUE(conn != NULL); conn->local = false; conn = connection_table_get_by_id(forwarder_get_connection_table(fwd_), cons_conn_id); + ASSERT_TRUE(conn != NULL); conn->local = true; msgbuf_.connection_id = cons_conn_id; diff --git a/lib/src/test/test_khash.cc b/lib/src/test/test_khash.cc index 70b2f2258..da6b62071 100644 --- a/lib/src/test/test_khash.cc +++ b/lib/src/test/test_khash.cc @@ -158,11 +158,11 @@ TEST_F (KHashTest, Collisions) Key key2 = { .x = 11 }; k = kh_put_test_map (map, &key1, &ret); - EXPECT_EQ (ret, 1); + ASSERT_EQ (ret, 1); kh_val (map, k) = 15u; k = kh_put_test_map (map, &key2, &ret); - EXPECT_EQ (ret, 1); + ASSERT_EQ (ret, 1); kh_val (map, k) = 27u; k = kh_get_test_map (map, &key1); diff --git a/libtransport/src/core/udp_connector.cc b/libtransport/src/core/udp_connector.cc index 7d059dd9d..5f620b1a8 100644 --- a/libtransport/src/core/udp_connector.cc +++ b/libtransport/src/core/udp_connector.cc @@ -181,7 +181,7 @@ void UdpTunnelConnector::writeHandler() { while (retval--) { output_buffer_.pop_front(); } - } else if (errno != EWOULDBLOCK && errno != EAGAIN) { + } else if (errno != EWOULDBLOCK && errno != EAGAIN) { // NOSONAR LOG(ERROR) << "Error sending messages: " << strerror(errno); sent_callback_(this, make_error_code(core_error::send_failed)); return; @@ -222,7 +222,7 @@ void UdpTunnelConnector::readHandler(const std::error_code &ec) { int res = recvmmsg(socket_->native_handle(), rx_msgs_ + current_position_, max_burst - current_position_, MSG_DONTWAIT, nullptr); if (res < 0) { - if (errno == EWOULDBLOCK || errno == EAGAIN) { + if (errno == EWOULDBLOCK || errno == EAGAIN) { // NOSONAR // Try again later return; } diff --git a/libtransport/src/protocols/fec/fec.cc b/libtransport/src/protocols/fec/fec.cc index 5881d4d92..d2105eb53 100644 --- a/libtransport/src/protocols/fec/fec.cc +++ b/libtransport/src/protocols/fec/fec.cc @@ -614,7 +614,7 @@ void fec_encode(struct fec_parms *code, gf *src[], gf *fec, int index, int sz) { int i, k = code->k; gf *p; - if (GF_BITS > 8) sz /= 2; + if (GF_BITS > 8) sz /= 2; // NOSONAR if (index < k) memcpy(fec, src[index], sz * sizeof(gf)); @@ -698,7 +698,7 @@ int fec_decode(struct fec_parms *code, gf *pkt[], int index[], int sz) { int row, col, k = code->k; int i = 0; - if (GF_BITS > 8) sz /= 2; + if (GF_BITS > 8) sz /= 2; // NOSONAR if (shuffle(pkt, index, k)) /* error if true */ return 1; diff --git a/scripts/Dockerfile.sonarcloud b/scripts/Dockerfile.sonarcloud index edfe986a0..e1f40a789 100644 --- a/scripts/Dockerfile.sonarcloud +++ b/scripts/Dockerfile.sonarcloud @@ -11,7 +11,7 @@ RUN apt update && apt-get install -y \ curl \ git -RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo bash - +RUN curl -sL https://deb.nodesource.com/setup_18.x | sudo bash - RUN apt update && apt-get install -y \ nodejs \ diff --git a/tests/config.sh b/tests/config.sh index 7e52901c7..2acb36be3 100755 --- a/tests/config.sh +++ b/tests/config.sh @@ -237,12 +237,12 @@ function start() { # Print also forwader log echo "Forwarder Log - CLIENT" - ${DOCKER_COMMAND} client cat "${FORWARDER_LOG_PATH}" + ${DOCKER_COMMAND} client sudo cat "${FORWARDER_LOG_PATH}" echo echo "Forwarder Log - SERVER" - ${DOCKER_COMMAND} server cat "${FORWARDER_LOG_PATH}" + ${DOCKER_COMMAND} server sudo cat "${FORWARDER_LOG_PATH}" } function stop() { |