cases

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package cases contains router acceptance cases that can be integrated into the braccept binary.

The process to add a new case is the following:

Step 0. Refer to the following for the test's setup:

  • Overview: acceptance/router_multi/topology.drawio.png
  • Topology Details: acceptance/router_multi/conf/topology.json
  • MAC Addresses: acceptance/router_multi/test.py Note that all MAC addresses of interfaces on the far side of the A/B/C/D routers are identical: f00d:cafe:beef

Step 1. Add a new file with a representative name e.g. cases/child_to_child_xover.go

Step 2. Create a function inside that file which returns the new br accept testcase.

// ChildToChildXover  <ADD DESCRIPTION>
func ChildToChildXover(artifactsDir string, mac hash.Hash) runner.Case {

...

	return runner.Case{
		Dscr:     "ChildToChild",
		WriteTo:  "veth_151_host",
		ReadFrom: "veth_141_host",
		Input:    input.Bytes(),
		Want:     want.Bytes(),
	}
}

Step 3. In the braccept/main.go, include the above function

multi := []runner.Case{
	cases.ChildToParent(artifactsDir, mac),
	cases.ChildToChildXover(artifactsDir, mac),
}

Step 4. Do a local run, which means set up a working router, execute the braccept, shutdown the router. This is done in sequence by:

bazel test acceptance/router_multi:all --config=integration --nocache_test_results

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChildToChildXover

func ChildToChildXover(artifactsDir string, mac hash.Hash) runner.Case

ChildToChildXover tests transit traffic over the same BR host and for which there is xover, e.g. a switch from up segment to core segment.

func ChildToInternalHost

func ChildToInternalHost(artifactsDir string, mac hash.Hash) runner.Case

ChildToInternalHost tests traffic from a child to an AS host.

func ChildToInternalHostShortcut

func ChildToInternalHostShortcut(artifactsDir string, mac hash.Hash) runner.Case

ChildToInternalHostShortcut tests traffic from a child to an AS host with a short-cut path. I.e., a path where only a partial path segment is used.

func ChildToInternalParent

func ChildToInternalParent(artifactsDir string, mac hash.Hash) runner.Case

ChildToInternalParent tests traffic from a child to a parent link that goes out from a different BR.

func ChildToParent

func ChildToParent(artifactsDir string, mac hash.Hash) runner.Case

ChildToParent tests transit traffic over the same BR host.

func ChildToPeer added in v0.9.0

func ChildToPeer(artifactsDir string, mac hash.Hash) runner.Case

ChildToPeer tests transit traffic over one BR host and one peering hop. In this case, traffic enters via a regular link, and leaves via a peering link from the same router. To be valid, the path as to be constructed as one up segment over the normal link ending with a peering hop and one down segment starting at the peering link's destination. The peering hop is the second hop on the first segment as it crosses from a child interface to a peering interface. In this test case, the down segment is a one-hop segment. The peering link's destination is the only hop.

func ExternalBFD

func ExternalBFD(artifactsDir string, mac hash.Hash) runner.Case

ExternalBFD sends an unbootstrapped BFD message to an external interface and expects a bootstrapped BFD message on the same interface.

func IncomingOneHop

func IncomingOneHop(artifactsDir string, mac hash.Hash) runner.Case

IncomingOneHop tests one-hop being sent from the remote AS to the local AS.

func InternalBFD

func InternalBFD(artifactsDir string, mac hash.Hash) runner.Case

InternalBFD sends an unbootstrapped BFD message to an internal interface and expects a bootstrapped BFD message on the same interface.

func InternalHostToChild

func InternalHostToChild(artifactsDir string, mac hash.Hash) runner.Case

InternalHostToChild tests transit from an AS local host out.

func InternalParentToChild

func InternalParentToChild(artifactsDir string, mac hash.Hash) runner.Case

InternalParentToChild tests transit from a different BR in this AS out to a child.

func InvalidSrcInternalParentToChild added in v0.9.0

func InvalidSrcInternalParentToChild(artifactsDir string, mac hash.Hash) runner.Case

InvalidSrcInternalParentToChild tests that transit packets, which are expected to be received from a different BR in this AS, are dropped if they come from an unexpected source address.

func JumboPacket

func JumboPacket(artifactsDir string, mac hash.Hash) runner.Case

JumboPacket tests jumbo packet transit traffic over the same BR host.

func NoSCMPReplyForSCMPError

func NoSCMPReplyForSCMPError(artifactsDir string, mac hash.Hash) runner.Case

NoSCMPReplyForSCMPError tests that the router doesn't trigger another SCMP error packet for a packet that is already an SCMP error.

func OutgoingOneHop

func OutgoingOneHop(artifactsDir string, mac hash.Hash) runner.Case

OutgoingOneHop tests one-hop being sent from the local AS to the remote AS.

func ParentToChild

func ParentToChild(artifactsDir string, mac hash.Hash) runner.Case

ParentToChild tests transit traffic over the same BR host.

func ParentToInternalHost

func ParentToInternalHost(artifactsDir string, mac hash.Hash) runner.Case

ParentToInternalHost test traffic from a parent to an AS host.

func ParentToInternalHostMultiSegment

func ParentToInternalHostMultiSegment(artifactsDir string, mac hash.Hash) runner.Case

ParentToInternalHostMultiSegment test traffic from a parent to an AS host where two path segments are involved.

func PeerToChild added in v0.9.0

func PeerToChild(artifactsDir string, mac hash.Hash) runner.Case

PeerToChild tests transit traffic over one BR host and one peering hop. In this case, traffic enters via a peering link, and leaves via a regular link from the same router. To be valid, the path as to be constructed as one up segment ending at the peering link's origin and one down segment over the regular link. The peering hop is the first hop on the second segment as it crosses from a peering interface to a child interface. In this test case, the up segment is a one-hop segment. The peering link's origin is the only hop.

func SCMPBadMAC

func SCMPBadMAC(artifactsDir string, mac hash.Hash) runner.Case

SCMPBadMAC tests a packet without a MAC set.

func SCMPBadMACInternal

func SCMPBadMACInternal(artifactsDir string, mac hash.Hash) runner.Case

SCMPBadMACInternal tests a packet with a bad MAC that is sent from internal.

func SCMPBadPktLen

func SCMPBadPktLen(artifactsDir string, mac hash.Hash) runner.Case

SCMPBadPktLen tests a packet which has an invalid payload length specified.

func SCMPChildToParentLocalXover

func SCMPChildToParentLocalXover(artifactsDir string, mac hash.Hash) runner.Case

SCMPChildToParentLocalXover tests a packet that attempts a segment switch from a up segment to another up segment. The egress interface is on the same router than the ingress interface.

func SCMPChildToParentXover

func SCMPChildToParentXover(artifactsDir string, mac hash.Hash) runner.Case

SCMPChildToParentXover tests a packet that attempts a segment switch from an up segment to another up segment. The egress interface is on a different router than the ingress interface.

func SCMPDestinationUnreachable

func SCMPDestinationUnreachable(artifactsDir string, mac hash.Hash) runner.Case

SCMPDestinationUnreachable sends a packet for an SVC address that doesn't exist.

func SCMPExpiredHop

func SCMPExpiredHop(artifactsDir string, mac hash.Hash) runner.Case

SCMPExpiredHop tests a packet with an expired hop field.

func SCMPExpiredHopAfterXover

func SCMPExpiredHopAfterXover(artifactsDir string, mac hash.Hash) runner.Case

SCMPExpiredHopAfterXover tests a packet with an expired hop field after an x-over. The relative timestamp can be encoded in the SPAO header and sent back to the src.

func SCMPExpiredHopAfterXoverConsDir

func SCMPExpiredHopAfterXoverConsDir(artifactsDir string, mac hash.Hash) runner.Case

SCMPExpiredHopAfterXoverConsDir tests a packet with an expired hop field after an x-over. The relative timestamp can be encoded in the SPAO header and sent back to the src.

func SCMPExpiredHopAfterXoverInternal

func SCMPExpiredHopAfterXoverInternal(artifactsDir string, mac hash.Hash) runner.Case

SCMPExpiredHopAfterXoverInternal tests a packet with an expired hop field after an x-over received from an internal router. The expired path segment is against construction direction. The relative timestamp can be encoded in the SPAO header and sent back to the src.

func SCMPExpiredHopAfterXoverInternalConsDir

func SCMPExpiredHopAfterXoverInternalConsDir(
	artifactsDir string,
	mac hash.Hash,
) runner.Case

SCMPExpiredHopAfterXoverInternalConsDir tests a packet with an expired hop field after an x-over received from an internal router. The expired path segment is in construction direction. The expired path segment is against construction direction. The relative timestamp can be encoded in the SPAO header and sent back to the src.

func SCMPInternalXover

func SCMPInternalXover(artifactsDir string, mac hash.Hash) runner.Case

SCMPInternalXover tests a packet that attempts a segment switch but was received on the internal interface. That is never allowed.

func SCMPInvalidDstIAChildToParent added in v0.9.0

func SCMPInvalidDstIAChildToParent(artifactsDir string, mac hash.Hash) runner.Case

func SCMPInvalidDstIAInternalHostToChild added in v0.9.0

func SCMPInvalidDstIAInternalHostToChild(artifactsDir string, mac hash.Hash) runner.Case

func SCMPInvalidHopChildToChild added in v0.9.0

func SCMPInvalidHopChildToChild(artifactsDir string, mac hash.Hash) runner.Case

SCMPInvalidHopChildToChild tests a packet that attempts a hop from a child to a child interface, with a valid hopfield MAC. This can only occur if the hop key has been compromised.

func SCMPInvalidHopParentToParent added in v0.9.0

func SCMPInvalidHopParentToParent(artifactsDir string, mac hash.Hash) runner.Case

SCMPInvalidHopParentToParent tests a packet that attempts a hop from a parent to a parent interface, with a valid hopfield MAC. This can only occur if the hop key has been compromised.

func SCMPInvalidSrcIAChildToParent added in v0.9.0

func SCMPInvalidSrcIAChildToParent(artifactsDir string, mac hash.Hash) runner.Case

func SCMPInvalidSrcIAInternalHostToChild added in v0.9.0

func SCMPInvalidSrcIAInternalHostToChild(artifactsDir string, mac hash.Hash) runner.Case

func SCMPParentToChildLocalXover

func SCMPParentToChildLocalXover(artifactsDir string, mac hash.Hash) runner.Case

SCMPParentToChildLocalXover tests a packet that attempts a segment switch from a down segment to another down segment. The egress interface is on the same router than the ingress interface.

func SCMPParentToChildXover

func SCMPParentToChildXover(artifactsDir string, mac hash.Hash) runner.Case

SCMPParentToChildXover tests a packet that attempts a segment switch from a down segment to another down segment. The egress interface is on a different router than the ingress interface.

func SCMPParentToParentLocalXover

func SCMPParentToParentLocalXover(artifactsDir string, mac hash.Hash) runner.Case

SCMPParentToParentLocalXover tests a packet that attempts a segment switch from a down segment to a up segment. The egress interface is on the same router than the ingress interface.

func SCMPParentToParentXover

func SCMPParentToParentXover(artifactsDir string, mac hash.Hash) runner.Case

SCMPParentToParentXover tests a packet that attempts a segment switch from a down segment to a up segment. The egress interface is on a different router than the ingress interface.

func SCMPQuoteCut

func SCMPQuoteCut(artifactsDir string, mac hash.Hash) runner.Case

SCMPQuoteCut tests that a packet that triggers an SCMP quote and is very long is correctly cut off, i.e. the response packet does not exceed the maximum SCMP packet length.

func SCMPTracerouteEgress

func SCMPTracerouteEgress(artifactsDir string, mac hash.Hash) runner.Case

SCMPTracerouteEgress tests an SCMP traceroute request with alert on the egress interface.

func SCMPTracerouteEgressAfterXover

func SCMPTracerouteEgressAfterXover(artifactsDir string, mac hash.Hash) runner.Case

SCMPTracerouteEgressAfterXover tests an SCMP traceroute request with alert on the egress interface after Xover and the packet was received on the internal interface..

func SCMPTracerouteEgressConsDir

func SCMPTracerouteEgressConsDir(artifactsDir string, mac hash.Hash) runner.Case

SCMPTracerouteEgressConsDir tests an SCMP traceroute request with alert on the egress interface.

func SCMPTracerouteIngress

func SCMPTracerouteIngress(artifactsDir string, mac hash.Hash) runner.Case

SCMPTracerouteIngress tests an SCMP traceroute request with alert on the ingress interface.

func SCMPTracerouteIngressConsDir

func SCMPTracerouteIngressConsDir(artifactsDir string, mac hash.Hash) runner.Case

SCMPTracerouteIngressConsDir tests an SCMP traceroute request with alert on the ingress interface.

func SCMPTracerouteIngressWithSPAO added in v0.9.0

func SCMPTracerouteIngressWithSPAO(artifactsDir string, mac hash.Hash) runner.Case

SCMPTracerouteIngressWithSPAO tests an SCMP traceroute request with alert on the ingress interface and a SPAO header.

func SCMPTracerouteInternal

func SCMPTracerouteInternal(artifactsDir string, mac hash.Hash) runner.Case

SCMPTracerouteInternal tests a traceroute request from the AS itself.

func SCMPUnknownHop

func SCMPUnknownHop(artifactsDir string, mac hash.Hash) runner.Case

SCMPUnknownHop tests a packet with a wrong ingress interface ID.

func SCMPUnknownHopEgress

func SCMPUnknownHopEgress(artifactsDir string, mac hash.Hash) runner.Case

SCMPUnknownHopEgress sends a packet for an egress interface that doesn't exists.

func SVC

func SVC(artifactsDir string, mac hash.Hash) runner.Case

SVC tests resolution of SVC addresses.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL