2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2024-11-29 11:06:24 +00:00

tests: fix builder tests: pull image before test

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
Adphi 2022-09-10 12:38:02 +02:00
parent d7f2c453a9
commit 6c93c8be56
Signed by: adphi
GPG Key ID: 46BE4062DB2397FF
2 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import (
) )
func testSysconfig(t *testing.T, ctx context.Context, img, sysconf, kernel, initrd string) { func testSysconfig(t *testing.T, ctx context.Context, img, sysconf, kernel, initrd string) {
require.NoError(t, docker.Pull(ctx, img))
tmpPath := filepath.Join(os.TempDir(), "d2vm-tests", strings.NewReplacer(":", "-", ".", "-").Replace(img)) tmpPath := filepath.Join(os.TempDir(), "d2vm-tests", strings.NewReplacer(":", "-", ".", "-").Replace(img))
require.NoError(t, os.MkdirAll(tmpPath, 0755)) require.NoError(t, os.MkdirAll(tmpPath, 0755))
defer os.RemoveAll(tmpPath) defer os.RemoveAll(tmpPath)

View File

@ -93,7 +93,7 @@ var (
) )
func FetchDockerImageOSRelease(ctx context.Context, img string, tmpPath string) (OSRelease, error) { func FetchDockerImageOSRelease(ctx context.Context, img string, tmpPath string) (OSRelease, error) {
d := filepath.Join(tmpPath, "osrelase.Dockerfile") d := filepath.Join(tmpPath, "osrelease.Dockerfile")
f, err := os.Create(d) f, err := os.Create(d)
if err != nil { if err != nil {
return OSRelease{}, err return OSRelease{}, err