From a0f922206815fd72d05593c0707ab056f58c56a7 Mon Sep 17 00:00:00 2001 From: Daniele Rondina Date: Tue, 24 Mar 2020 14:01:22 +0100 Subject: [PATCH] Add check of repository metafile archive in tests --- pkg/installer/installer_test.go | 6 ++++++ pkg/installer/repository_test.go | 2 ++ 2 files changed, 8 insertions(+) diff --git a/pkg/installer/installer_test.go b/pkg/installer/installer_test.go index 7e4de3ae..f422197e 100644 --- a/pkg/installer/installer_test.go +++ b/pkg/installer/installer_test.go @@ -202,11 +202,13 @@ urls: Expect(repo.GetName()).To(Equal("test")) Expect(helpers.Exists(spec.Rel("repository.yaml"))).ToNot(BeTrue()) Expect(helpers.Exists(spec.Rel(TREE_TARBALL + ".gz"))).ToNot(BeTrue()) + Expect(helpers.Exists(spec.Rel(REPOSITORY_METAFILE + ".tar"))).ToNot(BeTrue()) err = repo.Write(tmpdir, false) Expect(err).ToNot(HaveOccurred()) Expect(helpers.Exists(spec.Rel("repository.yaml"))).To(BeTrue()) Expect(helpers.Exists(spec.Rel(TREE_TARBALL + ".gz"))).To(BeTrue()) + Expect(helpers.Exists(spec.Rel(REPOSITORY_METAFILE + ".tar"))).To(BeTrue()) Expect(repo.GetUrls()[0]).To(Equal(tmpdir)) Expect(repo.GetType()).To(Equal("disk")) @@ -310,11 +312,13 @@ urls: Expect(repo.GetName()).To(Equal("test")) Expect(helpers.Exists(spec.Rel("repository.yaml"))).ToNot(BeTrue()) Expect(helpers.Exists(spec.Rel(TREE_TARBALL + ".gz"))).ToNot(BeTrue()) + Expect(helpers.Exists(spec.Rel(REPOSITORY_METAFILE + ".tar"))).ToNot(BeTrue()) err = repo.Write(tmpdir, false) Expect(err).ToNot(HaveOccurred()) Expect(helpers.Exists(spec.Rel("repository.yaml"))).To(BeTrue()) Expect(helpers.Exists(spec.Rel(TREE_TARBALL + ".gz"))).To(BeTrue()) + Expect(helpers.Exists(spec.Rel(REPOSITORY_METAFILE + ".tar"))).To(BeTrue()) Expect(repo.GetUrls()[0]).To(Equal(tmpdir)) Expect(repo.GetType()).To(Equal("disk")) @@ -423,6 +427,7 @@ urls: Expect(repo.GetName()).To(Equal("test")) Expect(helpers.Exists(spec.Rel("repository.yaml"))).ToNot(BeTrue()) Expect(helpers.Exists(spec.Rel(TREE_TARBALL + ".gz"))).ToNot(BeTrue()) + Expect(helpers.Exists(spec.Rel(REPOSITORY_METAFILE + ".tar"))).ToNot(BeTrue()) err = repo.Write(tmpdir, false) Expect(err).ToNot(HaveOccurred()) Expect(helpers.Exists(spec.Rel("b-test-1.1.package.tar.gz"))).To(BeTrue()) @@ -430,6 +435,7 @@ urls: Expect(helpers.Exists(spec.Rel("repository.yaml"))).To(BeTrue()) Expect(helpers.Exists(spec.Rel(TREE_TARBALL + ".gz"))).To(BeTrue()) + Expect(helpers.Exists(spec.Rel(REPOSITORY_METAFILE + ".tar"))).To(BeTrue()) Expect(repo.GetUrls()[0]).To(Equal(tmpdir)) Expect(repo.GetType()).To(Equal("disk")) diff --git a/pkg/installer/repository_test.go b/pkg/installer/repository_test.go index 36bd9e1e..9414cafb 100644 --- a/pkg/installer/repository_test.go +++ b/pkg/installer/repository_test.go @@ -87,11 +87,13 @@ var _ = Describe("Repository", func() { Expect(repo.GetName()).To(Equal("test")) Expect(helpers.Exists(spec.Rel(REPOSITORY_SPECFILE))).ToNot(BeTrue()) Expect(helpers.Exists(spec.Rel(TREE_TARBALL + ".gz"))).ToNot(BeTrue()) + Expect(helpers.Exists(spec.Rel(REPOSITORY_METAFILE + ".tar"))).ToNot(BeTrue()) err = repo.Write(tmpdir, false) Expect(err).ToNot(HaveOccurred()) Expect(helpers.Exists(spec.Rel(REPOSITORY_SPECFILE))).To(BeTrue()) Expect(helpers.Exists(spec.Rel(TREE_TARBALL + ".gz"))).To(BeTrue()) + Expect(helpers.Exists(spec.Rel(REPOSITORY_METAFILE + ".tar"))).To(BeTrue()) }) }) Context("Matching packages", func() {