mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
add regression test + go fmt
This commit is contained in:
parent
f385f1860b
commit
48833c7b07
2 changed files with 24 additions and 4 deletions
|
@ -90,6 +90,27 @@ func TestCreateRm(t *testing.T) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestCommit(t *testing.T) {
|
||||||
|
runtime := mkRuntime(t)
|
||||||
|
defer nuke(runtime)
|
||||||
|
|
||||||
|
srv := &Server{runtime: runtime}
|
||||||
|
|
||||||
|
config, _, _, err := ParseRun([]string{GetTestImage(runtime).ID, "/bin/cat"}, nil)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
id, err := srv.ContainerCreate(config)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := srv.ContainerCommit(id, "testrepo", "testtag", "", "", config); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestCreateStartRestartStopStartKillRm(t *testing.T) {
|
func TestCreateStartRestartStopStartKillRm(t *testing.T) {
|
||||||
runtime := mkRuntime(t)
|
runtime := mkRuntime(t)
|
||||||
defer nuke(runtime)
|
defer nuke(runtime)
|
||||||
|
|
|
@ -615,7 +615,7 @@ type JSONMessage struct {
|
||||||
Time int64 `json:"time,omitempty"`
|
Time int64 `json:"time,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (jm *JSONMessage) Display(out io.Writer) (error) {
|
func (jm *JSONMessage) Display(out io.Writer) error {
|
||||||
if jm.Time != 0 {
|
if jm.Time != 0 {
|
||||||
fmt.Fprintf(out, "[%s] ", time.Unix(jm.Time, 0))
|
fmt.Fprintf(out, "[%s] ", time.Unix(jm.Time, 0))
|
||||||
}
|
}
|
||||||
|
@ -631,7 +631,6 @@ func (jm *JSONMessage) Display(out io.Writer) (error) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type StreamFormatter struct {
|
type StreamFormatter struct {
|
||||||
json bool
|
json bool
|
||||||
used bool
|
used bool
|
||||||
|
|
Loading…
Add table
Reference in a new issue