You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[staticroutebfd] fix static route uninstall issue when all nexthops are not reachable (sonic-net#15575)
fix static route uninstall issue when all nexthops are not reachable.
the feature was working but the bug was introduced when support dynamic bfd enable/disable. Added UT testcase to guard this.
#from "APPL_DB" instance, static route can not be uninstalled if the static route exists in config_db and "bfd"="false" (or no bfd field)
111
+
mgr.db_name="APPL_DB"
112
+
cfg_db_cache= {
113
+
"STATIC_ROUTE|10.1.0.0/24": {
114
+
"value": {
115
+
"advertise": "false",
116
+
"nexthop": "PortChannel0001"
117
+
}
118
+
}
119
+
}
120
+
mgr.config_db=MockRedisConfigDbGet(cfg_db_cache)
121
+
122
+
set_del_test(
123
+
mgr,
124
+
"DEL",
125
+
("10.1.0.0/24",),
126
+
True,
127
+
[]
128
+
)
129
+
mocked_log_debug.assert_called_with("{} ignore appl_db static route deletion because of key {} exist in config_db and bfd is not true".format(mgr.db_name, "10.1.0.0/24"))
130
+
131
+
cfg_db_cache= {
132
+
"STATIC_ROUTE|10.1.0.0/24": {
133
+
"value": {
134
+
"advertise": "false",
135
+
"bfd": "false",
136
+
"nexthop": "PortChannel0001"
137
+
}
138
+
}
139
+
}
140
+
mgr.db_name="APPL_DB"
141
+
mgr.config_db=MockRedisConfigDbGet(cfg_db_cache)
142
+
143
+
set_del_test(
144
+
mgr,
145
+
"DEL",
146
+
("10.1.0.0/24",),
147
+
True,
148
+
[]
149
+
)
150
+
mocked_log_debug.assert_called_with("{} ignore appl_db static route deletion because of key {} exist in config_db and bfd is not true".format(mgr.db_name, "10.1.0.0/24"))
151
+
152
+
#From "APPL_DB" instance, static route can be deleted if bfd field is true in config_db
0 commit comments