summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/api/handlers/compat/containers.go3
-rw-r--r--test/apiv2/20-containers.at8
2 files changed, 7 insertions, 4 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go
index 3a904ba87..637d296e7 100644
--- a/pkg/api/handlers/compat/containers.go
+++ b/pkg/api/handlers/compat/containers.go
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
+ "strconv"
"strings"
"syscall"
@@ -385,7 +386,7 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON,
MacAddress: "",
OnBuild: nil,
Labels: l.Labels(),
- StopSignal: string(l.StopSignal()),
+ StopSignal: strconv.Itoa(int(l.StopSignal())),
StopTimeout: &stopTimeout,
Shell: nil,
}
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index 15b5dc4be..28289955a 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -216,12 +216,14 @@ t GET containers/$cid/json 200 \
.Config.WorkingDir="/data" # default is /data
t DELETE containers/$cid 204
-# test the WORKDIR
-t POST containers/create '"Image":"'$ENV_WORKDIR_IMG'","WorkingDir":"/dataDir"' 201 \
+# test the WORKDIR and StopSignal
+t POST containers/create '"Image":"'$ENV_WORKDIR_IMG'","WorkingDir":"/dataDir","StopSignal":"9"' 201 \
.Id~[0-9a-f]\\{64\\}
cid=$(jq -r '.Id' <<<"$output")
t GET containers/$cid/json 200 \
- .Config.WorkingDir="/dataDir"
+ .Config.WorkingDir="/dataDir" \
+ .Config.StopSignal="9"
+
t DELETE containers/$cid 204
# vim: filetype=sh