mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Updated fixes post rebase from master
Removed test cases that are no longer applicable with links and the port changes. Remove test case where a test was hitting an external ip.
This commit is contained in:
parent
db99966724
commit
0e24db3a68
3 changed files with 5 additions and 27 deletions
12
api.go
12
api.go
|
@ -74,12 +74,12 @@ func httpError(w http.ResponseWriter, err error) {
|
|||
statusCode = http.StatusUnauthorized
|
||||
} else if strings.Contains(err.Error(), "hasn't been activated") {
|
||||
statusCode = http.StatusForbidden
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
utils.Errorf("HTTP Error: statusCode=%d %s", statusCode, err.Error())
|
||||
http.Error(w, err.Error(), statusCode)
|
||||
}
|
||||
http.Error(w, err.Error(), statusCode)
|
||||
}
|
||||
}
|
||||
|
||||
func writeJSON(w http.ResponseWriter, code int, v interface{}) error {
|
||||
|
@ -653,12 +653,8 @@ func postContainersStart(srv *Server, version float64, w http.ResponseWriter, r
|
|||
if vars == nil {
|
||||
return fmt.Errorf("Missing parameter")
|
||||
}
|
||||
var err error
|
||||
name := vars["name"]
|
||||
name = decodeName(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := srv.ContainerStart(name, hostConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -410,7 +410,7 @@ func TestOutput(t *testing.T) {
|
|||
func TestContainerNetwork(t *testing.T) {
|
||||
runtime := mkRuntime(t)
|
||||
defer nuke(runtime)
|
||||
container, err := runtime.Create(
|
||||
container, _, err := runtime.Create(
|
||||
&Config{
|
||||
Image: GetTestImage(runtime).ID,
|
||||
Cmd: []string{"ping", "-c", "1", "127.0.0.1"},
|
||||
|
@ -426,23 +426,6 @@ func TestContainerNetwork(t *testing.T) {
|
|||
if container.State.ExitCode != 0 {
|
||||
t.Errorf("Unexpected ping 127.0.0.1 exit code %d (expected 0)", container.State.ExitCode)
|
||||
}
|
||||
|
||||
container, err = runtime.Create(
|
||||
&Config{
|
||||
Image: GetTestImage(runtime).ID,
|
||||
Cmd: []string{"ping", "-c", "1", "8.8.8.8"},
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer runtime.Destroy(container)
|
||||
if err := container.Run(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if container.State.ExitCode != 0 {
|
||||
t.Errorf("Unexpected ping 8.8.8.8 exit code %d (expected 0)", container.State.ExitCode)
|
||||
}
|
||||
}
|
||||
|
||||
func TestKillDifferentUser(t *testing.T) {
|
||||
|
|
|
@ -324,7 +324,6 @@ func (runtime *Runtime) Create(config *Config) (*Container, []string, error) {
|
|||
if err := MergeConfig(config, img.Config); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(config.Entrypoint) != 0 && config.Cmd == nil {
|
||||
|
|
Loading…
Reference in a new issue