Supports customized system spec in the node conformance test and creates the GKE system spec

This commit is contained in:
Yang Guo
2017-06-02 17:00:46 -07:00
parent cb712e41d4
commit 22c9e23202
18 changed files with 452 additions and 63 deletions

View File

@@ -18,6 +18,7 @@ package main
import (
"flag"
"fmt"
"os"
"os/exec"
"path/filepath"
@@ -31,6 +32,11 @@ import (
var buildDependencies = flag.Bool("build-dependencies", true, "If true, build all dependencies.")
var ginkgoFlags = flag.String("ginkgo-flags", "", "Space-separated list of arguments to pass to Ginkgo test runner.")
var testFlags = flag.String("test-flags", "", "Space-separated list of arguments to pass to node e2e test.")
var systemSpecName = flag.String("system-spec-name", "", "The name of the system spec used for validating the image in the node conformance test. The specs are at test/e2e_node/system/specs/. If unspecified, the default built-in spec (system.DefaultSpec) will be used.")
const (
systemSpecPath = "test/e2e_node/system/specs"
)
func main() {
flag.Parse()
@@ -50,7 +56,17 @@ func main() {
glog.Infof("Got build output dir: %v", outputDir)
ginkgo := filepath.Join(outputDir, "ginkgo")
test := filepath.Join(outputDir, "e2e_node.test")
runCommand(ginkgo, *ginkgoFlags, test, "--", *testFlags)
if *systemSpecName == "" {
runCommand(ginkgo, *ginkgoFlags, test, "--", *testFlags)
return
}
rootDir, err := builder.GetK8sRootDir()
if err != nil {
glog.Fatalf("Failed to get k8s root directory: %v", err)
}
systemSpecFile := filepath.Join(rootDir, systemSpecPath, *systemSpecName+".yaml")
runCommand(ginkgo, *ginkgoFlags, test, "--", fmt.Sprintf("--system-spec-file=%s", systemSpecFile), *testFlags)
return
}