1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/container/container_unit_test.go
David Calavera 907407d0b2 Modify import paths to point to the new engine-api package.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-01-06 19:48:59 -05:00

36 lines
639 B
Go

package container
import (
"testing"
"github.com/docker/docker/pkg/signal"
"github.com/docker/engine-api/types/container"
)
func TestContainerStopSignal(t *testing.T) {
c := &Container{
CommonContainer: CommonContainer{
Config: &container.Config{},
},
}
def, err := signal.ParseSignal(signal.DefaultStopSignal)
if err != nil {
t.Fatal(err)
}
s := c.StopSignal()
if s != int(def) {
t.Fatalf("Expected %v, got %v", def, s)
}
c = &Container{
CommonContainer: CommonContainer{
Config: &container.Config{StopSignal: "SIGKILL"},
},
}
s = c.StopSignal()
if s != 9 {
t.Fatalf("Expected 9, got %v", s)
}
}