]> git.puffer.fish Git - mirror/frr.git/commitdiff
Quagga: make check is broken with addpath changes
authorDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 11 Dec 2015 21:12:56 +0000 (21:12 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 11 Dec 2015 21:12:56 +0000 (21:12 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-8472

The first as-path is what the original as-path for the test, the second
is what the as-path should look like once all confed SETs and SEQs have
been removed. At the time the test was written quagga did not correctly
remove confed SETs and SEQs but whoever wrote the test didn't notice
this and assumed that the behavior they were seeing was correct so used
that output to populate the second as-path.

Now that we do correctly remove the confed parts these tests fail. So
the fix is to update the second as-path for these two tests so that they
no longer contain any confed SETs/SEQs.

bgpd/bgp_updgrp.c
bgpd/bgpd.c
tests/aspath_test.c
tests/bgp_mpath_test.c

index 3ba476d086f22081d3541b3e058081302c448521..cd7710b501a8970f601f3b16b88182e19cf2c34f 100644 (file)
@@ -1577,8 +1577,11 @@ update_bgp_group_free (struct bgp *bgp)
 
   AF_FOREACH (afid)
     {
-      hash_free(bgp->update_groups[afid]);
-      bgp->update_groups[afid] = NULL;
+      if (bgp->update_groups[afid])
+        {
+          hash_free(bgp->update_groups[afid]);
+          bgp->update_groups[afid] = NULL;
+        }
     }
 }
 
index 9514f4de18354f4fc9123e3dd04f4e2398e90275..d821dc6d1bda256b2a34b7f9d2cf186542287b9a 100644 (file)
@@ -2977,8 +2977,12 @@ bgp_free (struct bgp *bgp)
 
   list_delete (bgp->group);
   list_delete (bgp->peer);
-  hash_free(bgp->peerhash);
-  bgp->peerhash = NULL;
+
+  if (bgp->peerhash)
+    {
+      hash_free(bgp->peerhash);
+      bgp->peerhash = NULL;
+    }
 
   if (bgp->name)
     XFREE(MTYPE_BGP, bgp->name);
index 8ba77b122b2d95aefbd4abb27031c36fcaca5f75..10a1517b4d4002eb6fb52fad288bd38850ffee4f 100644 (file)
@@ -134,7 +134,7 @@ static struct test_segment {
     { 0x4,0x3, 0x01,0xc8, 0x00,0x7b, 0x03,0x15 },
     8,
     { "[123,456,789]",
-      "[123,456,789]",
+      "",
       0, 1, NOT_ALL_PRIVATE, 123, 1, NULL_ASN },
   },
   { /* 9 */
@@ -672,12 +672,12 @@ static struct tests {
   },
   { &test_segments[8], &test_segments[9],
     { "[123,456,789] (123 456 789) [111,222] 8722 {4196,48658}",
-      "[123,456,789] (123 456 789) [111,222] 8722 {4196,48658}",
+      "8722 {4196,48658}",
       2, 5, NOT_ALL_PRIVATE, 456, 1, NULL_ASN },
   },
   { &test_segments[9], &test_segments[8],
     { "(123 456 789) [111,222] 8722 {4196,48658} [123,456,789]",
-      "8722 {4196,48658} [123,456,789]",
+      "8722 {4196,48658}",
       2, 5, NOT_ALL_PRIVATE, 48658, 1, NULL_ASN },
   },
   { &test_segments[14], &test_segments[11],
@@ -969,8 +969,8 @@ validate (struct aspath *as, const struct test_spec *sp)
     {
       failed++;
       fails++;
-      printf ("confed_del: %s\n", aspath_print (asconfeddel));
-      printf ("should be: %s\n", sp->shouldbe_delete_confed);
+      printf ("as-path minus confeds is: %s\n", aspath_print (asconfeddel));
+      printf ("as-path minus confeds should be: %s\n", sp->shouldbe_delete_confed);
     }
       /* aspath_str2aspath test */
   if ((aspath_print (asstr) == NULL && sp->shouldbe != NULL)
index e937784aae4ca3a58d2842ed9d61bab8e9e4ade6..3b0a3de0527cb3a4bcea2ea14c130581e0872fe5 100644 (file)
@@ -104,9 +104,6 @@ bgp_create_fake (as_t *as, const char *name)
   bgp->group = list_new ();
   //bgp->group->cmp = (int (*)(void *, void *)) peer_group_cmp;
 
-  bgp->rsclient = list_new ();
-  //bgp->rsclient->cmp = (int (*)(void*, void*)) peer_cmp;
-
   for (afi = AFI_IP; afi < AFI_MAX; afi++)
     for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
       {