Skip to content

Commit

Permalink
Simple test for logical router with VRF
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianczech committed Jan 8, 2024
1 parent c2b6e11 commit f759704
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/live/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,50 @@ def update_state_obj(self, fw, state):
state.obj.enable = False


class TestLogicalRouter(testlib.FwFlow):
def create_dependencies(self, fw, state):
state.eth_obj = None
state.eth = testlib.get_available_interfaces(fw)[0]

state.eth_obj = network.EthernetInterface(
state.eth, "layer3", testlib.random_ip("/24")
)
fw.add(state.eth_obj)
state.eth_obj.create()

def setup_state_obj(self, fw, state):
vrf = network.Vrf(
"default",
interface=state.eth,
ad_static=random.randint(10, 240),
ad_static_ipv6=random.randint(10, 240),
ad_ospf_inter=random.randint(10, 240),
ad_ospf_intra=random.randint(10, 240),
ad_ospf_ext=random.randint(10, 240),
ad_ospfv3_inter=random.randint(10, 240),
ad_ospfv3_intra=random.randint(10, 240),
ad_ospfv3_ext=random.randint(10, 240),
ad_bgp_internal=random.randint(10, 240),
ad_bgp_external=random.randint(10, 240),
ad_bgp_local=random.randint(10, 240),
ad_rip=random.randint(10, 240),
)
lr = network.LogicalRouter(testlib.random_name())
lr.add(vrf)
state.obj = lr
fw.add(state.obj)

def update_state_obj(self, fw, state):
state.obj.ad_static = random.randint(10, 240)
state.obj.ad_rip = random.randint(10, 240)

def cleanup_dependencies(self, fw, state):
try:
state.eth_obj.delete()
except Exception:
pass


class TestManagementProfile(testlib.FwFlow):
def setup_state_obj(self, fw, state):
state.obj = network.ManagementProfile(
Expand Down

0 comments on commit f759704

Please sign in to comment.