summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/e2e/info_test.go2
-rw-r--r--test/e2e/play_kube_test.go11
-rw-r--r--test/e2e/untag_test.go73
3 files changed, 80 insertions, 6 deletions
diff --git a/test/e2e/info_test.go b/test/e2e/info_test.go
index d3b1b974e..d16661d5b 100644
--- a/test/e2e/info_test.go
+++ b/test/e2e/info_test.go
@@ -1,5 +1,3 @@
-// +build !remoteclient
-
package integration
import (
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index 29c60d7ac..89a5eddf4 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -358,10 +358,11 @@ var _ = Describe("Podman generate kube", func() {
ctrAnnotation := "container.seccomp.security.alpha.kubernetes.io/" + defaultCtrName
ctr := getCtr(withCmd([]string{"pwd"}))
- err = generateKubeYaml(getPod(withCtr(ctr), withAnnotation(ctrAnnotation, "localhost:"+jsonFile)), kubeYaml)
+ err = generateKubeYaml(getPod(withCtr(ctr), withAnnotation(ctrAnnotation, "localhost/"+filepath.Base(jsonFile))), kubeYaml)
Expect(err).To(BeNil())
- kube := podmanTest.Podman([]string{"play", "kube", kubeYaml})
+ // CreateSeccompJson will put the profile into podmanTest.TempDir. Use --seccomp-profile-root to tell play kube where to look
+ kube := podmanTest.Podman([]string{"play", "kube", "--seccomp-profile-root", podmanTest.TempDir, kubeYaml})
kube.WaitWithDefaultTimeout()
Expect(kube.ExitCode()).To(Equal(0))
@@ -378,13 +379,15 @@ var _ = Describe("Podman generate kube", func() {
fmt.Println(err)
Skip("Failed to prepare seccomp.json for test.")
}
+ defer os.Remove(jsonFile)
ctr := getCtr(withCmd([]string{"pwd"}))
- err = generateKubeYaml(getPod(withCtr(ctr), withAnnotation("seccomp.security.alpha.kubernetes.io/pod", "localhost:"+jsonFile)), kubeYaml)
+ err = generateKubeYaml(getPod(withCtr(ctr), withAnnotation("seccomp.security.alpha.kubernetes.io/pod", "localhost/"+filepath.Base(jsonFile))), kubeYaml)
Expect(err).To(BeNil())
- kube := podmanTest.Podman([]string{"play", "kube", kubeYaml})
+ // CreateSeccompJson will put the profile into podmanTest.TempDir. Use --seccomp-profile-root to tell play kube where to look
+ kube := podmanTest.Podman([]string{"play", "kube", "--seccomp-profile-root", podmanTest.TempDir, kubeYaml})
kube.WaitWithDefaultTimeout()
Expect(kube.ExitCode()).To(Equal(0))
diff --git a/test/e2e/untag_test.go b/test/e2e/untag_test.go
new file mode 100644
index 000000000..17171cd41
--- /dev/null
+++ b/test/e2e/untag_test.go
@@ -0,0 +1,73 @@
+package integration
+
+import (
+ "os"
+
+ . "github.com/containers/libpod/test/utils"
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+)
+
+var _ = Describe("Podman untag", func() {
+ var (
+ tempdir string
+ err error
+ podmanTest *PodmanTestIntegration
+ )
+
+ BeforeEach(func() {
+ tempdir, err = CreateTempDirInTempDir()
+ if err != nil {
+ os.Exit(1)
+ }
+ podmanTest = PodmanTestCreate(tempdir)
+ podmanTest.Setup()
+ podmanTest.RestoreAllArtifacts()
+
+ for _, tag := range []string{"test", "foo", "bar"} {
+ session := podmanTest.PodmanNoCache([]string{"tag", ALPINE, tag})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ }
+
+ })
+
+ AfterEach(func() {
+ podmanTest.Cleanup()
+ f := CurrentGinkgoTestDescription()
+ processTestResult(f)
+
+ })
+
+ It("podman untag all", func() {
+ session := podmanTest.PodmanNoCache([]string{"untag", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ results := podmanTest.PodmanNoCache([]string{"images", ALPINE})
+ results.WaitWithDefaultTimeout()
+ Expect(results.ExitCode()).To(Equal(0))
+ Expect(results.OutputToStringArray()).To(HaveLen(1))
+ })
+
+ It("podman untag single", func() {
+ session := podmanTest.PodmanNoCache([]string{"untag", ALPINE, "localhost/test:latest"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ results := podmanTest.PodmanNoCache([]string{"images"})
+ results.WaitWithDefaultTimeout()
+ Expect(results.ExitCode()).To(Equal(0))
+ Expect(results.OutputToStringArray()).To(HaveLen(5))
+ Expect(results.LineInOuputStartsWith("docker.io/library/alpine")).To(BeTrue())
+ Expect(results.LineInOuputStartsWith("localhost/foo")).To(BeTrue())
+ Expect(results.LineInOuputStartsWith("localhost/bar")).To(BeTrue())
+ Expect(results.LineInOuputStartsWith("localhost/test")).To(BeFalse())
+ })
+
+ It("podman untag not enough arguments", func() {
+ session := podmanTest.PodmanNoCache([]string{"untag"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).NotTo(Equal(0))
+ })
+})