0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

sync: fix inconsistent test

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
Petu Eusebiu 2022-03-31 14:15:51 +03:00 committed by Ramkumar Chinchani
parent 554e99a967
commit 03dd558ec6

View file

@ -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)