test

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseURL       = "http://127.0.0.1:%s"
	BaseSecureURL = "https://127.0.0.1:%s"
	SleepTime     = 100 * time.Millisecond
)

Variables

View Source
var (
	ErrPostBlob = errors.New("can't post blob")
	ErrPutBlob  = errors.New("can't put blob")
)

Functions

func CopyFiles

func CopyFiles(sourceDir, destDir string) error

func ErrStatusCode added in v1.4.2

func ErrStatusCode(statusCode int) int

func Error

func Error(err error) error

func GetBaseURL

func GetBaseURL(port string) string

func GetEmptyImageConfig added in v1.4.3

func GetEmptyImageConfig() ([]byte, godigest.Digest)

func GetFreePort

func GetFreePort() string

func GetImageComponents added in v1.4.2

func GetImageComponents(layerSize int) (imagespec.Image, [][]byte, imagespec.Manifest, error)

func GetImageConfig

func GetImageConfig() ([]byte, godigest.Digest)

func GetOciLayoutDigests added in v1.4.1

func GetOciLayoutDigests(imagePath string) (godigest.Digest, godigest.Digest, godigest.Digest)

func GetRandomImageConfig

func GetRandomImageConfig() ([]byte, godigest.Digest)

func GetSecureBaseURL

func GetSecureBaseURL(port string) string

func GetTestBlobDigest added in v1.4.3

func GetTestBlobDigest(image, which string) godigest.Digest

which: manifest, config, layer

func InjectFailure

func InjectFailure(skip int) bool

func Location

func Location(baseURL string, resp *resty.Response) string

func MakeHtpasswdFile

func MakeHtpasswdFile() string

func MakeHtpasswdFileFromString

func MakeHtpasswdFileFromString(fileContent string) string

func Ok

func Ok(ok bool) bool

func ReadLogFileAndSearchString added in v1.4.3

func ReadLogFileAndSearchString(logPath string, stringToMatch string, timeout time.Duration) (bool, error)

func UploadArtifact added in v1.4.3

func UploadArtifact(baseURL, repo string, artifactManifest *imagespec.Artifact) error

func UploadBlob added in v1.4.3

func UploadBlob(baseURL, repo string, blob []byte, artifactBlobMediaType string) error

func UploadImage added in v1.4.2

func UploadImage(img Image, baseURL, repo string) error

func WaitTillServerReady

func WaitTillServerReady(url string)

func WaitTillTrivyDBDownloadStarted added in v1.4.2

func WaitTillTrivyDBDownloadStarted(rootDir string)

Types

type Image added in v1.4.2

type Image struct {
	Manifest imagespec.Manifest
	Config   imagespec.Image
	Layers   [][]byte
	Tag      string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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