Documentation ¶
Overview ¶
Package extdata implements the external data file mechanism.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶
func Ensure(ctx context.Context, dataDir, artifactsURL string, tests []*testing.TestInstance, cl devserver.Client) (purgeable []string)
Ensure downloads missing or stale external data files associated with tests. dataDir is the path to the base directory containing external data link files (typically "/usr/local/share/tast/data" on DUT). artifactURL is the URL of Google Cloud Storage directory, ending with a slash, containing build artifacts for the current Chrome OS image. Ensure returns a list of external data file paths not needed to run the specified tests. They can be deleted if the disk space is low. This function does not return errors; instead it tries to download files as far as possible and logs encountered errors with ctx so that a single download error does not cause all tests to fail.
Types ¶
type LinkData ¶
type LinkData struct { // Type declares the type of the external data link. Type LinkType `json:"type"` // StaticURL is the URL of the static external data file on Google Cloud Storage. // This field is valid for static external data links only. StaticURL string `json:"url"` // Size is the size of the external data file in bytes. // This field is valid for static external data links only. Size int64 `json:"size"` // Size is SHA256 hash of the external data file. // This field is valid for static external data links only. SHA256Sum string `json:"sha256sum"` // Name is the file name of a build artifact. // This field is valid for build artifact external data links only. Name string `json:"name"` // Executable specifies whether the external data file is executable. // If this is true, executable permission is given to the downloaded file. Executable bool `json:"executable"` }
LinkData defines the schema of external data link files.