artifact

package
v0.15.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const MetadataFileName = "bundle.yaml"

MetadataFileName is the name of the meta information yaml file within an artifact archive.

Variables

This section is empty.

Functions

func AddDirToFileMap added in v0.12.0

func AddDirToFileMap(fileMap FileMap, archiveBasePath string, dir string) error

AddDirToFileMap traverses the directory dir recursively and adds its contents to the file map under the base path archiveBasePath.

func ExtractArchiveForTestsOnly

func ExtractArchiveForTestsOnly(bundle, dir string) error

ExtractArchiveForTestsOnly extracts the bundle to dir.

func WriteArchive

func WriteArchive(out io.Writer, fileMap FileMap) error

WriteArchive writes a GZip-compressed TAR to out containing the files and directories given in file map. The keys in file map correspond to the path within the archive, the corresponding value is expected to be the absolute path of the file or directory on disk. Note: WriteArchive *does not* (recursively) traverse directories to add their contents to the archive. If this is desired, use AddDirToFileMap to explicitly add the contents to the file map before calling WriteArchive.

Types

type CodeRevision

type CodeRevision struct {
	Git *GitRevision `yaml:"git,omitempty"`
}

type EngineOptions added in v0.1.3

type EngineOptions struct {
	Flags []string `yaml:"flags,omitempty"`
	Env   []string `yaml:"env,omitempty"`
}

type FileMap added in v0.12.0

type FileMap map[string]string

This struct is used to list all files that should be included in the archive. - Key: the desired relative path inside the archive - Value: real path to the file in the filesystem.

type Fuzzer

type Fuzzer struct {
	Target    string `yaml:"target,omitempty"`
	Name      string `yaml:"name,omitempty"`
	Path      string `yaml:"path"`
	Engine    string `yaml:"engine"`
	Sanitizer string `yaml:"sanitizer,omitempty"`
	// The different YAML field name is *not* a typo: For historical reasons, the "build_dir" field is supposed to
	// include the root directory of the *source* rather than the build tree of the project. Rather than expose all
	// cifuzz devs to this inconsistency, we keep it in the serialization logic.
	ProjectDir    string        `yaml:"build_dir"`
	Dictionary    string        `yaml:"dictionary,omitempty"`
	Seeds         string        `yaml:"seeds,omitempty"`
	LibraryPaths  []string      `yaml:"library_paths,omitempty"`
	RuntimePaths  []string      `yaml:"runtime_paths,omitempty"`
	EngineOptions EngineOptions `yaml:"engine_options,omitempty"`
	MaxRunTime    uint          `yaml:"max_run_time,omitempty"`
}

Fuzzer specifies the type and locations of fuzzers contained in the archive.

type GitRevision

type GitRevision struct {
	Commit string `yaml:"commit,omitempty"`
	Branch string `yaml:"branch,omitempty"`
}

type Metadata

type Metadata struct {
	*RunEnvironment `yaml:"run_environment"`
	CodeRevision    *CodeRevision `yaml:"code_revision,omitempty"`
	Fuzzers         []*Fuzzer     `yaml:"fuzzers"`
}

Metadata defines meta information for artifacts contained within a fuzzing artifact archive.

func (*Metadata) FromYaml

func (a *Metadata) FromYaml(data []byte) error

func (*Metadata) ToYaml

func (a *Metadata) ToYaml() ([]byte, error)

type RunEnvironment

type RunEnvironment struct {
	// The docker image and tag to be used: eg. debian:stable
	Docker string
}

RunEnvironment specifies the environment in which the fuzzers are to be run.

Jump to

Keyboard shortcuts

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