diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 204ab07b..01875987 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -804,8 +804,9 @@ Operational state data consists of: * `routing-state` is obsolete ## Testing -The `tests/manual_tests.md` file contains a list of sysrepo commands that can be used to test -the currently implemented features of the plugin. +The `tests/interfaces/manual_tests.md` and `tests/routing/manual_tests.md` files +contain a list of sysrepo commands that can be used to test +the currently implemented features of the plugins. ## Nodes that are currently implemented diff --git a/tests/manual_tests.md b/tests/interfaces/manual_tests.md similarity index 100% rename from tests/manual_tests.md rename to tests/interfaces/manual_tests.md diff --git a/tests/routing/manual_tests.md b/tests/routing/manual_tests.md new file mode 100644 index 00000000..29dcb1ce --- /dev/null +++ b/tests/routing/manual_tests.md @@ -0,0 +1,509 @@ +# Intro +This document contains a list of sysrepocfg commands that can be used to test currently +implemented plugin functionality. +It can also serve as a reference containing a list of currently implemented leafs in the model. + +It is assumed that the datastore has already been initialized. As all of the data is currently +automatically populated by the plugin, no import of example data is needed. + +## ietf-routing +First we can confirm that the datastore contains any data at all. + +``` +$ sysrepocfg -X -m ietf-routing + + + + rt:direct + unspec + unspecified protocol + + + rt:direct + redirect + redirect protocol + + + rt:direct + kernel + kernel protocol + + + rt:direct + boot + boot protocol + + + rt:static + static + static protocol + + + rt:direct + gated + gated protocol + + + rt:direct + ra + ra protocol + + + rt:direct + mrt + mrt protocol + + + rt:direct + zebra + zebra protocol + + + rt:direct + bird + bird protocol + + + rt:direct + dnrouted + dnrouted protocol + + + rt:direct + xorp + xorp protocol + + + rt:direct + ntk + ntk protocol + + + rt:direct + dhcp + dhcp protocol + + + rt:direct + 0x11 + mrouted protocol + + + rt:direct + babel + babel protocol + + + rt:direct + bgp + bgp protocol + + + rt:direct + isis + isis protocol + + + rt:direct + ospf + ospf protocol + + + rt:direct + rip + rip protocol + + + rt:direct + eigrp + eigrp protocol + + + + + ipv4-main + rt:ipv4 + main routing table - normal routing table containing all non-policy routes (ipv4 only) + + + ipv4-local + rt:ipv4 + local routing table - maintained by the kernel, containing high priority control routes for local and broadcast addresses (ipv4 only) + + + ipv6-main + rt:ipv6 + main routing table - normal routing table containing all non-policy routes (ipv6 only) + + + ipv6-local + rt:ipv6 + local routing table - maintained by the kernel, containing high priority control routes for local and broadcast addresses (ipv6 only) + + + +``` + +### control-plane-protocols +``` +sysrepocfg -X -x '/ietf-routing:routing/control-plane-protocols' + + + + rt:direct + unspec + unspecified protocol + + + rt:direct + redirect + redirect protocol + + + rt:direct + kernel + kernel protocol + + + rt:direct + boot + boot protocol + + + rt:static + static + static protocol + + + rt:direct + gated + gated protocol + + + rt:direct + ra + ra protocol + + + rt:direct + mrt + mrt protocol + + + rt:direct + zebra + zebra protocol + + + rt:direct + bird + bird protocol + + + rt:direct + dnrouted + dnrouted protocol + + + rt:direct + xorp + xorp protocol + + + rt:direct + ntk + ntk protocol + + + rt:direct + dhcp + dhcp protocol + + + rt:direct + 0x11 + mrouted protocol + + + rt:direct + babel + babel protocol + + + rt:direct + bgp + bgp protocol + + + rt:direct + isis + isis protocol + + + rt:direct + ospf + ospf protocol + + + rt:direct + rip + rip protocol + + + rt:direct + eigrp + eigrp protocol + + + +``` + +This will list all the routing protocols that are known to Linux. This is retrieved from `linux/rtnetlink.h` + +### ribs +``` +sysrepocfg -X -x '/ietf-routing:routing/ribs' + + + + ipv4-main + rt:ipv4 + main routing table - normal routing table containing all non-policy routes (ipv4 only) + + + ipv4-local + rt:ipv4 + local routing table - maintained by the kernel, containing high priority control routes for local and broadcast addresses (ipv4 only) + + + ipv6-main + rt:ipv6 + main routing table - normal routing table containing all non-policy routes (ipv6 only) + + + ipv6-local + rt:ipv6 + local routing table - maintained by the kernel, containing high priority control routes for local and broadcast addresses (ipv6 only) + + + +``` + +The `ribs` container is populated from available Linux routing tables usually visible in `/etc/iproute2/rt_tables`. +In this example, the IPv4 and IPv6 master and local Linux tables are available. + +To see actual routes inside the RIBs, we have to query the operational datastore: +``` +sysrepocfg -X -d operational -x '/ietf-routing:routing/ribs' + + + + ipv4-main + + + 100 + + enp1s0 + 10.0.2.2 + + rt:direct + + 0.0.0.0/0 + + + 100 + + enp1s0 + + rt:direct + + 10.0.2.0/24 + + + 1000 + + enp1s0 + + rt:direct + + 169.254.0.0/16 + + + + + ipv4-local + + + 0 + + enp1s0 + + rt:direct + + 10.0.2.0/32 + + + 0 + + enp1s0 + + rt:direct + + 10.0.2.15/32 + + + 0 + + enp1s0 + + rt:direct + + 10.0.2.255/32 + + + 0 + + lo + + rt:direct + + 127.0.0.0/32 + + + 0 + + lo + + rt:direct + + 127.0.0.0/8 + + + 0 + + lo + + rt:direct + + 127.0.0.1/32 + + + 0 + + lo + + rt:direct + + 127.255.255.255/32 + + + + + ipv6-main + + + 256 + + lo + + rt:direct + + ::1/128 + + + 100 + + enp1s0 + + rt:direct + + fe80::/64 + + + 100 + + enp1s0 + + rt:direct + + fec0::/64 + + + 20100 + + enp1s0 + fe80::2 + + rt:direct + + ::/0 + + + + + ipv6-local + + + 0 + + lo + + rt:direct + + ::1/128 + + + 0 + + enp1s0 + + rt:direct + + fe80::7987:cb97:60d:e11e/128 + + + 0 + + enp1s0 + + rt:direct + + fec0::51a3:301:b5b7:23bb/128 + + + 0 + + enp1s0 + + rt:direct + + fec0::8357:aadf:d46:f571/128 + + + 256 + + enp1s0 + + rt:direct + + ff00::/8 + + + + + +``` + +### interfaces + +The `interfaces` container lists network-layer interfaces used for routing. + +``` +sysrepocfg -X -d operational -x '/ietf-routing:routing/interfaces' + + + lo + enp1s0 + + +```