Add test verify container ID

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 76a19bb3a95ef788cd889b36b0af3b79327ff431
Component: engine
This commit is contained in:
Michael Crosby
2014-04-18 01:58:20 +00:00
parent 7884c9309e
commit fa56c6f0d6
2 changed files with 24 additions and 22 deletions

View File

@ -16,28 +16,6 @@ import (
"time"
)
func TestIDFormat(t *testing.T) {
daemon := mkDaemon(t)
defer nuke(daemon)
container1, _, err := daemon.Create(
&runconfig.Config{
Image: GetTestImage(daemon).ID,
Cmd: []string{"/bin/sh", "-c", "echo hello world"},
},
"",
)
if err != nil {
t.Fatal(err)
}
match, err := regexp.Match("^[0-9a-f]{64}$", []byte(container1.ID))
if err != nil {
t.Fatal(err)
}
if !match {
t.Fatalf("Invalid container ID: %s", container1.ID)
}
}
func TestMultipleAttachRestart(t *testing.T) {
daemon := mkDaemon(t)
defer nuke(daemon)