summaryrefslogtreecommitdiff
path: root/pkg/hooks/hooks_test.go
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2018-05-30 13:44:38 -0700
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-31 14:11:52 +0000
commit7c1434c2f7fd4e8922f3feb1e5babe2b9804cce9 (patch)
treea5b77e968efe8a74799d6e474f9c2b892ea00c58 /pkg/hooks/hooks_test.go
parent7c6034e161abf4b70fb0409718cc5aa8cd83cc88 (diff)
downloadpodman-7c1434c2f7fd4e8922f3feb1e5babe2b9804cce9.tar.gz
podman-7c1434c2f7fd4e8922f3feb1e5babe2b9804cce9.tar.bz2
podman-7c1434c2f7fd4e8922f3feb1e5babe2b9804cce9.zip
hooks: Allow local control of OCI stages via extensionStages
This allows callers to avoid delegating to OCI runtimes for cases where they feel that the runtime hook handling is unreliable [1]. [1]: https://github.com/projectatomic/libpod/issues/730#issuecomment-392959938 Signed-off-by: W. Trevor King <wking@tremily.us> Closes: #855 Approved by: rhatdan
Diffstat (limited to 'pkg/hooks/hooks_test.go')
-rw-r--r--pkg/hooks/hooks_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/hooks/hooks_test.go b/pkg/hooks/hooks_test.go
index 1b0703556..8bd89f56f 100644
--- a/pkg/hooks/hooks_test.go
+++ b/pkg/hooks/hooks_test.go
@@ -190,10 +190,10 @@ func TestExtensionStage(t *testing.T) {
When: current.When{
Always: &always,
},
- Stages: []string{"prestart", "a", "b"},
+ Stages: []string{"prestart", "poststop", "a", "b"},
},
},
- extensionStages: []string{"a", "b", "c"},
+ extensionStages: []string{"poststop", "a", "b", "c"},
}
config := &rspec.Spec{}
@@ -211,6 +211,11 @@ func TestExtensionStage(t *testing.T) {
}, config.Hooks)
assert.Equal(t, map[string][]rspec.Hook{
+ "poststop": {
+ {
+ Path: "/a/b/c",
+ },
+ },
"a": {
{
Path: "/a/b/c",