Signed-off-by: Vladislav Odintsov <odiv...@gmail.com>
---
 northd/northd.c     | 14 ++++++++++++++
 tests/system-ovn.at | 13 ++++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/northd/northd.c b/northd/northd.c
index 964af992f..4f8f1aaf9 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -3876,6 +3876,20 @@ ovn_lb_svc_create(struct ovsdb_idl_txn *ovnsb_txn, 
struct ovn_northd_lb *lb,
                     mon_info->sbrec_mon,
                     backend_nb->svc_mon_src_ip);
             }
+            VLOG_DBG("PORT: %s, pbid: "UUID_FMT", PB: %s, lspid: "UUID_FMT
+                     ", LSP: %s, svc->logical_port: %s, svc->status: %s",
+                     op->key,
+                     UUID_ARGS(&op->sb->header_.uuid),
+                     op->sb->up ? "UP" : "DOWN",
+                     UUID_ARGS(&op->nbsp->header_.uuid),
+                     op->nbsp->up ? "UP" : "DOWN",
+                     mon_info->sbrec_mon->logical_port,
+                     mon_info->sbrec_mon->status);
+            if ((!op->sb || !op->sb->up)
+                && !strcmp(mon_info->sbrec_mon->status, "online")) {
+                sbrec_service_monitor_set_status(mon_info->sbrec_mon,
+                                                 "offline");
+            }
 
             backend_nb->sbrec_monitor = mon_info->sbrec_mon;
             mon_info->required = true;
diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index df2da3408..9a3ed6286 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -4441,7 +4441,7 @@ 
tcp,orig=(src=10.0.0.4,dst=10.0.0.10,sport=<cleared>,dport=<cleared>),reply=(src
 
tcp,orig=(src=10.0.0.4,dst=10.0.0.10,sport=<cleared>,dport=<cleared>),reply=(src=20.0.0.3,dst=10.0.0.4,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
 ])
 
-# Stop webserer in sw0-p1
+# Stop webserver in sw0-p1
 kill `cat $sw0_p1_pid_file`
 
 # Wait until service_monitor for sw0-p1 is set to offline
@@ -4465,6 +4465,17 @@ sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
 
tcp,orig=(src=10.0.0.4,dst=10.0.0.10,sport=<cleared>,dport=<cleared>),reply=(src=20.0.0.3,dst=10.0.0.4,sport=<cleared>,dport=<cleared>),zone=<cleared>,mark=2,protoinfo=(state=<cleared>)
 ])
 
+# trigger port binding release and check if status changed to offline
+ovs-vsctl remove interface ovs-sw1-p1 external_ids iface-id
+sleep 4
+ovn-sbctl list port-b
+ovn-sbctl list service_monitor
+ovn-nbctl list logical-switch-port
+wait_row_count Service_Monitor 2
+wait_row_count Service_Monitor 2 status=offline
+wait_row_count Service_Monitor 0 status=online
+
+
 # Create udp load balancer.
 ovn-nbctl lb-add lb2 10.0.0.10:80 10.0.0.3:80,20.0.0.3:80 udp
 lb_udp=`ovn-nbctl lb-list | grep udp | awk '{print $1}'`
-- 
2.26.3

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to