Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_x3_config_from_ldp_job(self):
acl1 = AccessList(name='acl1')
acl2 = AccessList(name='acl2')
acl3 = AccessList(name='acl3')
acl4 = AccessList(name='acl4')
acl5 = AccessList(name='acl5')
acl6 = AccessList(name='acl6')
acl7 = AccessList(name='acl7')
acl8 = AccessList(name='acl8')
acl9 = AccessList(name='acl9')
acl11 = AccessList(name='acl11')
acl22 = AccessList(name='acl22')
acl33 = AccessList(name='acl33')
acl44 = AccessList(name='acl44')
acl1111 = AccessList(name='acl1111')
acl2222 = AccessList(name='acl2222')
acl3333 = AccessList(name='acl3333')
acl4444 = AccessList(name='acl4444')
ldp = Ldp()
self.link.add_feature(ldp)
self.link2.add_feature(ldp)
self.link3.add_feature(ldp)
self.link4.add_feature(ldp)
ldp.device_attr['PE1'].router_id = '1.1.1.1'
def test_1_top_level(self):
acl1 = AccessList(name='acl1')
acl2 = AccessList(name='acl2')
acl3 = AccessList(name='acl3')
acl4 = AccessList(name='acl4')
acl5 = AccessList(name='acl5')
acl6 = AccessList(name='acl6')
acl7 = AccessList(name='acl7')
acl8 = AccessList(name='acl8')
acl9 = AccessList(name='acl9')
acl11 = AccessList(name='acl11')
acl22 = AccessList(name='acl22')
acl33 = AccessList(name='acl33')
acl44 = AccessList(name='acl44')
acl1111 = AccessList(name='acl1111')
acl2222 = AccessList(name='acl2222')
acl3333 = AccessList(name='acl3333')
acl4444 = AccessList(name='acl4444')
ldp = Ldp()
self.link.add_feature(ldp)
# ==Test top-level config==
ldp.capabilities_cisco_iosxr = False
ldp.default_vrf_impl_ipv4 = False
acl2 = AccessList(name='acl2')
acl3 = AccessList(name='acl3')
acl4 = AccessList(name='acl4')
acl5 = AccessList(name='acl5')
acl6 = AccessList(name='acl6')
acl7 = AccessList(name='acl7')
acl8 = AccessList(name='acl8')
acl9 = AccessList(name='acl9')
acl11 = AccessList(name='acl11')
acl22 = AccessList(name='acl22')
acl33 = AccessList(name='acl33')
acl44 = AccessList(name='acl44')
acl1111 = AccessList(name='acl1111')
acl2222 = AccessList(name='acl2222')
acl3333 = AccessList(name='acl3333')
acl4444 = AccessList(name='acl4444')
nbr1 = IPv4LsrNeighbor('1.2.3.5:0')
nbr2 = IPv4LsrNeighbor('1.2.3.6:0')
nbr3 = IPv4LsrNeighbor('1.2.3.7:0')
nbr4 = IPv4LsrNeighbor('1.2.3.8:0')
ldp = Ldp()
self.link.add_feature(ldp)
vrf = Vrf(name='vrf1')
ldp.add_force_vrf(vrf)
ldp.device_attr['PE1'].vrf_attr['vrf1'].address_family_attr['ipv4'].neighbors = [nbr1, nbr2, nbr3, nbr4]
ldp.device_attr['PE1'].vrf_attr['vrf1'].address_family_attr['ipv4'].neighbor_attr['1.2.3.5:0'].advertise_for_acl = acl1
ldp.device_attr['PE1'].vrf_attr['vrf1'].address_family_attr['ipv4'].neighbor_attr['1.2.3.6:0'].advertise_for_acl = acl2
ldp.device_attr['PE1'].vrf_attr['vrf1'].address_family_attr['ipv4'].neighbor_attr['1.2.3.7:0'].accept_for_acl = acl1
ldp.device_attr['PE1'].vrf_attr['vrf1'].address_family_attr['ipv4'].neighbor_attr['1.2.3.8:0'].accept_for_acl = acl2
def test_9_per_af_per_neighbor(self):
acl1 = AccessList(name='acl1')
acl2 = AccessList(name='acl2')
acl3 = AccessList(name='acl3')
acl4 = AccessList(name='acl4')
acl5 = AccessList(name='acl5')
acl6 = AccessList(name='acl6')
acl7 = AccessList(name='acl7')
acl8 = AccessList(name='acl8')
acl9 = AccessList(name='acl9')
acl11 = AccessList(name='acl11')
acl22 = AccessList(name='acl22')
acl33 = AccessList(name='acl33')
acl44 = AccessList(name='acl44')
acl1111 = AccessList(name='acl1111')
acl2222 = AccessList(name='acl2222')
acl3333 = AccessList(name='acl3333')
acl4444 = AccessList(name='acl4444')
nbr1 = IPv4LsrNeighbor('1.2.3.4:0')
nbr2 = IPv4LsrNeighbor('1.2.3.5:0')
nbr3 = IPv4LsrNeighbor('1.2.3.6:0')
nbr4 = IPv4LsrNeighbor('1.2.3.7:0')
nbr5 = IPv4LsrNeighbor('1.2.3.8:0')
nbr6 = IPv6Neighbor('1:2::3')
nbr7 = IPv6Neighbor('1:2::4')
nbr8 = IPv6Neighbor('1:2::5')
ldp = Ldp()
def test_8_per_vrf_per_neighbor(self):
acl1 = AccessList(name='acl1')
acl2 = AccessList(name='acl2')
acl3 = AccessList(name='acl3')
acl4 = AccessList(name='acl4')
acl5 = AccessList(name='acl5')
acl6 = AccessList(name='acl6')
acl7 = AccessList(name='acl7')
acl8 = AccessList(name='acl8')
acl9 = AccessList(name='acl9')
acl11 = AccessList(name='acl11')
acl22 = AccessList(name='acl22')
acl33 = AccessList(name='acl33')
acl44 = AccessList(name='acl44')
acl1111 = AccessList(name='acl1111')
acl2222 = AccessList(name='acl2222')
acl3333 = AccessList(name='acl3333')
acl4444 = AccessList(name='acl4444')
ldp = Ldp()
self.link.add_feature(ldp)
vrf = Vrf(name='vrf1')
ldp.add_force_vrf(vrf)
nbr1 = IPv4LsrNeighbor('1.2.3.4:0')
nbr2 = IPv4LsrNeighbor('1.2.3.5:0')
nbr3 = IPv4LsrNeighbor('1.2.3.6:0')
ldp.device_attr['PE1'].vrf_attr['vrf1'].neighbors = [nbr1, nbr2, nbr3]
def test_8_per_vrf_per_neighbor(self):
acl1 = AccessList(name='acl1')
acl2 = AccessList(name='acl2')
acl3 = AccessList(name='acl3')
acl4 = AccessList(name='acl4')
acl5 = AccessList(name='acl5')
acl6 = AccessList(name='acl6')
acl7 = AccessList(name='acl7')
acl8 = AccessList(name='acl8')
acl9 = AccessList(name='acl9')
acl11 = AccessList(name='acl11')
acl22 = AccessList(name='acl22')
acl33 = AccessList(name='acl33')
acl44 = AccessList(name='acl44')
acl1111 = AccessList(name='acl1111')
acl2222 = AccessList(name='acl2222')
acl3333 = AccessList(name='acl3333')
acl4444 = AccessList(name='acl4444')
ldp = Ldp()
self.link.add_feature(ldp)
vrf = Vrf(name='vrf1')
ldp.add_force_vrf(vrf)
def test_x1_per_vrf_per_af(self):
acl1 = AccessList(name='acl1')
acl2 = AccessList(name='acl2')
acl3 = AccessList(name='acl3')
acl4 = AccessList(name='acl4')
acl5 = AccessList(name='acl5')
acl6 = AccessList(name='acl6')
acl7 = AccessList(name='acl7')
acl8 = AccessList(name='acl8')
acl9 = AccessList(name='acl9')
acl11 = AccessList(name='acl11')
acl22 = AccessList(name='acl22')
acl33 = AccessList(name='acl33')
acl44 = AccessList(name='acl44')
acl1111 = AccessList(name='acl1111')
acl2222 = AccessList(name='acl2222')
acl3333 = AccessList(name='acl3333')
acl4444 = AccessList(name='acl4444')
ldp = Ldp()
self.link.add_feature(ldp)
vrf = Vrf(name='vrf1')
ldp.add_force_vrf(vrf)
ldp.device_attr['PE1'].vrf_attr['vrf1'].address_family_attr['ipv4'].transport_address = '1.2.3.4'
ldp.device_attr['PE1'].vrf_attr['vrf1'].address_family_attr['ipv4'].advertise = False
ldp.device_attr['PE1'].vrf_attr['vrf1'].address_family_attr['ipv4'].advertise_expnull_to_acl = acl4
def test_x2_per_vrf_per_af_per_nbr(self):
acl1 = AccessList(name='acl1')
acl2 = AccessList(name='acl2')
acl3 = AccessList(name='acl3')
acl4 = AccessList(name='acl4')
acl5 = AccessList(name='acl5')
acl6 = AccessList(name='acl6')
acl7 = AccessList(name='acl7')
acl8 = AccessList(name='acl8')
acl9 = AccessList(name='acl9')
acl11 = AccessList(name='acl11')
acl22 = AccessList(name='acl22')
acl33 = AccessList(name='acl33')
acl44 = AccessList(name='acl44')
acl1111 = AccessList(name='acl1111')
acl2222 = AccessList(name='acl2222')
acl3333 = AccessList(name='acl3333')
acl4444 = AccessList(name='acl4444')
nbr1 = IPv4LsrNeighbor('1.2.3.5:0')
nbr2 = IPv4LsrNeighbor('1.2.3.6:0')
def test_3_per_intf(self):
acl1 = AccessList(name='acl1')
acl2 = AccessList(name='acl2')
acl3 = AccessList(name='acl3')
acl4 = AccessList(name='acl4')
acl5 = AccessList(name='acl5')
acl6 = AccessList(name='acl6')
acl7 = AccessList(name='acl7')
acl8 = AccessList(name='acl8')
acl9 = AccessList(name='acl9')
acl11 = AccessList(name='acl11')
acl22 = AccessList(name='acl22')
acl33 = AccessList(name='acl33')
acl44 = AccessList(name='acl44')
acl1111 = AccessList(name='acl1111')
acl2222 = AccessList(name='acl2222')
acl3333 = AccessList(name='acl3333')
acl4444 = AccessList(name='acl4444')
ldp = Ldp()
self.link.add_feature(ldp)
self.link4.add_feature(ldp)
ldp.device_attr['PE1'].interface_attr['GigabitEthernet0/0/0/1'].igp_sync_delay_on_session_up = 250
type=(None, managedattribute.test_istype(bool)))
sig_outofband_vrf = managedattribute(
name='sig_outofband_vrf',
default=None,
type=(None, managedattribute.test_isinstance(Vrf)))
sig_patherr_state_removal = managedattribute(
name='sig_patherr_state_removal',
default=None,
type=(None, managedattribute.test_istype(bool)))
sig_prefixfilt_acl = managedattribute(
name='sig_prefixfilt_acl',
default=None,
type=(None, managedattribute.test_isinstance(AccessList)))
class PrefixFilteringAction(Enum):
drop = 'drop'
sig_prefixfilt_defdenyaction = managedattribute(
name='sig_prefixfilt_defdenyaction',
default=None,
type=(None, PrefixFilteringAction))
# Per-interface attributes
sig_refresh_outofband_interval = managedattribute(
name='sig_refresh_outofband_interval',
default=None,
type=(None, managedattribute.test_istype(int)))