Documentation
¶
Index ¶
- Variables
- func AssertDefsecEqual(t *testing.T, expected, actual any)
- func AssertRuleFound(t *testing.T, ruleID string, results scan.Results, message string, args ...any)
- func AssertRuleNotFailed(t *testing.T, ruleID string, results scan.Results, message string, args ...any)
- func AssertRuleNotFound(t *testing.T, ruleID string, results scan.Results, message string, args ...any)
- func CopyDir(t *testing.T, src, dst string)
- func CopyFile(t *testing.T, src, dst string)
- func CreateFS(files map[string]string) fs.FS
- func DecompressGzip(t *testing.T, src, dst string)
- func DecompressSparseGzip(t *testing.T, src, dst string)
- func ImageName(subpath, tag, digest string) string
- func MustMkdirAll(t *testing.T, dir string)
- func MustParseReference(t *testing.T, s string) name.Reference
- func MustReadJSON(t *testing.T, filePath string, v any)
- func MustReadYAML(t *testing.T, path string, out any)
- func MustWriteFile(t *testing.T, filePath string, content []byte)
- func MustWriteJSON(t *testing.T, filePath string, v any)
- func MustWriteYAML(t *testing.T, path string, data any)
- func SetupLocalStack(ctx context.Context, version string) (*localstack.LocalStackContainer, string, error)
- func TxtarToFS(t *testing.T, path string) fs.FS
- func VMImageName(subpath, tag, digest string) string
- type DockerClient
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AssertDefsecEqual ¶
func AssertRuleFound ¶
func AssertRuleNotFailed ¶
func AssertRuleNotFound ¶
func CopyDir ¶
CopyDir copies the directory content from src to dst. It supports only simple cases for testing.
func DecompressGzip ¶
func DecompressSparseGzip ¶
DecompressSparseGzip decompresses a sparse gzip file for virtual machine image.
func MustMkdirAll ¶
func MustParseReference ¶
MustParseReference parses a string into a Reference and fails the test if there's an error
func SetupLocalStack ¶
func SetupLocalStack(ctx context.Context, version string) (*localstack.LocalStackContainer, string, error)
func VMImageName ¶
Types ¶
type DockerClient ¶
func NewDockerClient ¶
func NewDockerClient(t *testing.T) *DockerClient
func (*DockerClient) ImageCleanLoad ¶
ImageCleanLoad performs a clean load of a Docker image from a tar archive. It removes any existing images with conflicting RepoTags before loading, ensuring the loaded image has the correct RepoTags from the archive. It automatically registers cleanup via t.Cleanup() to remove the loaded image after the test.
func (*DockerClient) ImageLoad ¶
ImageLoad loads a Docker image from a tar archive file into the Docker engine. It automatically registers cleanup via t.Cleanup() to remove the loaded image after the test.