Last three tests skip on lxc.

Now we can scale lxc tests to all PRs.

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <hugs@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 321874f37672b2424a7609caa1aac616b3b23c6a
Component: engine
This commit is contained in:
Jessica Frazelle
2015-02-25 20:16:44 -08:00
parent 36f1975bfd
commit 55588c146b
6 changed files with 43 additions and 12 deletions

View File

@ -1,8 +1,11 @@
package main
import (
"encoding/json"
"fmt"
"log"
"os/exec"
"strings"
"testing"
)
@ -15,6 +18,8 @@ type TestRequirement struct {
// List test requirements
var (
daemonExecDriver string
SameHostDaemon = TestRequirement{
func() bool { return isLocalDaemon },
"Test requires docker daemon to runs on the same machine as CLI",
@ -37,6 +42,30 @@ var (
},
fmt.Sprintf("Test requires an environment that can host %s in the same host", v2binary),
}
NativeExecDriver = TestRequirement{
func() bool {
if daemonExecDriver == "" {
// get daemon info
body, err := sockRequest("GET", "/info", nil)
if err != nil {
log.Fatalf("sockRequest failed for /info: %v", err)
}
type infoJSON struct {
ExecutionDriver string
}
var info infoJSON
if err = json.Unmarshal(body, &info); err != nil {
log.Fatalf("unable to unmarshal body: %v", err)
}
daemonExecDriver = info.ExecutionDriver
}
return strings.HasPrefix(daemonExecDriver, "native")
},
"Test requires the native (libcontainer) exec driver.",
}
)
// testRequires checks if the environment satisfies the requirements