mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 02:46:34 +00:00
tests: improve the ospfapi test (move to square topology)
Signed-off-by: Christian Hopps <chopps@labn.net>
This commit is contained in:
parent
6efa8fd5c1
commit
663a0c96d9
@ -4,7 +4,12 @@ interface r1-eth0
|
||||
ip ospf dead-interval 10
|
||||
ip ospf area 1.2.3.4
|
||||
!
|
||||
interface r1-eth1
|
||||
ip ospf hello-interval 2
|
||||
ip ospf dead-interval 10
|
||||
ip ospf area 1.2.3.4
|
||||
!
|
||||
router ospf
|
||||
ospf router-id 192.168.0.1
|
||||
ospf router-id 1.0.0.0
|
||||
capability opaque
|
||||
!
|
||||
|
@ -2,3 +2,5 @@
|
||||
interface r1-eth0
|
||||
ip address 10.0.1.1/24
|
||||
!
|
||||
interface r1-eth1
|
||||
ip address 10.0.4.1/24
|
||||
|
@ -10,6 +10,6 @@ interface r2-eth1
|
||||
ip ospf area 1.2.3.4
|
||||
!
|
||||
router ospf
|
||||
ospf router-id 192.168.0.2
|
||||
ospf router-id 2.0.0.0
|
||||
capability opaque
|
||||
!
|
||||
|
@ -10,6 +10,6 @@ interface r3-eth1
|
||||
ip ospf area 1.2.3.4
|
||||
!
|
||||
router ospf
|
||||
ospf router-id 192.168.0.3
|
||||
ospf router-id 3.0.0.0
|
||||
capability opaque
|
||||
!
|
||||
|
@ -4,7 +4,12 @@ interface r4-eth0
|
||||
ip ospf dead-interval 10
|
||||
ip ospf area 1.2.3.4
|
||||
!
|
||||
interface r4-eth1
|
||||
ip ospf hello-interval 2
|
||||
ip ospf dead-interval 10
|
||||
ip ospf area 1.2.3.4
|
||||
!
|
||||
router ospf
|
||||
ospf router-id 192.168.0.4
|
||||
ospf router-id 4.0.0.0
|
||||
capability opaque
|
||||
!
|
||||
|
@ -2,3 +2,5 @@
|
||||
interface r4-eth0
|
||||
ip address 10.0.3.4/24
|
||||
!
|
||||
interface r4-eth1
|
||||
ip address 10.0.4.4/24
|
@ -21,7 +21,7 @@ from datetime import datetime, timedelta
|
||||
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
|
||||
|
||||
@ -43,15 +43,20 @@ assert os.path.exists(
|
||||
# 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()
|
||||
@ -94,23 +99,23 @@ def verify_ospf_database(tgen, dut, input_dict, cmd="show ip ospf database json"
|
||||
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:
|
||||
@ -118,7 +123,9 @@ def _wait_output(p, regex, timeout=120):
|
||||
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()
|
||||
)
|
||||
|
||||
|
||||
# -----
|
||||
@ -128,12 +135,13 @@ def _wait_output(p, regex, timeout=120):
|
||||
|
||||
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]
|
||||
|
||||
@ -151,10 +159,12 @@ def _test_reachability(tgen, testbin):
|
||||
|
||||
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)
|
||||
@ -169,16 +179,16 @@ def _test_reachability(tgen, testbin):
|
||||
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]
|
||||
@ -200,7 +210,7 @@ def _test_router_id(tgen, testbin):
|
||||
_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)
|
||||
@ -215,7 +225,7 @@ def _test_router_id(tgen, testbin):
|
||||
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)
|
||||
|
||||
|
||||
@ -230,13 +240,13 @@ def _test_add_data(tgen, apibin):
|
||||
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",
|
||||
}
|
||||
],
|
||||
@ -252,7 +262,7 @@ def _test_add_data(tgen, apibin):
|
||||
"1.2.3.4": [
|
||||
{
|
||||
"linkStateId": "230.0.0.2",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"opaqueData": "00000202",
|
||||
},
|
||||
@ -272,13 +282,13 @@ def _test_add_data(tgen, apibin):
|
||||
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,
|
||||
}
|
||||
@ -286,7 +296,7 @@ def _test_add_data(tgen, apibin):
|
||||
"areaLocalOpaqueLsa": [
|
||||
{
|
||||
"lsId": "231.0.0.1",
|
||||
"advertisedRouter": "192.168.0.1",
|
||||
"advertisedRouter": "1.0.0.0",
|
||||
"sequenceNumber": "80000001",
|
||||
},
|
||||
],
|
||||
@ -302,7 +312,7 @@ def _test_add_data(tgen, apibin):
|
||||
"1.2.3.4": [
|
||||
{
|
||||
"linkStateId": "231.0.0.1",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"opaqueData": "00010101",
|
||||
},
|
||||
@ -323,13 +333,13 @@ def _test_add_data(tgen, apibin):
|
||||
|
||||
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,
|
||||
},
|
||||
@ -339,7 +349,7 @@ def _test_add_data(tgen, apibin):
|
||||
"asExternalOpaqueLsa": [
|
||||
{
|
||||
"lsId": "232.0.0.3",
|
||||
"advertisedRouter": "192.168.0.1",
|
||||
"advertisedRouter": "1.0.0.0",
|
||||
"sequenceNumber": "80000001",
|
||||
},
|
||||
],
|
||||
@ -351,7 +361,7 @@ def _test_add_data(tgen, apibin):
|
||||
"asExternalOpaqueLsa": [
|
||||
{
|
||||
"linkStateId": "232.0.0.3",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"opaqueData": "deadbeaf01234567",
|
||||
},
|
||||
@ -369,11 +379,11 @@ def _test_add_data(tgen, apibin):
|
||||
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,
|
||||
},
|
||||
@ -387,11 +397,11 @@ def _test_add_data(tgen, apibin):
|
||||
# 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",
|
||||
},
|
||||
],
|
||||
@ -402,7 +412,7 @@ def _test_add_data(tgen, apibin):
|
||||
"asExternalOpaqueLsa": [
|
||||
{
|
||||
"linkStateId": "232.0.0.3",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000002",
|
||||
"opaqueData": "ebadf00d",
|
||||
},
|
||||
@ -412,6 +422,7 @@ def _test_add_data(tgen, apibin):
|
||||
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()
|
||||
@ -426,6 +437,7 @@ def _test_add_data(tgen, apibin):
|
||||
raise
|
||||
finally:
|
||||
if p:
|
||||
logging.debug("cleanup: sending interrupt to writer api client")
|
||||
p.terminate()
|
||||
p.wait()
|
||||
|
||||
@ -434,7 +446,7 @@ def _test_add_data(tgen, apibin):
|
||||
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)
|
||||
|
||||
|
||||
@ -446,10 +458,12 @@ def _test_opaque_add_del(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,
|
||||
@ -479,30 +493,30 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"linkLocalOpaqueLsa": [
|
||||
{
|
||||
"lsId": "230.0.0.1",
|
||||
"advertisedRouter": "192.168.0.1",
|
||||
"advertisedRouter": "1.0.0.0",
|
||||
"sequenceNumber": "80000001",
|
||||
"checksum": "6d5f",
|
||||
"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": "5278",
|
||||
"checksum": "5bd8",
|
||||
},
|
||||
{
|
||||
"lsId": "231.0.0.2",
|
||||
"advertisedRouter": "192.168.0.1",
|
||||
"advertisedRouter": "1.0.0.0",
|
||||
"sequenceNumber": "80000001",
|
||||
"checksum": "6d30",
|
||||
"checksum": "7690",
|
||||
},
|
||||
],
|
||||
"areaLocalOpaqueLsaCount": 2,
|
||||
@ -511,15 +525,15 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"asExternalOpaqueLsa": [
|
||||
{
|
||||
"lsId": "232.0.0.1",
|
||||
"advertisedRouter": "192.168.0.1",
|
||||
"advertisedRouter": "1.0.0.0",
|
||||
"sequenceNumber": "80000001",
|
||||
"checksum": "5575",
|
||||
"checksum": "5ed5",
|
||||
},
|
||||
{
|
||||
"lsId": "232.0.0.2",
|
||||
"advertisedRouter": "192.168.0.1",
|
||||
"advertisedRouter": "1.0.0.0",
|
||||
"sequenceNumber": "80000001",
|
||||
"checksum": "d05d",
|
||||
"checksum": "d9bd",
|
||||
},
|
||||
],
|
||||
"asExternalOpaqueLsaCount": 2,
|
||||
@ -543,17 +557,17 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"1.2.3.4": [
|
||||
{
|
||||
"linkStateId": "230.0.0.1",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "6d5f",
|
||||
"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,
|
||||
@ -568,17 +582,17 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"1.2.3.4": [
|
||||
{
|
||||
"linkStateId": "231.0.0.1",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "5278",
|
||||
"checksum": "5bd8",
|
||||
"length": 20,
|
||||
"opaqueDataLength": 0,
|
||||
},
|
||||
{
|
||||
"linkStateId": "231.0.0.2",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "6d30",
|
||||
"checksum": "7690",
|
||||
"length": 28,
|
||||
"opaqueDataLength": 8,
|
||||
},
|
||||
@ -590,17 +604,17 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"asExternalOpaqueLsa": [
|
||||
{
|
||||
"linkStateId": "232.0.0.1",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "5575",
|
||||
"checksum": "5ed5",
|
||||
"length": 20,
|
||||
"opaqueDataLength": 0,
|
||||
},
|
||||
{
|
||||
"linkStateId": "232.0.0.2",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "d05d",
|
||||
"checksum": "d9bd",
|
||||
"length": 24,
|
||||
"opaqueDataLength": 4,
|
||||
},
|
||||
@ -642,32 +656,32 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"linkLocalOpaqueLsa": [
|
||||
{
|
||||
"lsId": "230.0.0.1",
|
||||
"advertisedRouter": "192.168.0.1",
|
||||
"advertisedRouter": "1.0.0.0",
|
||||
"sequenceNumber": "80000001",
|
||||
"checksum": "6d5f",
|
||||
"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": [
|
||||
{
|
||||
"lsId": "231.0.0.1",
|
||||
"advertisedRouter": "192.168.0.1",
|
||||
"advertisedRouter": "1.0.0.0",
|
||||
"sequenceNumber": "80000001",
|
||||
"checksum": "5278",
|
||||
"checksum": "5bd8",
|
||||
},
|
||||
{
|
||||
"lsId": "231.0.0.2",
|
||||
"advertisedRouter": "192.168.0.1",
|
||||
"advertisedRouter": "1.0.0.0",
|
||||
"lsaAge": 3600,
|
||||
"sequenceNumber": "80000002",
|
||||
"checksum": "4682",
|
||||
"checksum": "4fe2",
|
||||
},
|
||||
],
|
||||
"areaLocalOpaqueLsaCount": 2,
|
||||
@ -676,16 +690,16 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"asExternalOpaqueLsa": [
|
||||
{
|
||||
"lsId": "232.0.0.1",
|
||||
"advertisedRouter": "192.168.0.1",
|
||||
"advertisedRouter": "1.0.0.0",
|
||||
"lsaAge": 3600,
|
||||
"sequenceNumber": "80000001",
|
||||
"checksum": "5575",
|
||||
"checksum": "5ed5",
|
||||
},
|
||||
{
|
||||
"lsId": "232.0.0.2",
|
||||
"advertisedRouter": "192.168.0.1",
|
||||
"advertisedRouter": "1.0.0.0",
|
||||
"sequenceNumber": "80000001",
|
||||
"checksum": "d05d",
|
||||
"checksum": "d9bd",
|
||||
},
|
||||
],
|
||||
"asExternalOpaqueLsaCount": 2,
|
||||
@ -703,18 +717,18 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"1.2.3.4": [
|
||||
{
|
||||
"linkStateId": "230.0.0.1",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "6d5f",
|
||||
"checksum": "76bf",
|
||||
"length": 20,
|
||||
"opaqueDataLength": 0,
|
||||
},
|
||||
{
|
||||
"linkStateId": "230.0.0.2",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaAge": 3600,
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "8142",
|
||||
"checksum": "8aa2",
|
||||
"length": 24,
|
||||
"opaqueId": 2,
|
||||
"opaqueDataLength": 4,
|
||||
@ -729,18 +743,18 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"1.2.3.4": [
|
||||
{
|
||||
"linkStateId": "231.0.0.1",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "5278",
|
||||
"checksum": "5bd8",
|
||||
"length": 20,
|
||||
"opaqueDataLength": 0,
|
||||
},
|
||||
{
|
||||
"lsaAge": 3600,
|
||||
"linkStateId": "231.0.0.2",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000002",
|
||||
"checksum": "4682",
|
||||
"checksum": "4fe2",
|
||||
# data removed
|
||||
"length": 20,
|
||||
"opaqueDataLength": 0,
|
||||
@ -753,18 +767,18 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"asExternalOpaqueLsa": [
|
||||
{
|
||||
"linkStateId": "232.0.0.1",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaAge": 3600,
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "5575",
|
||||
"checksum": "5ed5",
|
||||
"length": 20,
|
||||
"opaqueDataLength": 0,
|
||||
},
|
||||
{
|
||||
"linkStateId": "232.0.0.2",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "d05d",
|
||||
"checksum": "d9bd",
|
||||
"length": 24,
|
||||
"opaqueDataLength": 4,
|
||||
},
|
||||
@ -795,19 +809,19 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"1.2.3.4": [
|
||||
{
|
||||
"linkStateId": "230.0.0.1",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaAge": 3600,
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "6d5f",
|
||||
"checksum": "76bf",
|
||||
"length": 20,
|
||||
"opaqueDataLength": 0,
|
||||
},
|
||||
{
|
||||
"linkStateId": "230.0.0.2",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaAge": 3600,
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "8142",
|
||||
"checksum": "8aa2",
|
||||
"length": 24,
|
||||
"opaqueId": 2,
|
||||
"opaqueDataLength": 4,
|
||||
@ -823,18 +837,18 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
{
|
||||
"lsaAge": 3600,
|
||||
"linkStateId": "231.0.0.1",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "5278",
|
||||
"checksum": "5bd8",
|
||||
"length": 20,
|
||||
"opaqueDataLength": 0,
|
||||
},
|
||||
{
|
||||
"lsaAge": 3600,
|
||||
"linkStateId": "231.0.0.2",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaSeqNumber": "80000002",
|
||||
"checksum": "4682",
|
||||
"checksum": "4fe2",
|
||||
# data removed
|
||||
"length": 20,
|
||||
"opaqueDataLength": 0,
|
||||
@ -847,19 +861,19 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
"asExternalOpaqueLsa": [
|
||||
{
|
||||
"linkStateId": "232.0.0.1",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaAge": 3600,
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "5575",
|
||||
"checksum": "5ed5",
|
||||
"length": 20,
|
||||
"opaqueDataLength": 0,
|
||||
},
|
||||
{
|
||||
"linkStateId": "232.0.0.2",
|
||||
"advertisingRouter": "192.168.0.1",
|
||||
"advertisingRouter": "1.0.0.0",
|
||||
"lsaAge": 3600,
|
||||
"lsaSeqNumber": "80000001",
|
||||
"checksum": "d05d",
|
||||
"checksum": "d9bd",
|
||||
"length": 24,
|
||||
"opaqueDataLength": 4,
|
||||
},
|
||||
@ -918,7 +932,7 @@ def _test_opaque_add_del(tgen, apibin):
|
||||
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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user