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.
Upstream-commit: 0e24db3a68cabed1ff8cf8dd10854c5de201329f
Component: engine
This commit is contained in:
Michael Crosby
2013-10-25 15:13:24 -07:00
committed by Victor Vieux
parent 69a28976c0
commit dab2931cd1
3 changed files with 5 additions and 27 deletions
+4 -8
View File
@@ -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
}
+1 -18
View File
@@ -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) {
-1
View File
@@ -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 {