diff options
author | baude <bbaude@redhat.com> | 2019-05-14 14:28:50 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-05-29 15:12:05 -0500 |
commit | f610a485c1bca7a78d3b2f70e2005b79668fab2f (patch) | |
tree | 1a3650add2aff9b57ea005c543a29a39ff5b4976 /test/e2e/libpod_suite_remoteclient_test.go | |
parent | 8422503f4311555ecb799449b371ad1600a8020f (diff) | |
download | podman-f610a485c1bca7a78d3b2f70e2005b79668fab2f.tar.gz podman-f610a485c1bca7a78d3b2f70e2005b79668fab2f.tar.bz2 podman-f610a485c1bca7a78d3b2f70e2005b79668fab2f.zip |
use imagecaches for local tests
when doing localized tests (not varlink), we can use secondary image
stores as read-only image caches. this cuts down on test time
significantly because each test does not need to restore the images from
a tarball anymore.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'test/e2e/libpod_suite_remoteclient_test.go')
-rw-r--r-- | test/e2e/libpod_suite_remoteclient_test.go | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/e2e/libpod_suite_remoteclient_test.go b/test/e2e/libpod_suite_remoteclient_test.go index b7fd8537d..c8210f7d1 100644 --- a/test/e2e/libpod_suite_remoteclient_test.go +++ b/test/e2e/libpod_suite_remoteclient_test.go @@ -30,7 +30,13 @@ func SkipIfRootless() { // Podman is the exec call to podman on the filesystem func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration { - podmanSession := p.PodmanBase(args) + podmanSession := p.PodmanBase(args, false) + return &PodmanSessionIntegration{podmanSession} +} + +// PodmanNoCache calls podman with out adding the imagecache +func (p *PodmanTestIntegration) PodmanNoCache(args []string) *PodmanSessionIntegration { + podmanSession := p.PodmanBase(args, true) return &PodmanSessionIntegration{podmanSession} } @@ -145,6 +151,21 @@ func getVarlinkOptions(p *PodmanTestIntegration, args []string) []string { return podmanOptions } +func (p *PodmanTestIntegration) RestoreArtifactToCache(image string) error { + fmt.Printf("Restoring %s...\n", image) + dest := strings.Split(image, "/") + destName := fmt.Sprintf("/tmp/%s.tar", strings.Replace(strings.Join(strings.Split(dest[len(dest)-1], "/"), ""), ":", "-", -1)) + p.CrioRoot = p.ImageCacheDir + restore := p.PodmanNoCache([]string{"load", "-q", "-i", destName}) + restore.WaitWithDefaultTimeout() + return nil +} + +// SeedImages restores all the artifacts into the main store for remote tests +func (p *PodmanTestIntegration) SeedImages() error { + return p.RestoreAllArtifacts() +} + // RestoreArtifact puts the cached image into our test store func (p *PodmanTestIntegration) RestoreArtifact(image string) error { fmt.Printf("Restoring %s...\n", image) @@ -169,3 +190,6 @@ func (p *PodmanTestIntegration) DelayForVarlink() { time.Sleep(1 * time.Second) } } + +func populateCache(podman *PodmanTestIntegration) {} +func removeCache() {} |