test(rack): cover peer_port below 1 in validate_links
This commit is contained in:
parent
e54cbb3f0f
commit
773fec952f
1 changed files with 8 additions and 0 deletions
|
|
@ -384,6 +384,14 @@ def test_validate_links_rejects_peer_port_over_count():
|
|||
gen_rack.validate_links(items, hw_index)
|
||||
|
||||
|
||||
def test_validate_links_rejects_peer_port_below_one():
|
||||
items = [item(hostname="mf01", rack_u=2, u_height=1, rack_face="front",
|
||||
links=[{"local": "eth0", "peer": "sw01", "peer_port": 0}])]
|
||||
hw_index = {"sw01": item(hostname="sw01", kind="switch", ports=24)}
|
||||
with pytest.raises(gen_rack.SchemaError):
|
||||
gen_rack.validate_links(items, hw_index)
|
||||
|
||||
|
||||
def test_validate_links_accepts_peer_without_ports():
|
||||
items = [item(hostname="mf01", rack_u=2, u_height=1, rack_face="front",
|
||||
links=[{"local": "eth0", "peer": "rtr01", "peer_port": 99}])]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue