Documentation ¶
Index ¶
- func GenDuplicatePackages(n int) ([]*claircore.Package, error)
- func GenUniqueDistributionScanners(n int) indexer.VersionedScanners
- func GenUniqueDistributions(n int) []*claircore.Distribution
- func GenUniquePackageScanners(n int) indexer.VersionedScanners
- func GenUniquePackages(n int) []*claircore.Package
- func GenUniqueRepositories(n int, opts ...GenRepoOption) []*claircore.Repository
- func GenUniqueRepositoryScanners(n int) indexer.VersionedScanners
- func GenUniqueVulnerabilities(n int, updater string) []*claircore.Vulnerability
- func NewRoundTripper(fn RoundTripFunc) http.RoundTripper
- func RandomSHA256Digest(t testing.TB) claircore.Digest
- func RealizeLayers(ctx context.Context, t *testing.T, spec ...LayerSpec) []claircore.Layer
- func ServeLayers(t *testing.T, n int) (*http.Client, []*claircore.Layer)
- func WFN(i int) cpe.WFN
- type GenRepoOption
- type LayerSpec
- type RoundTripFunc
- type ScannerTestcase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenDuplicatePackages ¶
GenDuplicatePackages creates an array of packages with duplicates. the array will will take n/2 and use this is a mod operand along with the current index in the for loop. it is an error to set n to 0 or 1
func GenUniqueDistributionScanners ¶
func GenUniqueDistributionScanners(n int) indexer.VersionedScanners
GenUniqueDistributionScanners creates n number of unique DistributionScanners. the array is gauranteed to not have any scanner fields be duplicates
func GenUniqueDistributions ¶
func GenUniqueDistributions(n int) []*claircore.Distribution
GenUniqueDistributions creates an array of unique distributions. the array is guaranteed not to have any duplicately named dist fields.
func GenUniquePackageScanners ¶
func GenUniquePackageScanners(n int) indexer.VersionedScanners
GenUniquePackageScanners creates n number of unique PackageScanners. the array is gauranteed to not have any scanner fields be duplicates
func GenUniquePackages ¶
GenUniquePackages creates an array of unique packages. the array is guaranteed not to have any duplicately named package fields. source packages are given an n + 1 ID to avoid duplicate primary key on insert.
func GenUniqueRepositories ¶
func GenUniqueRepositories(n int, opts ...GenRepoOption) []*claircore.Repository
GenUniqueRepositories creates an array of unique repositories. the array is guaranteed not to have any duplicately named repo fields.
func GenUniqueRepositoryScanners ¶
func GenUniqueRepositoryScanners(n int) indexer.VersionedScanners
GenUniqueRepositoryScanners creates n number of unique RepositoryScanners. the array is gauranteed to not have any scanner fields be duplicates
func GenUniqueVulnerabilities ¶
func GenUniqueVulnerabilities(n int, updater string) []*claircore.Vulnerability
func NewRoundTripper ¶
func NewRoundTripper(fn RoundTripFunc) http.RoundTripper
NewRoundTripper creates a http.RoundTripper with the provided RoundTripFunc. RountTripFunc should validate the incoming request is what's expected
func RandomSHA256Digest ¶ added in v0.0.14
RandomHash returns a random Digest.
func RealizeLayers ¶ added in v0.0.13
RealizeLayers uses fetch.Layer to populate a directory and returns a slice of Layers describing them.
func ServeLayers ¶ added in v0.0.13
ServeLayers constructs "n" random layers, arranges to serve them, and returns a slice of filled Layer structs.
Types ¶
type GenRepoOption ¶ added in v0.0.13
type GenRepoOption func(*claircore.Repository)
type ScannerTestcase ¶ added in v0.0.16
type ScannerTestcase struct { Domain string Name string Hash string Want []*claircore.Package Scanner indexer.PackageScanner }
ScannerTestcase can be used for testing layers found in the wild against a scanner.
Tests that use this struct should not be marked as integration tests, as the Run method does that internally if it needs to talk to the network.
func (ScannerTestcase) Digest ¶ added in v0.0.16
func (tc ScannerTestcase) Digest() claircore.Digest
Digest reports the digest in the Hash member.
Panics if an error is returned from ParseDigest.
func (ScannerTestcase) Run ¶ added in v0.0.16
func (tc ScannerTestcase) Run(ctx context.Context) func(*testing.T)
Run returns a function suitable for using with (*testing.T).Run.
This function assumes the returned values must exactly match tc.Want. If tc.Want only covers a subset of potential returned values, then use RunSubset.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Bisect is a git bisect helper.
|
Bisect is a git bisect helper. |
Package integration is a helper for running integration tests.
|
Package integration is a helper for running integration tests. |
mock
|
|
driver
Package mock_driver is a generated GoMock package.
|
Package mock_driver is a generated GoMock package. |
indexer
Package mock_indexer is a generated GoMock package.
|
Package mock_indexer is a generated GoMock package. |
updater
Package mock_updater is a generated GoMock package.
|
Package mock_updater is a generated GoMock package. |
updater/driver/v1
Package mock_driver is a generated GoMock package.
|
Package mock_driver is a generated GoMock package. |
Ovaldebug is a helper for debugging the ovalutil package.
|
Ovaldebug is a helper for debugging the ovalutil package. |
Package periodic contains tests meant to be run periodically in CI.
|
Package periodic contains tests meant to be run periodically in CI. |