Mailing List Archive

[PATCH v2 01/10] tests: fix BGP VRF interactions
From: David Lamparter <equinox@opensourcerouting.org>

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
---
tests/Makefile.am | 2 +-
tests/bgp_mpath_test.c | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 16c9e4c3db5d..c1194e9090c7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,7 +15,7 @@ EXTRA_DIST = \
testcli.in \
testcli.refout

-AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
+AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib -I$(top_srcdir)/lib/c-capnproto
DEFS = @DEFS@ $(LOCAL_OPTS) -DSYSCONFDIR=\"$(sysconfdir)/\"

if BGPD
diff --git a/tests/bgp_mpath_test.c b/tests/bgp_mpath_test.c
index 174d299870ca..bb3e3e89daba 100644
--- a/tests/bgp_mpath_test.c
+++ b/tests/bgp_mpath_test.c
@@ -27,6 +27,7 @@
#include "stream.h"
#include "privs.h"
#include "linklist.h"
+#include "hash.h"
#include "memory.h"
#include "zclient.h"
#include "filter.h"
@@ -83,6 +84,17 @@ struct zebra_privs_t bgpd_privs =

static int tty = 0;

+static unsigned int
+hash_make_dummy (void *arg)
+{
+ return 0;
+}
+static int
+hash_cmp_dummy (const void *a, const void *b)
+{
+ return 0;
+}
+
/* Create fake bgp instance */
static struct bgp *
bgp_create_fake (as_t *as, const char *name)
@@ -107,6 +119,9 @@ bgp_create_fake (as_t *as, const char *name)
bgp->rsclient = list_new ();
//bgp->rsclient->cmp = (int (*)(void*, void*)) peer_cmp;

+ bgp->vrfs = list_new ();
+ bgp->rt_subscribers = hash_create (hash_make_dummy, hash_cmp_dummy);
+
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
{
--
2.1.4


_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev