]> git.puffer.fish Git - matthieu/frr.git/commitdiff
grpc: fix grpc for various failures
authorChristian Hopps <chopps@labn.net>
Wed, 20 Mar 2024 19:20:18 +0000 (19:20 +0000)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Fri, 22 Mar 2024 07:21:23 +0000 (07:21 +0000)
lib: don't define a `fallthrough` in c++ to avoid conflict with protobuf c++

check: add link libs required by some versions of grpc++ or it's dependent
linked libs

tests: don't fail the test due to known at exit memleaks
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 043a4183c2f10e6117695dec7a0373c1b0a63808)

doc/developer/topotests.rst
lib/compiler.h
tests/lib/subdir.am
tests/topotests/grpc_basic/test_basic_grpc.py

index 3af4048ed4cbdbe689d8b7867b8a9fae6648350d..9b9058b80fd384599ca04f24ea9ab35fb0faf64d 100644 (file)
@@ -36,16 +36,24 @@ Installing Topotest Requirements
        tshark \
        valgrind
    python3 -m pip install wheel
-   python3 -m pip install 'protobuf<4'
    python3 -m pip install 'pytest>=6.2.4' 'pytest-xdist>=2.3.0'
    python3 -m pip install 'scapy>=2.4.5'
    python3 -m pip install xmltodict
    python3 -m pip install git+https://github.com/Exa-Networks/exabgp@0659057837cd6c6351579e9f0fa47e9fb7de7311
    useradd -d /var/run/exabgp/ -s /bin/false exabgp
 
-   # To enable the gRPC topotest install:
-   # It's important to include 'protobuf<4' here to avoid incompatible grpcio-tools versions.
-   python3 -m pip install 'protobuf<4' grpcio grpcio-tools
+The version of protobuf package that is installed on your system will determine
+which versions of the python protobuf packages you need to install.
+
+.. code:: shell
+   # - Either - For protobuf version <= 3.12
+   python3 -m pip install 'protobuf<4'
+
+   # - OR- for protobuf version >= 3.21
+   python3 -m pip install 'protobuf>=4'
+
+   # To enable the gRPC topotest also install:
+   python3 -m pip install grpcio grpcio-tools
 
 
 Enable Coredumps
index 617b0c265b2bcf1c6e72371a6af82a042a53d45d..03261052a22d4efc38311d4e51013d9ccd3bdfbc 100644 (file)
@@ -32,7 +32,7 @@ extern "C" {
 #if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 5)
 #  define _RET_NONNULL    , returns_nonnull
 #endif
-#if __has_attribute(fallthrough)
+#if __has_attribute(fallthrough) && !defined(__cplusplus)
 #  define fallthrough __attribute__((fallthrough));
 #endif
 # define _CONSTRUCTOR(x)  constructor(x)
@@ -56,7 +56,7 @@ extern "C" {
 #if __GNUC__ < 5
 #  define __has_attribute(x) 0
 #endif
-#if __GNUC__ >= 7
+#if __GNUC__ >= 7 && !defined(__cplusplus)
 #  define fallthrough __attribute__((fallthrough));
 #endif
 #endif
@@ -112,7 +112,7 @@ extern "C" {
 #ifndef _ALLOC_SIZE
 # define _ALLOC_SIZE(x)
 #endif
-#ifndef fallthrough
+#if !defined(fallthrough) && !defined(__cplusplus)
 #define fallthrough
 #endif
 #ifndef _DEPRECATED
index 82314ccc04585637e73becf8f6b7dcd2cf51df0d..94df3626d679ecd7c3c244b64fe0a284a0563152 100644 (file)
@@ -25,7 +25,7 @@ copy_script: tests/lib/script1.lua
        $(INSTALL_SCRIPT) $< tests/lib/script1.lua
 
 ##############################################################################
-GRPC_TESTS_LDADD = mgmtd/libmgmt_be_nb.la staticd/libstatic.a grpc/libfrrgrpc_pb.la -lgrpc++ -lprotobuf $(ALL_TESTS_LDADD) $(LIBYANG_LIBS) -lm
+GRPC_TESTS_LDADD = mgmtd/libmgmt_be_nb.la staticd/libstatic.a grpc/libfrrgrpc_pb.la $(GRPC_LIBS) $(ALL_TESTS_LDADD) $(LIBYANG_LIBS) -lm
 
 if GRPC
 check_PROGRAMS += tests/lib/test_grpc
index bb57705a7036fb5e28424b3b0fe2f567d2c5fcdc..1ded663179e1b951943997e917c29caadc0cc1b1 100644 (file)
@@ -142,7 +142,7 @@ def test_shutdown_checks(tgen):
     time.sleep(1)
     try:
         for r in tgen.routers().values():
-            r.net.stopRouter()
+            r.net.stopRouter(False)
             r.net.checkRouterCores()
     finally:
         if p: