6bb0d181 |
package container
import (
"testing"
"github.com/docker/docker/pkg/signal" |
907407d0 |
"github.com/docker/engine-api/types/container" |
6bb0d181 |
)
func TestContainerStopSignal(t *testing.T) {
c := &Container{
CommonContainer: CommonContainer{ |
7ac4232e |
Config: &container.Config{}, |
6bb0d181 |
},
}
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{ |
7ac4232e |
Config: &container.Config{StopSignal: "SIGKILL"}, |
6bb0d181 |
},
}
s = c.StopSignal()
if s != 9 {
t.Fatalf("Expected 9, got %v", s)
}
} |