Documentation
¶
Overview ¶
Package isissession is deprecated and scoped only to be used with feature/experimental/isis/ate_tests/*. Do not use elsewhere.
Index ¶
- Constants
- Variables
- func ISISPath(dut *ondatra.DUTDevice) *netinstisis.NetworkInstance_Protocol_IsisPath
- func ProtocolPath(dut *ondatra.DUTDevice) *networkinstance.NetworkInstance_ProtocolPath
- type TestSession
- func (s *TestSession) AwaitAdjacency() (string, error)
- func (s *TestSession) ConfigISIS(ocFn func(*oc.NetworkInstance_Protocol_Isis))
- func (s *TestSession) GetPacketLoss(t testing.TB, flow gosnappi.Flow) float32
- func (s *TestSession) MustATEInterface(t testing.TB, portID string) gosnappi.Device
- func (s *TestSession) MustAdjacency(t testing.TB) string
- func (s *TestSession) PushAndStart(t testing.TB) error
- func (s *TestSession) PushAndStartATE(t testing.TB)
- func (s *TestSession) PushDUT(ctx context.Context, t testing.TB) error
- func (s *TestSession) WithISIS() *TestSession
Constants ¶
const ( DUTAreaAddress = "49.0001" ATEAreaAddress = "49.0002" DUTSysID = "1920.0000.2001" ATESysID = "640000000001" ISISName = "DEFAULT" )
The testbed consists of a dut and an ate with two connections, labeled ISISIntf and Intf2. ISISIntf links dut:port1 and ate:port1, which are assigned 192.0.2.1/30 and 192.0.2.2/30 respectively. Intf2 connects dut:port2 to ate:port2, which are 192.0.2.5/30 and 192.0.2.6/30. We establish an IS-IS adjacency over ISISIntf. For traffic testing, we configure the ATE end of the IS-IS adjacency to advertise 198.51.100.0/24, then generate traffic through ate:port2 with IPv4 headers indicating that it should go to a random address in that range; the dut should route this traffic to the IS-IS link, where the ATE should log it arriving on ate:port1.
const PTISIS = oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS
PTISIS is shorthand for the long oc protocol type constant
Variables ¶
var ( // DUTISISAttrs has attributes for the DUT ISIS connection on port1 DUTISISAttrs = &attrs.Attributes{ Desc: "DUT to ATE with IS-IS", IPv4: "192.0.2.1", IPv6: "2001:db8::1", IPv4Len: pLen4, IPv6Len: pLen6, } // ATEISISAttrs has attributes for the ATE ISIS connection on port1 ATEISISAttrs = &attrs.Attributes{ Name: "port1", Desc: "ATE to DUT with IS-IS", MAC: "02:11:01:00:00:01", IPv4: "192.0.2.2", IPv6: "2001:db8::2", IPv4Len: pLen4, IPv6Len: pLen6, } // DUTTrafficAttrs has attributes for the DUT end of the traffic connection (port2) DUTTrafficAttrs = &attrs.Attributes{ Desc: "DUT to ATE secondary link", IPv4: "192.0.2.5", IPv6: "2001:db8::5", IPv4Len: pLen4, IPv6Len: pLen6, } // ATETrafficAttrs has attributes for the ATE end of the traffic connection (port2) ATETrafficAttrs = &attrs.Attributes{ Name: "port2", Desc: "ATE to DUT secondary link", MAC: "02:12:01:00:00:01", IPv4: "192.0.2.6", IPv6: "2001:db8::6", IPv4Len: pLen4, IPv6Len: pLen6, } )
Functions ¶
func ISISPath ¶
func ISISPath(dut *ondatra.DUTDevice) *netinstisis.NetworkInstance_Protocol_IsisPath
ISISPath is shorthand for ProtocolPath().Isis().
func ProtocolPath ¶
func ProtocolPath(dut *ondatra.DUTDevice) *networkinstance.NetworkInstance_ProtocolPath
ProtocolPath returns the path to the IS-IS protocol named ISISName on the default network instance.
Types ¶
type TestSession ¶
type TestSession struct { DUT *ondatra.DUTDevice DUTClient *ygnmi.Client ATE *ondatra.ATEDevice // DUTConf, ATEConf, and ATETop can be modified by tests; calling .Push() will apply them to the // dut and ate. DUTPort1, DUTPort2, ATEPort1, ATEPort2 *ondatra.Port ATEIntf1, ATEIntf2 gosnappi.Device // DUTConf and ATETop can be modified by tests; calling .Push() will apply // them to the dut and ate. DUTConf *oc.Root ATETop gosnappi.Config }
TestSession is a convenience wrapper around the dut, ate, ports, and topology we're using.
func MustNew ¶
func MustNew(t testing.TB) *TestSession
MustNew creates a new TestSession or Fatal()s if anything goes wrong.
func New ¶
func New(t testing.TB) (*TestSession, error)
New creates a new TestSession using the default global config, and configures the interfaces on the dut and the ate.
func (*TestSession) AwaitAdjacency ¶
func (s *TestSession) AwaitAdjacency() (string, error)
AwaitAdjacency waits up to a minute for the dut to report that the ISISIntf link has formed any IS-IS adjacency, returning the adjacency ID or an error if one doesn't form.
func (*TestSession) ConfigISIS ¶
func (s *TestSession) ConfigISIS(ocFn func(*oc.NetworkInstance_Protocol_Isis))
ConfigISIS takes two functions, one that operates on an OC IS-IS block and one that operates on an ondatra ATE IS-IS block. The first will be applied to the IS-IS block of ts.DUTConfig, and the second will be applied to the IS-IS configuration of ts.ATETop
func (*TestSession) GetPacketLoss ¶
GetPacketLoss returns the packet loss for a given flow
func (*TestSession) MustATEInterface ¶
MustATEInterface returns the ATE interface for the portID, or calls t.Fatal if this fails.
func (*TestSession) MustAdjacency ¶
func (s *TestSession) MustAdjacency(t testing.TB) string
MustAdjacency waits up to a minute for an IS-IS adjacency to form between the DUT and the ATE; it returns the adjacency ID or calls t.Fatal no adjacency forms.
func (*TestSession) PushAndStart ¶
func (s *TestSession) PushAndStart(t testing.TB) error
PushAndStart calls PushDUT and PushAndStartATE to send config to both devices.
func (*TestSession) PushAndStartATE ¶
func (s *TestSession) PushAndStartATE(t testing.TB)
PushAndStartATE pushes the ATETop to the ATE and starts protocols on it.
func (*TestSession) PushDUT ¶
PushDUT replaces DUT config with s.dutConf. Only interfaces and the ISIS protocol are written.
func (*TestSession) WithISIS ¶
func (s *TestSession) WithISIS() *TestSession
WithISIS adds ISIS to a test session.