Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ldpd updates #7

Merged
merged 3 commits into from
Jul 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ldp-topo1/r1/ldpd.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
hostname r1
log file /tmp/r1-ldpd.log
!
debug mpls ldp zebra
debug mpls ldp event
debug mpls ldp errors
debug mpls ldp messages recv
debug mpls ldp messages sent
debug mpls ldp discovery hello recv
debug mpls ldp discovery hello sent
!
mpls ldp
router-id 1.1.1.1
!
Expand Down
6 changes: 3 additions & 3 deletions ldp-topo1/r1/show_ipv4_route.ref
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
O 1.1.1.1/32 [110/0] is directly connected, lo
O>* 2.2.2.2/32 [110/10] via 10.0.1.2, r1-eth0
O>* 2.2.2.2/32 [110/10] via 10.0.1.2, r1-eth0, label y
O>* 3.3.3.3/32 [110/20] via 10.0.1.2, r1-eth0, label xxx
O>* 4.4.4.4/32 [110/20] via 10.0.1.2, r1-eth0, label xxx
O 10.0.1.0/24 [110/10] is directly connected, r1-eth0
O>* 10.0.2.0/24 [110/20] via 10.0.1.2, r1-eth0
O>* 10.0.3.0/24 [110/20] via 10.0.1.2, r1-eth0
O>* 10.0.2.0/24 [110/20] via 10.0.1.2, r1-eth0, label y
O>* 10.0.3.0/24 [110/20] via 10.0.1.2, r1-eth0, label y
8 changes: 8 additions & 0 deletions ldp-topo1/r2/ldpd.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
hostname r2
log file /tmp/r2-ldpd.log
!
debug mpls ldp zebra
debug mpls ldp event
debug mpls ldp errors
debug mpls ldp messages recv
debug mpls ldp messages sent
debug mpls ldp discovery hello recv
debug mpls ldp discovery hello sent
!
mpls ldp
router-id 2.2.2.2
!
Expand Down
6 changes: 3 additions & 3 deletions ldp-topo1/r2/show_ipv4_route.ref
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
O>* 1.1.1.1/32 [110/10] via 10.0.1.1, r2-eth0
O>* 1.1.1.1/32 [110/10] via 10.0.1.1, r2-eth0, label y
O 2.2.2.2/32 [110/0] is directly connected, lo
O>* 3.3.3.3/32 [110/10] via 10.0.2.3, r2-eth1
O>* 4.4.4.4/32 [110/10] via 10.0.2.4, r2-eth1
O>* 3.3.3.3/32 [110/10] via 10.0.2.3, r2-eth1, label y
O>* 4.4.4.4/32 [110/10] via 10.0.2.4, r2-eth1, label y
O 10.0.1.0/24 [110/10] is directly connected, r2-eth0
O 10.0.2.0/24 [110/10] is directly connected, r2-eth1
O 10.0.3.0/24 [110/10] is directly connected, r2-eth2
8 changes: 8 additions & 0 deletions ldp-topo1/r3/ldpd.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
hostname r3
log file /tmp/r3-ldpd.log
!
debug mpls ldp zebra
debug mpls ldp event
debug mpls ldp errors
debug mpls ldp messages recv
debug mpls ldp messages sent
debug mpls ldp discovery hello recv
debug mpls ldp discovery hello sent
!
mpls ldp
router-id 3.3.3.3
!
Expand Down
6 changes: 3 additions & 3 deletions ldp-topo1/r3/show_ipv4_route.ref
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
O>* 1.1.1.1/32 [110/20] via 10.0.2.2, r3-eth0, label xxx
O>* 2.2.2.2/32 [110/10] via 10.0.2.2, r3-eth0
O>* 2.2.2.2/32 [110/10] via 10.0.2.2, r3-eth0, label y
O 3.3.3.3/32 [110/0] is directly connected, lo
O>* 4.4.4.4/32 [110/10] via 10.0.2.4, r3-eth0
O>* 10.0.1.0/24 [110/20] via 10.0.2.2, r3-eth0
O>* 4.4.4.4/32 [110/10] via 10.0.2.4, r3-eth0, label y
O>* 10.0.1.0/24 [110/20] via 10.0.2.2, r3-eth0, label y
O 10.0.2.0/24 [110/10] is directly connected, r3-eth0
O 10.0.3.0/24 [110/10] is directly connected, r3-eth1
8 changes: 8 additions & 0 deletions ldp-topo1/r4/ldpd.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
hostname r4
log file /tmp/r4-ldpd.log
!
debug mpls ldp zebra
debug mpls ldp event
debug mpls ldp errors
debug mpls ldp messages recv
debug mpls ldp messages sent
debug mpls ldp discovery hello recv
debug mpls ldp discovery hello sent
!
mpls ldp
router-id 4.4.4.4
!
Expand Down
8 changes: 4 additions & 4 deletions ldp-topo1/r4/show_ipv4_route.ref
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
O>* 1.1.1.1/32 [110/20] via 10.0.2.2, r4-eth0, label xxx
O>* 2.2.2.2/32 [110/10] via 10.0.2.2, r4-eth0
O>* 3.3.3.3/32 [110/10] via 10.0.2.3, r4-eth0
O>* 2.2.2.2/32 [110/10] via 10.0.2.2, r4-eth0, label y
O>* 3.3.3.3/32 [110/10] via 10.0.2.3, r4-eth0, label y
O 4.4.4.4/32 [110/0] is directly connected, lo
O>* 10.0.1.0/24 [110/20] via 10.0.2.2, r4-eth0
O>* 10.0.1.0/24 [110/20] via 10.0.2.2, r4-eth0, label y
O 10.0.2.0/24 [110/10] is directly connected, r4-eth0
O>* 10.0.3.0/24 [110/20] via 10.0.2.2, r4-eth0
O>* 10.0.3.0/24 [110/20] via 10.0.2.2, r4-eth0, label y
19 changes: 14 additions & 5 deletions ldp-topo1/test_ldp_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,17 +544,26 @@ def test_zebra_ipv4_routingTable():
if os.path.isfile(refTableFile):
# Read expected result from file
expected = open(refTableFile).read().rstrip()
# Fix newlines (make them all the same)
expected = ('\n'.join(expected.splitlines()) + '\n').splitlines(1)

# Actual output from router
actual = net['r%s' % i].cmd('vtysh -c "show ip route" 2> /dev/null | grep "^O"').rstrip()
# Drop timers on end of line (older Quagga Versions)
actual = re.sub(r", [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", "", actual)
# Mask out label
actual = re.sub(r" label [0-9]+", " label xxx", actual)

# Mask out label - all LDP labels should be >= 10 (2-digit)
# leaving the implicit labels unmasked
actual = re.sub(r" label [0-9][0-9]+", " label xxx", actual)
# and translating remaining implicit (single-digit) labels to label y
actual = re.sub(r" label [0-9]+", " label y", actual)
# Check if we have implicit labels - if not, then remove them from reference
if (not re.search(r" label y", actual)):
expected = re.sub(r", label y", "", expected)

# now fix newlines of expected (make them all the same)
expected = ('\n'.join(expected.splitlines()) + '\n').splitlines(1)

# Add missing comma before label (for old version)
actual = re.sub(r"([0-9]) label xxx", r"\1, label xxx", actual)
actual = re.sub(r"([0-9]) label ", r"\1, label ", actual)

# Fix newlines (make them all the same)
actual = ('\n'.join(actual.splitlines()) + '\n').splitlines(1)
Expand Down