MCPcopy Create free account
hub / github.com/FDio/vpp / BFDTestSession

Class BFDTestSession

test/test_bfd.py:595–869  ·  view source on GitHub ↗

BFD session as seen from test framework side

Source from the content-addressed store, hash-verified

593
594
595class BFDTestSession(object):
596 """BFD session as seen from test framework side"""
597
598 def __init__(
599 self,
600 test,
601 interface,
602 af,
603 detect_mult=3,
604 sha1_key=None,
605 bfd_key_id=None,
606 our_seq_number=None,
607 tunnel_header=None,
608 phy_interface=None,
609 multihop=False,
610 local_addr=None,
611 peer_addr=None,
612 ):
613 self.test = test
614 self.af = af
615 self.sha1_key = sha1_key
616 self.bfd_key_id = bfd_key_id
617 self.interface = interface
618 if phy_interface:
619 self.phy_interface = phy_interface
620 else:
621 self.phy_interface = self.interface
622 self.udp_sport = randint(49152, 65535)
623 if our_seq_number is None:
624 self.our_seq_number = randint(0, 40000000)
625 else:
626 self.our_seq_number = our_seq_number
627 self.vpp_seq_number = None
628 self.my_discriminator = 0
629 self.desired_min_tx = 300000
630 self.required_min_rx = 300000
631 self.required_min_echo_rx = None
632 self.detect_mult = detect_mult
633 self.diag = BFDDiagCode.no_diagnostic
634 self.your_discriminator = None
635 self.state = BFDState.down
636 self.auth_type = BFDAuthType.no_auth
637 self.tunnel_header = tunnel_header
638 self.tx_packets = 0
639 self.rx_packets = 0
640 self.tx_packets_echo = 0
641 self.rx_packets_echo = 0
642
643 if multihop:
644 self.sw_if_index = 0
645 BFD.udp_dport = BFD_UDP_MH_PORT
646 else:
647 BFD.udp_dport = BFD_UDP_SH_PORT
648 self.sw_if_index = self.interface.sw_if_index
649
650 if local_addr:
651 self.local_addr = local_addr
652 else:

Callers 15

setUpMethod · 0.85
setUpMethod · 0.85
test_session_with_fibMethod · 0.85
test_bfd_o_greMethod · 0.85
test_session_upMethod · 0.85
test_hold_upMethod · 0.85
test_mismatch_authMethod · 0.85
test_restartMethod · 0.85

Calls

no outgoing calls

Tested by 15

setUpMethod · 0.68
setUpMethod · 0.68
test_session_with_fibMethod · 0.68
test_bfd_o_greMethod · 0.68
test_session_upMethod · 0.68
test_hold_upMethod · 0.68
test_mismatch_authMethod · 0.68
test_restartMethod · 0.68