testutils

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearMockOutputs added in v1.7.1

func ClearMockOutputs()

ClearMockOutputs clears all the mocked outputs stored in the map.

func CreateCertificateAndKey

func CreateCertificateAndKey() (testCertContents []byte, testKeyContents []byte, err error)

CreateCertificateAndKey generates a self-signed test certificate and private key, and returns them in PEM format.

func CreateTestCertificate

func CreateTestCertificate() (certPath string, keyPath string, caPath string, err error)

CreateTestCertificate generates a test certificate, key, and CA certificate, writes them to temporary files, and returns their paths.

func CreateTestCertificates

func CreateTestCertificates() (certPath string, keyPath string, err error)

CreateTestCertificates generates a test certificate and key, writes them to temporary files, and returns their paths.

func CreateTestCrt

func CreateTestCrt() (certPath string, keyPath string, certContents []byte, err error)

CreateTestCrt generates a test certificate and key, writes them to temporary files, and returns their paths and the certificate contents.

func SetMockOutput added in v1.7.1

func SetMockOutput(command string, args []string, output []byte, err error)

SetMockOutput sets the mocked output and error for a command with its arguments.

func TestCmdExecutor added in v1.7.1

func TestCmdExecutor(command string, args ...string) utils.Command

TestCmdExecutor returns a mock command executor that simulates command execution.

Types

This section is empty.

Jump to

Keyboard shortcuts

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