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)