mirror of
https://github.com/clearlinux/docker.git
synced 2026-08-21 13:18:00 +00: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:
committed by
Victor Vieux
parent
e6e6d89cc1
commit
1db7cb2f01
@@ -71,12 +71,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 {
|
||||
@@ -635,12 +635,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
@@ -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) {
|
||||
|
||||
@@ -325,7 +325,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 {
|
||||
|
||||
+2
-13
@@ -239,23 +239,12 @@ func TestRuntimeCreate(t *testing.T) {
|
||||
Cmd: []string{"/bin/ls"},
|
||||
PortSpecs: []string{"80"},
|
||||
}
|
||||
container, err = runtime.Create(config)
|
||||
container, _, err = runtime.Create(config)
|
||||
|
||||
image, err := runtime.Commit(container, "testrepo", "testtag", "", "", config)
|
||||
_, err = runtime.Commit(container, "testrepo", "testtag", "", "", config)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
_, err = runtime.Create(
|
||||
&Config{
|
||||
Image: image.ID,
|
||||
PortSpecs: []string{"80000:80"},
|
||||
},
|
||||
)
|
||||
if err == nil {
|
||||
t.Fatal("Builder.Create should throw an error when PortSpecs is invalid")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestDestroy(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user