5f9769
From 8770192b3b4732e02679f723ea5903a515c6bd8a Mon Sep 17 00:00:00 2001
5f9769
Message-Id: <8770192b3b4732e02679f723ea5903a515c6bd8a.1611833004.git.lorenzo.bianconi@redhat.com>
5f9769
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
5f9769
Date: Fri, 15 Jan 2021 00:00:24 +0100
5f9769
Subject: [PATCH 1/2] ovn-nbctl: add bfd report to lr-route-list command
5f9769
5f9769
Introduce bfd info to lr-route-list command
5f9769
5f9769
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
5f9769
Signed-off-by: Numan Siddique <numans@ovn.org>
5f9769
---
5f9769
 tests/ovn-northd.at   | 1 +
5f9769
 utilities/ovn-nbctl.c | 5 +++++
5f9769
 2 files changed, 6 insertions(+)
5f9769
5f9769
diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
5f9769
index d22cad863..8597ca1b9 100644
5f9769
--- a/tests/ovn-northd.at
5f9769
+++ b/tests/ovn-northd.at
5f9769
@@ -2391,6 +2391,7 @@ check ovn-nbctl lr-route-add r0 100.0.0.0/8 192.168.10.2
5f9769
 route_uuid=$(fetch_column nb:logical_router_static_route _uuid ip_prefix="100.0.0.0/8")
5f9769
 check ovn-nbctl set logical_router_static_route $route_uuid bfd=$uuid
5f9769
 check_column down bfd status logical_port=r0-sw1
5f9769
+AT_CHECK([ovn-nbctl lr-route-list r0 | grep 192.168.10.2 | grep -q bfd],[0])
5f9769
 
5f9769
 check ovn-nbctl clear logical_router_static_route $route_uuid bfd
5f9769
 check_column admin_down bfd status logical_port=r0-sw1
5f9769
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
5f9769
index 94e7eedeb..788b1972e 100644
5f9769
--- a/utilities/ovn-nbctl.c
5f9769
+++ b/utilities/ovn-nbctl.c
5f9769
@@ -5502,6 +5502,11 @@ print_route(const struct nbrec_logical_router_static_route *route, struct ds *s)
5f9769
     if (smap_get(&route->external_ids, "ic-learned-route")) {
5f9769
         ds_put_format(s, " (learned)");
5f9769
     }
5f9769
+
5f9769
+    if (route->bfd) {
5f9769
+        ds_put_cstr(s, " bfd");
5f9769
+    }
5f9769
+
5f9769
     ds_put_char(s, '\n');
5f9769
 }
5f9769
 
5f9769
-- 
5f9769
2.29.2
5f9769