Skip to content

Commit

Permalink
Merge pull request FRRouting#15587 from LabNConsulting/chopps/fix-grp…
Browse files Browse the repository at this point in the history
…c-protobuf

grpc: fix grpc for various failures
  • Loading branch information
ton31337 authored Mar 22, 2024
2 parents 08c56b4 + 043a418 commit 7ad84a4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
16 changes: 12 additions & 4 deletions doc/developer/topotests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/subdir.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/grpc_basic/test_basic_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7ad84a4

Please sign in to comment.