From 4aad1ce42ac95d6dab7604211e99d3629622f8b6 Mon Sep 17 00:00:00 2001 From: B&R Date: Fri, 3 Nov 2023 07:47:27 +0100 Subject: [PATCH] fix: Test not starting because of permissions conflict --- go.mod | 2 ++ go.sum | 5 +++++ pkg/generate/e2e_util_test.go | 7 ++++++- versions.mk | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index e3e629e..a9be274 100644 --- a/go.mod +++ b/go.mod @@ -62,6 +62,7 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/opencontainers/runc v1.1.3 // indirect + github.com/otiai10/copy v1.14.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect @@ -72,6 +73,7 @@ require ( golang.org/x/crypto v0.5.0 // indirect golang.org/x/net v0.8.0 // indirect golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect + golang.org/x/sync v0.3.0 // indirect golang.org/x/sys v0.6.0 // indirect golang.org/x/term v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect diff --git a/go.sum b/go.sum index 77daf44..56ad559 100644 --- a/go.sum +++ b/go.sum @@ -254,6 +254,9 @@ github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= +github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= +github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= +github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -415,6 +418,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/pkg/generate/e2e_util_test.go b/pkg/generate/e2e_util_test.go index 5a435f6..b6e7a73 100644 --- a/pkg/generate/e2e_util_test.go +++ b/pkg/generate/e2e_util_test.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + cp "github.com/otiai10/copy" "github.com/pkg/errors" generate2 "github.com/riotkit-org/br-backup-maker/pkg/generate" log "github.com/sirupsen/logrus" @@ -163,6 +164,7 @@ func loginToServer(serverHost string, serverPort int, user string, password stri func createServerContainer(ctx context.Context, postgresHost string, postgresPort int, minioHost string, minioPort int) (testcontainers.Container, string, int) { version := os.Getenv("TEST_BACKUP_REPOSITORY_VERSION") req := testcontainers.ContainerRequest{ + User: "root", Image: "ghcr.io/riotkit-org/backup-repository:" + version, Env: map[string]string{ "BR_DB_HOSTNAME": postgresHost, @@ -193,9 +195,12 @@ func createServerContainer(ctx context.Context, postgresHost string, postgresPor }, } wd, _ := os.Getwd() + buildPath := wd + "/../../.build" + _ = cp.Copy(wd+"/../../resources/filesystem-config", buildPath+"/filesystem-config") + req.Mounts = testcontainers.ContainerMounts{ testcontainers.ContainerMount{ - Source: testcontainers.GenericBindMountSource{HostPath: wd + "/../../.build"}, + Source: testcontainers.GenericBindMountSource{HostPath: buildPath}, Target: "/mnt", ReadOnly: false, }, diff --git a/versions.mk b/versions.mk index e3f625d..5cfa5c2 100644 --- a/versions.mk +++ b/versions.mk @@ -3,7 +3,7 @@ # # Used in E2E testing -TEST_BACKUP_REPOSITORY_VERSION="v4.0.0" +TEST_BACKUP_REPOSITORY_VERSION="v4.1.0-rc1" TEST_POSTGRES_VERSION="14.2-alpine" TEST_MINIO_VERSION="2022.4.8-debian-10-r0" TEST_MARIADB_VERSION="10.7.3-focal"