From 03dd558ec68e87a7adb9088a9f8c15f039e41be5 Mon Sep 17 00:00:00 2001 From: Petu Eusebiu Date: Thu, 31 Mar 2022 14:15:51 +0300 Subject: [PATCH] sync: fix inconsistent test Signed-off-by: Petu Eusebiu --- pkg/extensions/sync/sync_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/extensions/sync/sync_test.go b/pkg/extensions/sync/sync_test.go index 30d744df..a4c5e546 100644 --- a/pkg/extensions/sync/sync_test.go +++ b/pkg/extensions/sync/sync_test.go @@ -609,6 +609,14 @@ func TestOnDemandPermsDenied(t *testing.T) { dctlr.Shutdown() }() + syncSubDir := path.Join(destDir, testImage, sync.SyncBlobUploadDir) + + err := os.MkdirAll(syncSubDir, 0o755) + So(err, ShouldBeNil) + + err = os.Chmod(syncSubDir, 0o000) + So(err, ShouldBeNil) + go func() { // this blocks if err := dctlr.Run(context.Background()); err != nil { @@ -618,14 +626,6 @@ func TestOnDemandPermsDenied(t *testing.T) { test.WaitTillServerReady(destBaseURL) - syncSubDir := path.Join(destDir, testImage, sync.SyncBlobUploadDir) - - err := os.MkdirAll(syncSubDir, 0o755) - So(err, ShouldBeNil) - - err = os.Chmod(syncSubDir, 0o000) - So(err, ShouldBeNil) - resp, err := resty.R().Get(destBaseURL + "/v2/" + testImage + "/manifests/" + testImageTag) So(err, ShouldBeNil) So(resp.StatusCode(), ShouldEqual, 404)