Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
canercidam committed Jan 10, 2024
1 parent 4ba4519 commit 8ef77cd
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ var (
processStartWaitSeconds = 60
pushImageRef = "localhost:1970/test"

expectedImageSha = "35ff92bfc7e822eab96fe3d712164f6b547c3acffc8691b80528d334283849ab"
expectedImageCid = "bafybeihfub2ktzp6a77zrihiwf6c2hex3nwxd7zl7u6tj3ueu5kstqk4ii"
expectedImageSha = "35ff92bfc7e822eab96fe3d712164f6b547c3acffc8691b80528d334283849ab"

expectedImageCidCacheOnly = "bafybeibv76jl7r7ielvls37d24jbmt3lkr6dvt74q2i3qbji2m2cqocjvm"

unexpectedImageCid = "bafybeielvnt5apaxbk6chthc4dc3p6vscpx3ai4uvti7gwh253j7facsxu"
Expand All @@ -42,8 +42,6 @@ var (
expectedLayerBlob2 = "/docker/registry/v2/blobs/sha256/d9/d96e79a5881296813985815a1fa73e2441e72769541b1fb32a0e14f2acf4d659/data"

expectedCidTagCacheOnly = path.Join(reposPath, expectedImageSha, "_manifests", "tags", expectedImageCidCacheOnly)

cidImageRef = path.Join("localhost:1970", expectedImageCid)
)

type E2ETestSuite struct {
Expand Down Expand Up @@ -202,12 +200,14 @@ func (s *E2ETestSuite) TestPurgeIPFS_Pull() {
s.startDisco("./disco-e2e-config.yml")

s.r.NoError(exec.Command("docker", "push", pushImageRef).Run())
imageCid := getImageCid()
imageCidPullRef := getImagePullRef(imageCid)

// delete from ipfs (primary store)
s.startCleanIpfs()

// pull
s.r.NoError(exec.Command("docker", "pull", cidImageRef).Run())
s.r.NoError(exec.Command("docker", "pull", imageCidPullRef).Run())

// it was able to pull without needing ipfs
_, err := s.ipfsClient1.FilesStat(context.Background(), "/docker")
Expand All @@ -218,6 +218,8 @@ func (s *E2ETestSuite) TestPurgeIPFS_PushAgainPull() {
s.startDisco("./disco-e2e-config.yml")

s.r.NoError(exec.Command("docker", "push", pushImageRef).Run())
imageCid := getImageCid()
imageCidPullRef := getImagePullRef(imageCid)

// delete from ipfs (primary store)
s.startCleanIpfs()
Expand All @@ -227,25 +229,29 @@ func (s *E2ETestSuite) TestPurgeIPFS_PushAgainPull() {

s.verifyFiles()

s.r.NoError(exec.Command("docker", "pull", cidImageRef).Run())
s.r.NoError(exec.Command("docker", "pull", imageCidPullRef).Run())
}

func (s *E2ETestSuite) TestPurgeCache_Pull() {
s.startDisco("./disco-e2e-config.yml")

s.r.NoError(exec.Command("docker", "push", pushImageRef).Run())
imageCid := getImageCid()
imageCidPullRef := getImagePullRef(imageCid)

// delete from filestore (secondary store)
s.r.NoError(os.RemoveAll("testdir/cache"))

// pull
s.r.NoError(exec.Command("docker", "pull", cidImageRef).Run())
s.r.NoError(exec.Command("docker", "pull", imageCidPullRef).Run())
}

func (s *E2ETestSuite) TestPurgeCache_PushAgainPull() {
s.startDisco("./disco-e2e-config.yml")

s.r.NoError(exec.Command("docker", "push", pushImageRef).Run())
imageCid := getImageCid()
imageCidPullRef := getImagePullRef(imageCid)

// delete from filestore (secondary store)
s.r.NoError(os.RemoveAll("testdir/cache"))
Expand All @@ -255,19 +261,21 @@ func (s *E2ETestSuite) TestPurgeCache_PushAgainPull() {

s.verifyFiles()

s.r.NoError(exec.Command("docker", "pull", cidImageRef).Run())
s.r.NoError(exec.Command("docker", "pull", imageCidPullRef).Run())
}

func (s *E2ETestSuite) TestPurgeCache_MissingCidRepo() {
s.startDisco("./disco-e2e-config.yml")

s.r.NoError(exec.Command("docker", "push", pushImageRef).Run())
imageCid := getImageCid()
imageCidPullRef := getImagePullRef(imageCid)

// delete the cid repo from filestore (secondary store)
s.r.NoError(os.RemoveAll(path.Join("testdir/cache/docker/registry/v2/repositories", expectedImageCid)))
s.r.NoError(os.RemoveAll(path.Join("testdir/cache/docker/registry/v2/repositories", imageCid)))

// pull should replicate
s.r.NoError(exec.Command("docker", "pull", cidImageRef).Run())
s.r.NoError(exec.Command("docker", "pull", imageCidPullRef).Run())

s.verifyFiles()
}
Expand Down

0 comments on commit 8ef77cd

Please sign in to comment.