feature: add device-type to the schema
This attribute of the 'interface' schema allows the user to prompt what type of PHY they are expecting this interface to be. It will serve an immediate and a future purpose. Immediate: presence of the 'dpdk' device-type in a list of interfaces will help an upcoming vppapy.mockconfig() to generate a cache without having to talk to the API. This is useful to generate a pre-compute a complete vpp.exec based off of an empty VPP dataplane Future: addition of different PHY types, notably RDMA and VirtualEthernet types TESTED: - Added a unit test to ensure that only is_phy() eligable interfaces receive the device-type attribute. - All unit and YAML tests pass.
This commit is contained in:
@ -447,6 +447,10 @@ def validate_interfaces(yaml):
|
||||
)
|
||||
result = False
|
||||
|
||||
if "device-type" in iface and not is_phy(yaml, ifname):
|
||||
msgs.append(f"interface {ifname} is not a PHY, cannot set device-type")
|
||||
result = False
|
||||
|
||||
iface_mtu = get_mtu(yaml, ifname)
|
||||
iface_lcp = get_lcp(yaml, ifname)
|
||||
iface_address = has_address(yaml, ifname)
|
||||
|
Reference in New Issue
Block a user