Commit Graph

75 Commits

Author SHA1 Message Date
31c3d13c12 Isolate LCP into its own tests 2022-03-20 22:04:49 +00:00
14cd365ad3 Move LCP tests to their own test_*py file 2022-03-20 22:01:51 +00:00
459346878a Move to assertEqual 2022-03-20 21:54:28 +00:00
8445140842 Add unittests for validator/interface.py 2022-03-20 21:49:08 +00:00
e46cf3d3a8 Make the test.errors.count value explicit, update tests which had an implicit count 2022-03-20 19:44:29 +00:00
1ff3ae95cc Fully move yamltest to unittest framework, assert errors instead of printing them 2022-03-20 19:27:23 +00:00
3291c60d9a Start refactoring YAML tests into unittest framework 2022-03-20 18:59:40 +00:00
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
dbd7bca8f3 Add get_encapsulation; refactor unique_encapsulation to use it. All tests pass. 2022-03-20 16:45:03 +00:00
7a1dc2f326 Test the boundary of valid LCP namelen 2022-03-17 00:37:46 +00:00
343c1097c7 Stop trying to police interface names -- they will be validated by get_by_name() 2022-03-17 00:20:22 +00:00
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
3663a04cde Bugfix: check sub_iface instead of iface 2022-03-16 23:57:47 +00:00
59cbc8b886 Add description len=64 to avoid runaway strings 2022-03-16 23:23:28 +00:00
6b6207f028 define 'is_l2' the same way VPP does: in a bridge or as an L2XC target. 2022-03-16 23:16:46 +00:00
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
ccfb51189a A few small refactors, using get_by_name() more, casting boolean return values, etc 2022-03-16 22:20:51 +00:00
252fa989b2 Assert VXLAN local/remote is the same address family. Assert VXLAN VNI is unique. 2022-03-15 22:57:09 +00:00
1e5b1e49ad Assert that an interface cannot l2 cross connect to itself 2022-03-15 22:36:48 +00:00
e7e3958ceb Assert source/target L2XC are the same MTU 2022-03-15 22:32:55 +00:00
686cd45158 Add first approximation of vxlan_tunnels 2022-03-15 22:21:36 +00:00
05b3c5c157 Small refactor, to allow for more interface types to be added as l2xc targets later 2022-03-15 21:56:29 +00:00
af90b37a33 bugfix: Use sub-interface name 2022-03-15 21:52:44 +00:00
2947bbfd25 Get rid of ' characters in errors 2022-03-15 21:13:42 +00:00
2bbcff2ca0 Also assert that targets of an L2XC do not have an address or LCP 2022-03-15 21:07:47 +00:00
5876465327 A few cosmetic changes in logging 2022-03-15 20:57:11 +00:00
6d3de72c00 A completely empty config is a valid config 2022-03-15 20:52:09 +00:00
c5872880fe Add l2xc support, including extensive tests to validate correct usage of the feature 2022-03-15 20:45:27 +00:00
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
9d8c201a06 Merge branch 'main' of github.com:pimvanpelt/vppcfg into main 2022-03-14 00:19:32 +00:00
f43d5a5e87 Merge branch 'main' of github.com:pimvanpelt/vppcfg into main 2022-03-14 00:19:23 +00:00
0e293217fd Merge branch 'main' of github.com:pimvanpelt/vppcfg into main 2022-03-14 00:18:51 +00:00
13f211f27a Make clearer that 'is not allowed' actually means that the address conflicts with another 2022-03-14 00:18:46 +00:00
a5a58c1261 Make clearer that 'is not allowed' actually means that the address conflicts with another 2022-03-14 00:17:33 +00:00
b6ab172986 Merge branch 'main' of github.com:pimvanpelt/vppcfg into main 2022-03-13 23:50:22 +00:00
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
19bbd0e8a3 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:45:40 +00:00
3f2b80172c Add another schema validation test 2022-03-13 21:18:08 +00:00
5c61259edd Add copyright and license 2022-03-13 21:08:32 +00:00
412ecfdbf7 Add important note :) 2022-03-13 21:06:02 +00:00
9c88e2a0cc Add a --quiet/-q flag, which only logs warnings and errors 2022-03-13 21:01:59 +00:00
974ff054d3 Add BUILD instructions. Add LICENSE 2022-03-13 20:59:20 +00:00
660e240eb7 Add some more garbage fields and tpyoes 2022-03-13 20:38:12 +00:00
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
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
ec93195832 Print unittest description in case it's available 2022-03-13 19:58:17 +00:00
763c1ca74c Ensure that LCP names are globally unique (between interface/sub-interface/loopback/bridgedomain) 2022-03-13 19:53:13 +00:00
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
8825984d49 Force loopbacks with an address to have an LCP 2022-03-13 19:27:27 +00:00
d693c41c72 Add four simple loopback examples (with and without LCP or address) 2022-03-13 19:19:39 +00:00