Documentation ¶
Overview ¶
Package testutil provides general utilities for protocols UTs.
Package testutil provides general utilities for protocols UTs.
Index ¶
Examples ¶
Constants ¶
const ( TLSDisabled = false TLSEnabled = true )
Constants to represent whether the connection should be encrypted with TLSEnabled.
Variables ¶
This section is empty.
Functions ¶
func GetShortTestName ¶
GetShortTestName generates a suffix in the form "<protocol>-<subtest name>" to be passed to WithPCAP.
func WithPCAP ¶
WithPCAP runs tcpdump for the duration of the test.
It returns an `io.Writer` to be used as a KeyLogWriter in tls.Config to be able, to decrypt the TLS traffic in the resulting PCAP. The resulting PCAPs and keylog files will be saved in `/tmp/test_pcaps`
Unless alwaysSave is true, WithPCAP will only save the resulting PCAP if the test fails.
Types ¶
This section is empty.