pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-sigtran/+/38374?usp=email )
Change subject: tests/vty: Show bug inserting routes with different priority
......................................................................
tests/vty: Show bug inserting routes with different priority
route lookup ((hmrt_message_for_routing() => osmo_ss7_route_lookup() =>
osmo_ss7_route_find_dpc_mask())) iterates the list of routes assuming they are
ordered by mask length (so it doesn't need to iterate the full list every
time). Similary, it implicitly seems to assume that the entries are also
sorted by priority.
However, priority is not currently taken into account when being
inserted in the routing table, so the route ends up in the incorrect
place.
This commit adds a VTY test showing the wrong insert.
Related: SYS#7112
Change-Id: I125046fcbc7563c3275f42ff9de2aa351ae616c1
---
M tests/vty/Makefile.am
A tests/vty/osmo_stp_route_prio.vty
2 files changed, 71 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/74/38374/1
diff --git a/tests/vty/Makefile.am b/tests/vty/Makefile.am
index 4157bcb..4b09f6d 100644
--- a/tests/vty/Makefile.am
+++ b/tests/vty/Makefile.am
@@ -7,6 +7,7 @@
EXTRA_DIST = \
osmo_stp_test.vty \
+ osmo_stp_route_prio.vty \
ss7_asp_test.vty \
vty_test_runner.py \
$(NULL)
diff --git a/tests/vty/osmo_stp_route_prio.vty b/tests/vty/osmo_stp_route_prio.vty
new file mode 100644
index 0000000..661b3ad
--- /dev/null
+++ b/tests/vty/osmo_stp_route_prio.vty
@@ -0,0 +1,70 @@
+OsmoSTP> enable
+OsmoSTP# configure terminal
+OsmoSTP(config)# cs7 instance 0
+
+OsmoSTP(config-cs7)# ! CREATE 2 AS with 1 ASP EACH:
+OsmoSTP(config-cs7)# asp asp1 2905 54321 m3ua
+OsmoSTP(config-cs7-asp)# remote-ip 127.0.0.100
+OsmoSTP(config-cs7-asp)# local-ip 27.0.0.1
+OsmoSTP(config-cs7-asp)# exit
+OsmoSTP(config-cs7)# asp asp2 2905 54321 m3ua
+OsmoSTP(config-cs7-asp)# remote-ip 127.0.0.200
+OsmoSTP(config-cs7-asp)# local-ip 27.0.0.2
+OsmoSTP(config-cs7-asp)# exit
+OsmoSTP(config-cs7)# as as1 m3ua
+OsmoSTP(config-cs7-as)# asp asp1
+OsmoSTP(config-cs7-as)# routing-key 56 0.1.2
+OsmoSTP(config-cs7-as)# exit
+OsmoSTP(config-cs7)# as as2 m3ua
+OsmoSTP(config-cs7-as)# asp asp2
+OsmoSTP(config-cs7-as)# routing-key 57 0.2.4
+OsmoSTP(config-cs7-as)# exit
+OsmoSTP(config-cs7)# show running-config
+...
+cs7 instance 0
+ xua rkm routing-key-allocation dynamic-permitted
+ asp asp1 2905 54321 m3ua
+ local-ip 27.0.0.1
+ remote-ip 127.0.0.100
+ role sg
+ sctp-role server
+ asp asp2 2905 54321 m3ua
+ local-ip 27.0.0.2
+ remote-ip 127.0.0.200
+ role sg
+ sctp-role server
+ as as1 m3ua
+ asp asp1
+ routing-key 56 0.1.2
+ as as2 m3ua
+ asp asp2
+ routing-key 57 0.2.4
+ route-table system
+ listen m3ua 2905
+ local-ip 127.0.0.2
+ local-ip 127.0.0.1
+ local-ip ::1
+ accept-asp-connections dynamic-permitted
+end
+
+OsmoSTP(config-cs7)# ! ADD 2 ROUTES WITH DECREASING PRIORITIES. THEY SHOULD END UP
REORDERED BY PRIORITY:
+OsmoSTP(config-cs7)# route-table system
+OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset as1 priority 5
+OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset as2 priority 2
+OsmoSTP(config-cs7-rt)# ! FIXME! THIS IS WRONG ORDER:
+OsmoSTP(config-cs7-rt)# show running-config
+...
+cs7 instance 0
+...
+ route-table system
+ update route 3.2.1 7.255.7 linkset as1 priority 5
+ update route 3.2.1 7.255.7 linkset as2 priority 2
+...
+OsmoSTP(config-cs7-rt)# do show cs7 instance 0 route
+Routing table = system
+C=Cong Q=QoS P=Prio
+
+Destination C Q P Linkset Name Linkset Non-adj Route
+---------------------- - - - ------------------- ------- ------- -------
+3.2.1/14 5 as1 ? ? ?
+3.2.1/14 2 as2 ? ? ?
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/38374?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I125046fcbc7563c3275f42ff9de2aa351ae616c1
Gerrit-Change-Number: 38374
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>