Documentation
¶
Index ¶
- func EnableDynamicDebug(tb testing.TB, filter string)
- func Payload(tb testing.TB, length int) gopacket.Payload
- func PrependPacket(tb testing.TB, vnethdr virtio.NetHdr, pkt []byte) []byte
- func SetSysctl(tb testing.TB, name, value string)
- func TestPacket(tb testing.TB, mac net.HardwareAddr, length int) (virtio.NetHdr, []byte)
- func VirtrunOnly(tb testing.TB)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableDynamicDebug ¶
EnableDynamicDebug enables the dynamic kernel debug printing for the given filter.
Filter syntax: https://docs.kernel.org/admin-guide/dynamic-debug-howto.html
func Payload ¶
Payload returns a new gopacket.Payload with the given length which can be used for test packets.
func PrependPacket ¶
PrependPacket encodes the given virtio.NetHdr, puts it in front of the given packet slice and returns the new slice.
func TestPacket ¶
TestPacket returns a new test packet which consists of Ethernet, IPv4 and UDP headers and a variable length payload. The given MAC address will be used as the source and destination MAC in the Ethernet header and the packet will have the given total length.
Additionally, a virtio.NetHdr is returned that configures the necessary offloads that would be needed to transmit this packet over an MTU 1500 link. It configures checksum offloads and GSO, if needed.
func VirtrunOnly ¶
VirtrunOnly marks that a test or testing helper must only be run within the virtual environment created by virtrun.
This function should be used at the beginning of every test function or helper that (temporarily) modifies the state of the local system. When the test does not run in a virtrun VM, then it will fail. This protects developer systems from undesired side effects.
Types ¶
This section is empty.