mirror of
https://github.com/containers/podman.git
synced 2025-10-14 01:35:29 +08:00
Add hooks support to podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #155 Approved by: mheon
This commit is contained in:

committed by
Atomic Bot

parent
ca3b241451
commit
fdcf633a33
@ -6,6 +6,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/mrunalp/fileutils"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
@ -217,6 +218,19 @@ var _ = Describe("Podman run", func() {
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman test hooks", func() {
|
||||
hcheck := "/run/hookscheck"
|
||||
hooksDir := "/tmp/hooks"
|
||||
os.Mkdir(hooksDir, 0755)
|
||||
fileutils.CopyFile("hooks/hooks.json", hooksDir)
|
||||
os.Setenv("HOOK_OPTION", fmt.Sprintf("--hooks-dir-path=%s", hooksDir))
|
||||
os.Remove(hcheck)
|
||||
session := podmanTest.Podman([]string{"run", ALPINE, "ls"})
|
||||
session.Wait(10)
|
||||
os.Unsetenv("HOOK_OPTION")
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman run with secrets", func() {
|
||||
containersDir := "/usr/share/containers"
|
||||
err := os.MkdirAll(containersDir, 0755)
|
||||
|
Reference in New Issue
Block a user