diff options
author | Qi Wang <qiwan@redhat.com> | 2020-09-21 18:10:36 -0400 |
---|---|---|
committer | Qi Wang <qiwan@redhat.com> | 2020-12-11 14:15:56 -0500 |
commit | 6730556e2f6f98a2eef6914ffadabf8a46aef749 (patch) | |
tree | 5101540d3211e73855e87532432224cda9b22d30 /test | |
parent | b0a287ce46ee8326d25efc1e3b9d690eb1e1bbab (diff) | |
download | podman-6730556e2f6f98a2eef6914ffadabf8a46aef749.tar.gz podman-6730556e2f6f98a2eef6914ffadabf8a46aef749.tar.bz2 podman-6730556e2f6f98a2eef6914ffadabf8a46aef749.zip |
Sign multi-arch images
podman image sign handles muti-arch images.
--all option to create signature for each manifest from the image manifest list.
Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/image_sign_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/e2e/image_sign_test.go b/test/e2e/image_sign_test.go index c9041eaba..57739419c 100644 --- a/test/e2e/image_sign_test.go +++ b/test/e2e/image_sign_test.go @@ -1,6 +1,7 @@ package integration import ( + "io/ioutil" "os" "os/exec" "path/filepath" @@ -58,4 +59,19 @@ var _ = Describe("Podman image sign", func() { _, err = os.Stat(filepath.Join(sigDir, "library")) Expect(err).To(BeNil()) }) + + It("podman sign --all multi-arch image", func() { + cmd := exec.Command("gpg", "--import", "sign/secret-key.asc") + err := cmd.Run() + Expect(err).To(BeNil()) + sigDir := filepath.Join(podmanTest.TempDir, "test-sign-multi") + err = os.MkdirAll(sigDir, os.ModePerm) + Expect(err).To(BeNil()) + session := podmanTest.Podman([]string{"image", "sign", "--all", "--directory", sigDir, "--sign-by", "foo@bar.com", "docker://library/alpine"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + fInfos, err := ioutil.ReadDir(filepath.Join(sigDir, "library")) + Expect(err).To(BeNil()) + Expect(len(fInfos) > 1).To(BeTrue()) + }) }) |