Blob Blame History Raw
From 8770192b3b4732e02679f723ea5903a515c6bd8a Mon Sep 17 00:00:00 2001
Message-Id: <8770192b3b4732e02679f723ea5903a515c6bd8a.1611833004.git.lorenzo.bianconi@redhat.com>
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Date: Fri, 15 Jan 2021 00:00:24 +0100
Subject: [PATCH 1/2] ovn-nbctl: add bfd report to lr-route-list command

Introduce bfd info to lr-route-list command

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
---
 tests/ovn-northd.at   | 1 +
 utilities/ovn-nbctl.c | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index d22cad863..8597ca1b9 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -2391,6 +2391,7 @@ check ovn-nbctl lr-route-add r0 100.0.0.0/8 192.168.10.2
 route_uuid=$(fetch_column nb:logical_router_static_route _uuid ip_prefix="100.0.0.0/8")
 check ovn-nbctl set logical_router_static_route $route_uuid bfd=$uuid
 check_column down bfd status logical_port=r0-sw1
+AT_CHECK([ovn-nbctl lr-route-list r0 | grep 192.168.10.2 | grep -q bfd],[0])
 
 check ovn-nbctl clear logical_router_static_route $route_uuid bfd
 check_column admin_down bfd status logical_port=r0-sw1
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index 94e7eedeb..788b1972e 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -5502,6 +5502,11 @@ print_route(const struct nbrec_logical_router_static_route *route, struct ds *s)
     if (smap_get(&route->external_ids, "ic-learned-route")) {
         ds_put_format(s, " (learned)");
     }
+
+    if (route->bfd) {
+        ds_put_cstr(s, " bfd");
+    }
+
     ds_put_char(s, '\n');
 }
 
-- 
2.29.2