#!/usr/bin/env python
# -*- coding: utf-8 eval: (blacken-mode 1) -*-
+# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (c) 2021-2022, LabN Consulting, L.L.C.
#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; see the file COPYING; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
"""
test_ospf_clientapi.py: Test the OSPF client API.
import pytest
from lib.common_config import retry, run_frr_cmd, step
-from lib.micronet import comm_error
+from lib.micronet import Timeout, comm_error
from lib.topogen import Topogen, TopoRouter
from lib.topotest import interface_set_status, json_cmp
# Test Setup
# ----------
+#
+# r1 - r2
+# | |
+# r4 - r3
+#
+
@pytest.fixture(scope="function", name="tgen")
def _tgen(request):
"Setup/Teardown the environment and provide tgen argument to tests"
nrouters = request.param
- if nrouters == 1:
- topodef = {"sw1:": ("r1",)}
- else:
- topodef = {f"sw{i}": (f"r{i}", f"r{i+1}") for i in range(1, nrouters)}
+ topodef = {f"sw{i}": (f"r{i}", f"r{i+1}") for i in range(1, nrouters)}
+ if nrouters == 4:
+ topodef["sw4"] = ("r4", "r1")
tgen = Topogen(topodef, request.module.__name__)
tgen.start_topology()
def myreadline(f):
buf = b""
while True:
- # logging.info("READING 1 CHAR")
+ # logging.debug("READING 1 CHAR")
c = f.read(1)
if not c:
return buf if buf else None
buf += c
- # logging.info("READ CHAR: '%s'", c)
+ # logging.debug("READ CHAR: '%s'", c)
if c == b"\n":
return buf
-def _wait_output(p, regex, timeout=120):
- retry_until = datetime.now() + timedelta(seconds=timeout)
- while datetime.now() < retry_until:
+def _wait_output(p, regex, maxwait=120):
+ timeout = Timeout(maxwait)
+ while not timeout.is_expired():
# line = p.stdout.readline()
line = myreadline(p.stdout)
if not line:
- assert None, "Timeout waiting for '{}'".format(regex)
+ assert None, "EOF waiting for '{}'".format(regex)
line = line.decode("utf-8")
line = line.rstrip()
if line:
m = re.search(regex, line)
if m:
return m
- assert None, "Failed to get output withint {}s".format(timeout)
+ assert None, "Failed to get output matching '{}' withint {} actual {}s".format(
+ regex, maxwait, timeout.elapsed()
+ )
# -----
def _test_reachability(tgen, testbin):
waitlist = [
- "192.168.0.1,192.168.0.2,192.168.0.4",
- "192.168.0.2,192.168.0.4",
- "192.168.0.1,192.168.0.2,192.168.0.4",
+ "1.0.0.0,2.0.0.0,4.0.0.0",
+ "2.0.0.0,4.0.0.0",
+ "1.0.0.0,2.0.0.0,4.0.0.0",
]
r2 = tgen.gears["r2"]
r3 = tgen.gears["r3"]
+ r4 = tgen.gears["r4"]
wait_args = [f"--wait={x}" for x in waitlist]
step("reachable: check for modified reachability")
interface_set_status(r2, "r2-eth0", False)
+ interface_set_status(r4, "r4-eth1", False)
_wait_output(p, "SUCCESS: {}".format(waitlist[1]))
step("reachable: check for restored reachability")
interface_set_status(r2, "r2-eth0", True)
+ interface_set_status(r4, "r4-eth1", True)
_wait_output(p, "SUCCESS: {}".format(waitlist[2]))
except Exception as error:
logging.error("ERROR: %s", error)
def test_ospf_reachability(tgen):
testbin = os.path.join(TESTDIR, "ctester.py")
rc, o, e = tgen.gears["r2"].net.cmd_status([testbin, "--help"])
- logging.info("%s --help: rc: %s stdout: '%s' stderr: '%s'", testbin, rc, o, e)
+ logging.debug("%s --help: rc: %s stdout: '%s' stderr: '%s'", testbin, rc, o, e)
_test_reachability(tgen, testbin)
def _test_router_id(tgen, testbin):
r1 = tgen.gears["r1"]
waitlist = [
- "192.168.0.1",
+ "1.0.0.0",
"1.1.1.1",
- "192.168.0.1",
+ "1.0.0.0",
]
mon_args = [f"--monitor={x}" for x in waitlist]
_wait_output(p, "SUCCESS: {}".format(waitlist[1]))
step("router id: check for restored router id")
- r1.vtysh_multicmd("conf t\nrouter ospf\nospf router-id 192.168.0.1")
+ r1.vtysh_multicmd("conf t\nrouter ospf\nospf router-id 1.0.0.0")
_wait_output(p, "SUCCESS: {}".format(waitlist[2]))
except Exception as error:
logging.error("ERROR: %s", error)
def test_ospf_router_id(tgen):
testbin = os.path.join(TESTDIR, "ctester.py")
rc, o, e = tgen.gears["r1"].net.cmd_status([testbin, "--help"])
- logging.info("%s --help: rc: %s stdout: '%s' stderr: '%s'", testbin, rc, o, e)
+ logging.debug("%s --help: rc: %s stdout: '%s' stderr: '%s'", testbin, rc, o, e)
_test_router_id(tgen, testbin)
try:
p = r1.popen([apibin, "-v", "add,9,10.0.1.1,230,2,00000202"])
input_dict = {
- "routerId": "192.168.0.1",
+ "routerId": "1.0.0.0",
"areas": {
"1.2.3.4": {
"linkLocalOpaqueLsa": [
{
"lsId": "230.0.0.2",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000001",
}
],
"1.2.3.4": [
{
"linkStateId": "230.0.0.2",
- "advertisingRouter": "192.168.0.1",
+ "advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
"opaqueData": "00000202",
},
p = None
p = r1.popen([apibin, "-v", "add,10,1.2.3.4,231,1,00010101"])
input_dict = {
- "routerId": "192.168.0.1",
+ "routerId": "1.0.0.0",
"areas": {
"1.2.3.4": {
"linkLocalOpaqueLsa": [
{
"lsId": "230.0.0.2",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000001",
"lsaAge": 3600,
}
"areaLocalOpaqueLsa": [
{
"lsId": "231.0.0.1",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000001",
},
],
"1.2.3.4": [
{
"linkStateId": "231.0.0.1",
- "advertisingRouter": "192.168.0.1",
+ "advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
"opaqueData": "00010101",
},
p = r1.popen([apibin, "-v", "add,11,232,3,deadbeaf01234567"])
input_dict = {
- "routerId": "192.168.0.1",
+ "routerId": "1.0.0.0",
"areas": {
"1.2.3.4": {
"areaLocalOpaqueLsa": [
{
"lsId": "231.0.0.1",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000001",
"lsaAge": 3600,
},
"asExternalOpaqueLsa": [
{
"lsId": "232.0.0.3",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000001",
},
],
"asExternalOpaqueLsa": [
{
"linkStateId": "232.0.0.3",
- "advertisingRouter": "192.168.0.1",
+ "advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
"opaqueData": "deadbeaf01234567",
},
p = None
input_dict = {
- "routerId": "192.168.0.1",
+ "routerId": "1.0.0.0",
"asExternalOpaqueLsa": [
{
"lsId": "232.0.0.3",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000001",
"lsaAge": 3600,
},
# Originate it again
p = r1.popen([apibin, "-v", "add,11,232,3,ebadf00d"])
input_dict = {
- "routerId": "192.168.0.1",
+ "routerId": "1.0.0.0",
"asExternalOpaqueLsa": [
{
"lsId": "232.0.0.3",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000002",
},
],
"asExternalOpaqueLsa": [
{
"linkStateId": "232.0.0.3",
- "advertisingRouter": "192.168.0.1",
+ "advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000002",
"opaqueData": "ebadf00d",
},
json_cmd = "show ip ospf da opaque-as json"
assert verify_ospf_database(tgen, r1, input_dict, json_cmd) is None
+ logging.debug("sending interrupt to writer api client")
p.send_signal(signal.SIGINT)
time.sleep(2)
p.wait()
raise
finally:
if p:
+ logging.debug("cleanup: sending interrupt to writer api client")
p.terminate()
p.wait()
def test_ospf_opaque_add_data3(tgen):
apibin = os.path.join(CLIENTDIR, "ospfclient.py")
rc, o, e = tgen.gears["r2"].net.cmd_status([apibin, "--help"])
- logging.info("%s --help: rc: %s stdout: '%s' stderr: '%s'", apibin, rc, o, e)
+ logging.debug("%s --help: rc: %s stdout: '%s' stderr: '%s'", apibin, rc, o, e)
_test_add_data(tgen, apibin)
p = None
pread = None
+ # Log to our stdin, stderr
+ pout = open(os.path.join(r1.net.logdir, "r1/add-del.log"), "a+")
try:
step("reachable: check for add notification")
pread = r2.popen(
- ["/usr/bin/timeout", "120", apibin, "-v"],
+ ["/usr/bin/timeout", "120", apibin, "-v", "--logtag=READER", "wait,120"],
encoding=None, # don't buffer
stdin=subprocess.DEVNULL,
stdout=subprocess.PIPE,
[
apibin,
"-v",
+ "add,9,10.0.1.1,230,1",
"add,9,10.0.1.1,230,2,00000202",
- "add,10,1.2.3.4,231,1,00010101",
"wait,1",
- "add,10,1.2.3.4,231,2",
- "add,11,232,3,ebadf00d",
+ "add,10,1.2.3.4,231,1",
+ "add,10,1.2.3.4,231,2,0102030405060708",
+ "wait,1",
+ "add,11,232,1",
+ "add,11,232,2,ebadf00d",
"wait,20",
- "del,10,1.2.3.4,231,1",
- "del,10,1.2.3.4,231,2",
+ "del,9,10.0.1.1,230,2,0",
+ "del,10,1.2.3.4,231,2,1",
+ "del,11,232,1,1",
]
)
-
add_input_dict = {
"areas": {
"1.2.3.4": {
"linkLocalOpaqueLsa": [
+ {
+ "lsId": "230.0.0.1",
+ "advertisedRouter": "1.0.0.0",
+ "sequenceNumber": "80000001",
+ "checksum": "76bf",
+ },
{
"lsId": "230.0.0.2",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000001",
- "checksum": "8142",
- }
+ "checksum": "8aa2",
+ },
],
+ "linkLocalOpaqueLsaCount": 2,
"areaLocalOpaqueLsa": [
{
"lsId": "231.0.0.1",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000001",
- "checksum": "695a",
+ "checksum": "5bd8",
},
{
"lsId": "231.0.0.2",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000001",
- "checksum": "4881",
+ "checksum": "7690",
},
],
- }
+ "areaLocalOpaqueLsaCount": 2,
+ },
},
"asExternalOpaqueLsa": [
{
- "lsId": "232.0.0.3",
- "advertisedRouter": "192.168.0.1",
+ "lsId": "232.0.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000001",
- "checksum": "c666",
- }
+ "checksum": "5ed5",
+ },
+ {
+ "lsId": "232.0.0.2",
+ "advertisedRouter": "1.0.0.0",
+ "sequenceNumber": "80000001",
+ "checksum": "d9bd",
+ },
],
+ "asExternalOpaqueLsaCount": 2,
}
step("reachable: check for add LSAs")
"linkLocalOpaqueLsa": {
"areas": {
"1.2.3.4": [
+ {
+ "linkStateId": "230.0.0.1",
+ "advertisingRouter": "1.0.0.0",
+ "lsaSeqNumber": "80000001",
+ "checksum": "76bf",
+ "length": 20,
+ "opaqueDataLength": 0,
+ },
{
"linkStateId": "230.0.0.2",
- "advertisingRouter": "192.168.0.1",
+ "advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
- "checksum": "8142",
+ "checksum": "8aa2",
"length": 24,
"opaqueId": 2,
"opaqueDataLength": 4,
- }
+ },
]
}
}
"1.2.3.4": [
{
"linkStateId": "231.0.0.1",
- "advertisingRouter": "192.168.0.1",
+ "advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
- "checksum": "695a",
- "length": 24,
- "opaqueDataLength": 4,
+ "checksum": "5bd8",
+ "length": 20,
+ "opaqueDataLength": 0,
},
{
"linkStateId": "231.0.0.2",
- "advertisingRouter": "192.168.0.1",
+ "advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
- "checksum": "4881",
- "length": 20,
- "opaqueDataLength": 0,
+ "checksum": "7690",
+ "length": 28,
+ "opaqueDataLength": 8,
},
- ]
- }
- }
+ ],
+ },
+ },
},
{
"asExternalOpaqueLsa": [
{
- "linkStateId": "232.0.0.3",
- "advertisingRouter": "192.168.0.1",
+ "linkStateId": "232.0.0.1",
+ "advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
- "checksum": "c666",
+ "checksum": "5ed5",
+ "length": 20,
+ "opaqueDataLength": 0,
+ },
+ {
+ "linkStateId": "232.0.0.2",
+ "advertisingRouter": "1.0.0.0",
+ "lsaSeqNumber": "80000001",
+ "checksum": "d9bd",
"length": 24,
"opaqueDataLength": 4,
- }
- ]
+ },
+ ],
},
]
i = 0
# Wait for add notification
# RECV: LSA update msg for LSA 232.0.0.3 in area 0.0.0.0 seq 0x80000001 len 24 age 9
- step("reachable: check for API add notifications")
- ls_ids = ["230.0.0.2", "231.0.0.1", "231.0.0.2", "232.0.0.3"]
+ ls_ids = [
+ "230.0.0.1",
+ "230.0.0.2",
+ "231.0.0.1",
+ "231.0.0.2",
+ "232.0.0.1",
+ "232.0.0.2",
+ ]
for ls_id in ls_ids:
+ step("reachable: check for API add notification: %s" % ls_id)
waitfor = "RECV:.*update msg.*LSA {}.*age ([0-9]+)".format(ls_id)
_ = _wait_output(pread, waitfor)
"areas": {
"1.2.3.4": {
"linkLocalOpaqueLsa": [
+ {
+ "lsId": "230.0.0.1",
+ "advertisedRouter": "1.0.0.0",
+ "sequenceNumber": "80000001",
+ "checksum": "76bf",
+ },
{
"lsId": "230.0.0.2",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
+ "lsaAge": 3600,
"sequenceNumber": "80000001",
- "checksum": "8142",
- }
+ "checksum": "8aa2",
+ },
],
+ "linkLocalOpaqueLsaCount": 2,
"areaLocalOpaqueLsa": [
{
- "lsaAge": 3600,
"lsId": "231.0.0.1",
- "advertisedRouter": "192.168.0.1",
+ "advertisedRouter": "1.0.0.0",
"sequenceNumber": "80000001",
- "checksum": "695a",
+ "checksum": "5bd8",
},
{
- "lsaAge": 3600,
"lsId": "231.0.0.2",
- "advertisedRouter": "192.168.0.1",
- "sequenceNumber": "80000001",
- "checksum": "4881",
+ "advertisedRouter": "1.0.0.0",
+ "lsaAge": 3600,
+ "sequenceNumber": "80000002",
+ "checksum": "4fe2",
},
],
- }
+ "areaLocalOpaqueLsaCount": 2,
+ },
},
"asExternalOpaqueLsa": [
{
- "lsId": "232.0.0.3",
- "advertisedRouter": "192.168.0.1",
+ "lsId": "232.0.0.1",
+ "advertisedRouter": "1.0.0.0",
+ "lsaAge": 3600,
"sequenceNumber": "80000001",
- "checksum": "c666",
- }
+ "checksum": "5ed5",
+ },
+ {
+ "lsId": "232.0.0.2",
+ "advertisedRouter": "1.0.0.0",
+ "sequenceNumber": "80000001",
+ "checksum": "d9bd",
+ },
],
+ "asExternalOpaqueLsaCount": 2,
}
step("reachable: check for explicit withdrawal LSAs")
assert verify_ospf_database(tgen, r1, del_input_dict, json_cmd) is None
assert verify_ospf_database(tgen, r2, del_input_dict, json_cmd) is None
+ del_detail_input_dict = [
+ {
+ "linkLocalOpaqueLsa": {
+ "areas": {
+ "1.2.3.4": [
+ {
+ "linkStateId": "230.0.0.1",
+ "advertisingRouter": "1.0.0.0",
+ "lsaSeqNumber": "80000001",
+ "checksum": "76bf",
+ "length": 20,
+ "opaqueDataLength": 0,
+ },
+ {
+ "linkStateId": "230.0.0.2",
+ "advertisingRouter": "1.0.0.0",
+ "lsaAge": 3600,
+ "lsaSeqNumber": "80000001",
+ "checksum": "8aa2",
+ "length": 24,
+ "opaqueId": 2,
+ "opaqueDataLength": 4,
+ },
+ ]
+ }
+ }
+ },
+ {
+ "areaLocalOpaqueLsa": {
+ "areas": {
+ "1.2.3.4": [
+ {
+ "linkStateId": "231.0.0.1",
+ "advertisingRouter": "1.0.0.0",
+ "lsaSeqNumber": "80000001",
+ "checksum": "5bd8",
+ "length": 20,
+ "opaqueDataLength": 0,
+ },
+ {
+ "lsaAge": 3600,
+ "linkStateId": "231.0.0.2",
+ "advertisingRouter": "1.0.0.0",
+ "lsaSeqNumber": "80000002",
+ "checksum": "4fe2",
+ # data removed
+ "length": 20,
+ "opaqueDataLength": 0,
+ },
+ ],
+ },
+ },
+ },
+ {
+ "asExternalOpaqueLsa": [
+ {
+ "linkStateId": "232.0.0.1",
+ "advertisingRouter": "1.0.0.0",
+ "lsaAge": 3600,
+ "lsaSeqNumber": "80000001",
+ "checksum": "5ed5",
+ "length": 20,
+ "opaqueDataLength": 0,
+ },
+ {
+ "linkStateId": "232.0.0.2",
+ "advertisingRouter": "1.0.0.0",
+ "lsaSeqNumber": "80000001",
+ "checksum": "d9bd",
+ "length": 24,
+ "opaqueDataLength": 4,
+ },
+ ],
+ },
+ ]
+ i = 0
+ while i < numcs:
+ step("reachable: check for delete LSA details: %s" % json_cmds[i])
+ assert (
+ verify_ospf_database(tgen, r1, del_detail_input_dict[i], json_cmds[i])
+ is None
+ )
+ assert (
+ verify_ospf_database(tgen, r2, del_detail_input_dict[i], json_cmds[i])
+ is None
+ )
+ i += 1
+
p.terminate()
if p.wait():
comm_error(p)
- del_input_dict = {
- "areas": {
- "1.2.3.4": {
- "linkLocalOpaqueLsa": [
- {
- "lsaAge": 3600,
- "lsId": "230.0.0.2",
- "advertisedRouter": "192.168.0.1",
- "sequenceNumber": "80000001",
- "checksum": "8142",
- }
- ],
- "areaLocalOpaqueLsa": [
- {
- "lsaAge": 3600,
- "lsId": "231.0.0.1",
- "advertisedRouter": "192.168.0.1",
- "sequenceNumber": "80000001",
- "checksum": "695a",
- },
- {
- "lsaAge": 3600,
- "lsId": "231.0.0.2",
- "advertisedRouter": "192.168.0.1",
- "sequenceNumber": "80000001",
- "checksum": "4881",
- },
- ],
+
+ del_detail_input_dict = [
+ {
+ "linkLocalOpaqueLsa": {
+ "areas": {
+ "1.2.3.4": [
+ {
+ "linkStateId": "230.0.0.1",
+ "advertisingRouter": "1.0.0.0",
+ "lsaAge": 3600,
+ "lsaSeqNumber": "80000001",
+ "checksum": "76bf",
+ "length": 20,
+ "opaqueDataLength": 0,
+ },
+ {
+ "linkStateId": "230.0.0.2",
+ "advertisingRouter": "1.0.0.0",
+ "lsaAge": 3600,
+ "lsaSeqNumber": "80000001",
+ "checksum": "8aa2",
+ "length": 24,
+ "opaqueId": 2,
+ "opaqueDataLength": 4,
+ },
+ ]
+ }
}
},
- "asExternalOpaqueLsa": [
- {
- "lsaAge": 3600,
- "lsId": "232.0.0.3",
- "advertisedRouter": "192.168.0.1",
- "sequenceNumber": "80000001",
- "checksum": "c666",
- }
- ],
- }
-
- step("reachable: check for implicit withdrawal LSAs")
- json_cmd = "show ip ospf da json"
- assert verify_ospf_database(tgen, r1, del_input_dict, json_cmd) is None
- assert verify_ospf_database(tgen, r2, del_input_dict, json_cmd) is None
+ {
+ "areaLocalOpaqueLsa": {
+ "areas": {
+ "1.2.3.4": [
+ {
+ "lsaAge": 3600,
+ "linkStateId": "231.0.0.1",
+ "advertisingRouter": "1.0.0.0",
+ "lsaSeqNumber": "80000001",
+ "checksum": "5bd8",
+ "length": 20,
+ "opaqueDataLength": 0,
+ },
+ {
+ "lsaAge": 3600,
+ "linkStateId": "231.0.0.2",
+ "advertisingRouter": "1.0.0.0",
+ "lsaSeqNumber": "80000002",
+ "checksum": "4fe2",
+ # data removed
+ "length": 20,
+ "opaqueDataLength": 0,
+ },
+ ],
+ },
+ },
+ },
+ {
+ "asExternalOpaqueLsa": [
+ {
+ "linkStateId": "232.0.0.1",
+ "advertisingRouter": "1.0.0.0",
+ "lsaAge": 3600,
+ "lsaSeqNumber": "80000001",
+ "checksum": "5ed5",
+ "length": 20,
+ "opaqueDataLength": 0,
+ },
+ {
+ "linkStateId": "232.0.0.2",
+ "advertisingRouter": "1.0.0.0",
+ "lsaAge": 3600,
+ "lsaSeqNumber": "80000001",
+ "checksum": "d9bd",
+ "length": 24,
+ "opaqueDataLength": 4,
+ },
+ ],
+ },
+ ]
+ i = 0
+ while i < numcs:
+ step(
+ "reachable: check for post API shutdown delete LSA details: %s"
+ % json_cmds[i]
+ )
+ assert (
+ verify_ospf_database(tgen, r1, del_detail_input_dict[i], json_cmds[i])
+ is None
+ )
+ assert (
+ verify_ospf_database(tgen, r2, del_detail_input_dict[i], json_cmds[i])
+ is None
+ )
+ i += 1
# step("reachable: check for flush/age out")
# # Wait for max age notification
# waitfor = "RECV:.*update msg.*LSA {}.*age 3600".format(ls_id)
# _wait_output(pread, waitfor)
-
- step("reachable: check for API delete notifications")
- ls_ids = ["231.0.0.1", "231.0.0.2", "230.0.0.2", "232.0.0.3"]
+ ls_ids = [
+ "230.0.0.2",
+ "231.0.0.2",
+ "232.0.0.1",
+ "230.0.0.1",
+ "231.0.0.1",
+ "232.0.0.2",
+ ]
for ls_id in ls_ids:
- waitfor = "RECV:.*delete msg.*LSA {}.*".format(ls_id)
+ step("reachable: check for API delete notification: %s" % ls_id)
+ waitfor = "RECV:.*delete msg.*LSA {}.*age".format(ls_id)
_ = _wait_output(pread, waitfor)
except Exception:
if p:
def test_ospf_opaque_delete_data3(tgen):
apibin = os.path.join(CLIENTDIR, "ospfclient.py")
rc, o, e = tgen.gears["r2"].net.cmd_status([apibin, "--help"])
- logging.info("%s --help: rc: %s stdout: '%s' stderr: '%s'", apibin, rc, o, e)
+ logging.debug("%s --help: rc: %s stdout: '%s' stderr: '%s'", apibin, rc, o, e)
_test_opaque_add_del(tgen, apibin)