Skip to content

Commit

Permalink
build: build: make mgmtd test client build conditional
Browse files Browse the repository at this point in the history
- skip test if no protoc bin present

Signed-off-by: Christian Hopps <[email protected]>
Signed-off-by: Igor Ryzhov <[email protected]>
  • Loading branch information
choppsv1 committed Jan 30, 2024
1 parent 38ce22d commit c5ef984
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,8 @@ AC_ARG_ENABLE([mgmtd],
AS_HELP_STRING([--disable-mgmtd], [do not build mgmtd]))
AC_ARG_ENABLE([mgmtd_local_validations],
AS_HELP_STRING([--enable-mgmtd-local-validations], [dev: unimplemented local validation]))
AC_ARG_ENABLE([mgmtd_test_be_client],
AS_HELP_STRING([--enable-mgmtd-test-be-client], [build test backend client]))
AC_ARG_ENABLE([ripd],
AS_HELP_STRING([--disable-ripd], [do not build ripd]))
AC_ARG_ENABLE([ripngd],
Expand Down Expand Up @@ -1811,6 +1813,10 @@ AS_IF([test "$enable_mgmtd" != "no"], [
])
])

AS_IF([test "$enable_mgmtd_test_be_client" = "yes"], [
AC_DEFINE([HAVE_MGMTD_TESTC], [1], [mgmtd_testc])
])

AS_IF([test "$enable_ripd" != "no"], [
AC_DEFINE([HAVE_RIPD], [1], [ripd])
])
Expand Down Expand Up @@ -2772,6 +2778,7 @@ AM_CONDITIONAL([VTYSH], [test "$VTYSH" = "vtysh"])
AM_CONDITIONAL([ZEBRA], [test "$enable_zebra" != "no"])
AM_CONDITIONAL([BGPD], [test "$enable_bgpd" != "no"])
AM_CONDITIONAL([MGMTD], [test "$enable_mgmtd" != "no"])
AM_CONDITIONAL([MGMTD_TESTC], [test "$enable_mgmtd_test_be_client" = "yes"])
AM_CONDITIONAL([RIPD], [test "$enable_ripd" != "no"])
AM_CONDITIONAL([OSPFD], [test "$enable_ospfd" != "no"])
AM_CONDITIONAL([LDPD], [test "$enable_ldpd" != "no"])
Expand Down
5 changes: 4 additions & 1 deletion mgmtd/subdir.am
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ noinst_HEADERS += \
zebra/zebra_cli.h \
# end

sbin_PROGRAMS += mgmtd/mgmtd mgmtd/mgmtd_testc
sbin_PROGRAMS += mgmtd/mgmtd

if MGMTD_TESTC
sbin_PROGRAMS += mgmtd/mgmtd_testc
mgmtd_mgmtd_testc_SOURCES = mgmtd/mgmt_testc.c
mgmtd_mgmtd_testc_LDADD = lib/libfrr.la
endif

mgmtd_mgmtd_SOURCES = \
mgmtd/mgmt_main.c \
Expand Down
5 changes: 5 additions & 0 deletions tests/topotests/mgmt_notif/test_notif.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def test_oper_simple(tgen):
pytest.skip(tgen.errors)

r1 = tgen.gears["r1"].net

ppath = r1.get_exec_path("protoc")
if ppath is None:
pytest.skip("No protoc present cannot run test")

check_kernel_32(r1, "11.11.11.11", 1, "")

fe_client_path = CWD + "/../lib/fe_client.py"
Expand Down

0 comments on commit c5ef984

Please sign in to comment.