Commit Graph

52 Commits

Author SHA1 Message Date
Pim van Pelt 78bd0c4f5a Assert BondEthernet devices also exist as interfaces. Assert MTU of members is equal to that of the BondEthernet interface 2022-03-27 12:29:57 +00:00
Pim van Pelt 7bb9fa5ac8 Assert that a QinX cannot have higher MTU than its intermediate interface 2022-03-26 17:18:10 +00:00
Pim van Pelt 660cccd14e Assert that bd0 is reserved 2022-03-26 11:25:13 +00:00
Pim van Pelt de9ed1730d Add get_by_lcp_name() plus tests. Correct behavior of sub-ints without explicit encap: they are exact-match 2022-03-24 20:14:06 +00:00
Pim van Pelt b43d7903fd Add a few additional useful functions
- is_*() returns True if the interface name is of a certain type
  is_bondethernet() is_loopback() is_bvi() is_bridgedomain()
  is_vxlan_tunnel() is_phy()
- get_phys() by process of elimination, returns all interface names
  that are supposed to be physical network interfaces.

Add unit tests for validator/vxlan_tunnel.py
 => Notable: while here, fix a bug in get_by_name()
Add unit tests for all the is_*() and get_phys() functions.
2022-03-24 10:55:33 +00:00
Pim van Pelt 27ce2351c7 Cosmetic: use '.. LCP' consistently 2022-03-22 18:49:31 +00:00
Pim van Pelt 5ecd1ef22c Add unit tests for loopbacks; While here, fix a bug in get_by_name(), yaay 2022-03-22 18:03:38 +00:00
Pim van Pelt 1e7227a52a Allow for bridgedomains without any member interfaces 2022-03-22 15:38:43 +00:00
Pim van Pelt 7bf940be0a Become a bit stricter: do full-line pattern match, and update unit tests to capture the full error output 2022-03-22 15:10:40 +00:00
Pim van Pelt 7303adb74a Assert is_l2() on sub-ints cannot have address or LCP 2022-03-22 15:02:38 +00:00
Pim van Pelt 077d49cb88 Assert that is_l2() interfaces cannot have LCP or address; Fix consistency on 'be' vs 'have' an LCP. 2022-03-22 14:54:09 +00:00
Pim van Pelt 907412f49c Fix bug in get_l2xc_interfaces(), and add tests for it 2022-03-22 13:15:21 +00:00
Pim van Pelt 7ae82c297c Add get_lcps() to enumerate all LCP names in the system 2022-03-22 13:04:56 +00:00
Pim van Pelt c18f04fa55 Refactor: stop trying to derive implicit LCP names. Make it mandatory and explicitly configured 2022-03-21 11:06:15 +00:00
Pim van Pelt 551b06bb67 Move the output around - first print the unexpected messages, only then fail the assertions 2022-03-21 10:23:49 +00:00
Pim van Pelt 5247e3a241 Add the beginning of a test_qinx() suite, will complete after a refactor in an upcoming commit 2022-03-20 23:32:59 +00:00
Pim van Pelt c55fe93e16 Add unit tests for bridgedomain - move is_bridge_interface*() functions to validator/bridgedomain.py 2022-03-20 22:45:07 +00:00
Pim van Pelt 1f07f7eadf Add unit tests for bondethernet 2022-03-20 22:17:41 +00:00
Pim van Pelt 31c3d13c12 Isolate LCP into its own tests 2022-03-20 22:04:49 +00:00
Pim van Pelt 8445140842 Add unittests for validator/interface.py 2022-03-20 21:49:08 +00:00
Pim van Pelt e46cf3d3a8 Make the test.errors.count value explicit, update tests which had an implicit count 2022-03-20 19:44:29 +00:00
Pim van Pelt 2036795ef1 Move unittest YAML files into their own directory, pending more python unit tests in a followup commit 2022-03-20 16:59:13 +00:00
Pim van Pelt 7a1dc2f326 Test the boundary of valid LCP namelen 2022-03-17 00:37:46 +00:00
Pim van Pelt f921b1721a Expand autocreated LCP namelen to all possible (dot1q, qin*) scenarios. Allow manually set LCP to be 15char in length 2022-03-17 00:15:18 +00:00
Pim van Pelt 8a1da516f3 Fix tests for upcoming LCP assertion that intermediate interfaces 'xe0.1000' must exist as an LCP in order for Qin* sub-interfaces 'xe0.1000.1234' to be allowed 2022-03-16 22:43:13 +00:00
Pim van Pelt 252fa989b2 Assert VXLAN local/remote is the same address family. Assert VXLAN VNI is unique. 2022-03-15 22:57:09 +00:00
Pim van Pelt 1e5b1e49ad Assert that an interface cannot l2 cross connect to itself 2022-03-15 22:36:48 +00:00
Pim van Pelt e7e3958ceb Assert source/target L2XC are the same MTU 2022-03-15 22:32:55 +00:00
Pim van Pelt 686cd45158 Add first approximation of vxlan_tunnels 2022-03-15 22:21:36 +00:00
Pim van Pelt 2947bbfd25 Get rid of ' characters in errors 2022-03-15 21:13:42 +00:00
Pim van Pelt 2bbcff2ca0 Also assert that targets of an L2XC do not have an address or LCP 2022-03-15 21:07:47 +00:00
Pim van Pelt 5876465327 A few cosmetic changes in logging 2022-03-15 20:57:11 +00:00
Pim van Pelt 6d3de72c00 A completely empty config is a valid config 2022-03-15 20:52:09 +00:00
Pim van Pelt c5872880fe Add l2xc support, including extensive tests to validate correct usage of the feature 2022-03-15 20:45:27 +00:00
Pim van Pelt b9a7bb697e Add validator to ensure that bridgedomain interfaces occur in at most one bridgedomain. Ironically, this caught a bug in the bridgedomain5 test, where Gi1/0/0 was added twice. 2022-03-15 19:48:32 +00:00
Pim van Pelt 13f211f27a Make clearer that 'is not allowed' actually means that the address conflicts with another 2022-03-14 00:18:46 +00:00
Pim van Pelt bb57ed8e52 IP Address validator
Returns True if there is at most one occurence of the ip_interface (an IPv4/IPv6 prefix+len)
in the entire config. That said, we need the 'iface_addresses' because VPP is a bit fickle in
this regard.

IP addresses from the same prefix/len can be added to a given interface (ie 192.0.2.1/24 and
192.0.2.2/24), but other than that, any prefix can not occur as a more-specific or less-specific
of any other interface.

So, we will allow:
- any ip_interface that is of equal network/len of existing one(s) _on the same interface_

And, we will reject
- any ip_interface that is a more specific of any existing one
- any ip_interface that is a less specific of any existing one

Update unit tests to ensure ip_interfaces are allowed in all cases.
2022-03-13 23:50:10 +00:00
Pim van Pelt 3f2b80172c Add another schema validation test 2022-03-13 21:18:08 +00:00
Pim van Pelt 660e240eb7 Add some more garbage fields and tpyoes 2022-03-13 20:38:12 +00:00
Pim van Pelt 2ca7cc3f11 Check for fields that are of the wrong type. Fix bug in ip_interface() validator thanks to this unittest 2022-03-13 20:20:14 +00:00
Pim van Pelt 0f03d6cbaa Add unit test that ensures exact-match=False can't be on a sub-int with an LCP or address 2022-03-13 20:10:06 +00:00
Pim van Pelt 763c1ca74c Ensure that LCP names are globally unique (between interface/sub-interface/loopback/bridgedomain) 2022-03-13 19:53:13 +00:00
Pim van Pelt 0d8a28cadd Enforce that when a bridgedomain has an address (ie a BVI), that it must also have an LCP 2022-03-13 19:32:30 +00:00
Pim van Pelt 8825984d49 Force loopbacks with an address to have an LCP 2022-03-13 19:27:27 +00:00
Pim van Pelt d693c41c72 Add four simple loopback examples (with and without LCP or address) 2022-03-13 19:19:39 +00:00
Pim van Pelt 1adb91d227 Add LCP/Address example bridgedomains 2022-03-13 19:19:18 +00:00
Pim van Pelt 1340e5db42 Remove the attempted plural 'address(es)', and keep it singular. Fix a typo (addd-ress); update unit tests 2022-03-13 19:08:45 +00:00
Pim van Pelt 878f94b2bd Add unit tests for bondethernet, including a set of correctly form ones 2022-03-13 19:04:31 +00:00
Pim van Pelt 527b1ca95b Add a set of bridgedomain unit tests, including a fully formed correct one. Fix one bug found along the way! 2022-03-13 18:55:00 +00:00
Pim van Pelt 5207b920d7 Rename unittest 2022-03-13 18:35:28 +00:00