Merge pull request #72455 from rojkov/test-e2e-node-gke

e2e-node-tests: fix path to system specs
pull/564/head
Kubernetes Prow Robot 2019-01-11 03:30:37 -08:00 committed by GitHub
commit e44330dfab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 55 additions and 12 deletions

View File

@ -205,6 +205,7 @@ filegroup(
"//test/e2e_node/runner/local:all-srcs", "//test/e2e_node/runner/local:all-srcs",
"//test/e2e_node/runner/remote:all-srcs", "//test/e2e_node/runner/remote:all-srcs",
"//test/e2e_node/services:all-srcs", "//test/e2e_node/services:all-srcs",
"//test/e2e_node/system:all-srcs",
], ],
tags = ["automanaged"], tags = ["automanaged"],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],

View File

@ -20,6 +20,7 @@ go_library(
deps = [ deps = [
"//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library",
"//test/e2e_node/builder:go_default_library", "//test/e2e_node/builder:go_default_library",
"//test/e2e_node/system:go_default_library",
"//test/utils:go_default_library", "//test/utils:go_default_library",
"//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/klog:go_default_library",
], ],

View File

@ -27,13 +27,10 @@ import (
"k8s.io/klog" "k8s.io/klog"
"k8s.io/kubernetes/test/e2e_node/builder" "k8s.io/kubernetes/test/e2e_node/builder"
"k8s.io/kubernetes/test/e2e_node/system"
"k8s.io/kubernetes/test/utils" "k8s.io/kubernetes/test/utils"
) )
const (
systemSpecPath = "k8s.io/kubernetes/cmd/kubeadm/app/util/system/specs"
)
// NodeE2ERemote contains the specific functions in the node e2e test suite. // NodeE2ERemote contains the specific functions in the node e2e test suite.
type NodeE2ERemote struct{} type NodeE2ERemote struct{}
@ -75,7 +72,7 @@ func (n *NodeE2ERemote) SetupTestPackage(tardir, systemSpecName string) error {
if systemSpecName != "" { if systemSpecName != "" {
// Copy system spec file // Copy system spec file
source := filepath.Join(rootDir, systemSpecPath, systemSpecName+".yaml") source := filepath.Join(rootDir, system.SystemSpecPath, systemSpecName+".yaml")
if _, err := os.Stat(source); err != nil { if _, err := os.Stat(source); err != nil {
return fmt.Errorf("failed to locate system spec %q: %v", source, err) return fmt.Errorf("failed to locate system spec %q: %v", source, err)
} }

View File

@ -17,6 +17,7 @@ go_library(
importpath = "k8s.io/kubernetes/test/e2e_node/runner/local", importpath = "k8s.io/kubernetes/test/e2e_node/runner/local",
deps = [ deps = [
"//test/e2e_node/builder:go_default_library", "//test/e2e_node/builder:go_default_library",
"//test/e2e_node/system:go_default_library",
"//test/utils:go_default_library", "//test/utils:go_default_library",
"//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/klog:go_default_library",
], ],

View File

@ -25,6 +25,7 @@ import (
"strings" "strings"
"k8s.io/kubernetes/test/e2e_node/builder" "k8s.io/kubernetes/test/e2e_node/builder"
"k8s.io/kubernetes/test/e2e_node/system"
"k8s.io/kubernetes/test/utils" "k8s.io/kubernetes/test/utils"
"k8s.io/klog" "k8s.io/klog"
@ -33,11 +34,7 @@ import (
var buildDependencies = flag.Bool("build-dependencies", true, "If true, build all dependencies.") 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 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 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 k8s.io/kubernetes/cmd/kubeadm/app/util/system/specs/. If unspecified, the default built-in spec (system.DefaultSpec) will be used.") var systemSpecName = flag.String("system-spec-name", "", fmt.Sprintf("The name of the system spec used for validating the image in the node conformance test. The specs are at %s. If unspecified, the default built-in spec (system.DefaultSpec) will be used.", system.SystemSpecPath))
const (
systemSpecPath = "k8s.io/kubernetes/cmd/kubeadm/app/util/system/specs"
)
func main() { func main() {
klog.InitFlags(nil) klog.InitFlags(nil)
@ -65,7 +62,7 @@ func main() {
if err != nil { if err != nil {
klog.Fatalf("Failed to get k8s root directory: %v", err) klog.Fatalf("Failed to get k8s root directory: %v", err)
} }
systemSpecFile := filepath.Join(rootDir, systemSpecPath, *systemSpecName+".yaml") systemSpecFile := filepath.Join(rootDir, system.SystemSpecPath, *systemSpecName+".yaml")
args = append(args, fmt.Sprintf("--system-spec-name=%s --system-spec-file=%s", *systemSpecName, systemSpecFile)) args = append(args, fmt.Sprintf("--system-spec-name=%s --system-spec-file=%s", *systemSpecName, systemSpecFile))
} }
if err := runCommand(ginkgo, args...); err != nil { if err := runCommand(ginkgo, args...); err != nil {

View File

@ -17,6 +17,7 @@ go_library(
importpath = "k8s.io/kubernetes/test/e2e_node/runner/remote", importpath = "k8s.io/kubernetes/test/e2e_node/runner/remote",
deps = [ deps = [
"//test/e2e_node/remote:go_default_library", "//test/e2e_node/remote:go_default_library",
"//test/e2e_node/system:go_default_library",
"//vendor/github.com/pborman/uuid:go_default_library", "//vendor/github.com/pborman/uuid:go_default_library",
"//vendor/golang.org/x/oauth2:go_default_library", "//vendor/golang.org/x/oauth2:go_default_library",
"//vendor/golang.org/x/oauth2/google:go_default_library", "//vendor/golang.org/x/oauth2/google:go_default_library",

View File

@ -36,6 +36,7 @@ import (
"time" "time"
"k8s.io/kubernetes/test/e2e_node/remote" "k8s.io/kubernetes/test/e2e_node/remote"
"k8s.io/kubernetes/test/e2e_node/system"
"github.com/pborman/uuid" "github.com/pborman/uuid"
"golang.org/x/oauth2" "golang.org/x/oauth2"
@ -61,7 +62,7 @@ var buildOnly = flag.Bool("build-only", false, "If true, build e2e_node_test.tar
var instanceMetadata = flag.String("instance-metadata", "", "key/value metadata for instances separated by '=' or '<', 'k=v' means the key is 'k' and the value is 'v'; 'k<p' means the key is 'k' and the value is extracted from the local path 'p', e.g. k1=v1,k2<p2") var instanceMetadata = flag.String("instance-metadata", "", "key/value metadata for instances separated by '=' or '<', 'k=v' means the key is 'k' and the value is 'v'; 'k<p' means the key is 'k' and the value is extracted from the local path 'p', e.g. k1=v1,k2<p2")
var gubernator = flag.Bool("gubernator", false, "If true, output Gubernator link to view logs") var gubernator = flag.Bool("gubernator", false, "If true, output Gubernator link to view logs")
var ginkgoFlags = flag.String("ginkgo-flags", "", "Passed to ginkgo to specify additional flags such as --skip=.") var ginkgoFlags = flag.String("ginkgo-flags", "", "Passed to ginkgo to specify additional flags such as --skip=.")
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 k8s.io/kubernetes/cmd/kubeadm/app/util/system/specs/. If unspecified, the default built-in spec (system.DefaultSpec) will be used.") var systemSpecName = flag.String("system-spec-name", "", fmt.Sprintf("The name of the system spec used for validating the image in the node conformance test. The specs are at %s. If unspecified, the default built-in spec (system.DefaultSpec) will be used.", system.SystemSpecPath))
// envs is the type used to collect all node envs. The key is the env name, // envs is the type used to collect all node envs. The key is the env name,
// and the value is the env value // and the value is the env value

View File

@ -0,0 +1,22 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["specs.go"],
importpath = "k8s.io/kubernetes/test/e2e_node/system",
visibility = ["//visibility:public"],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,22 @@
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package system
const (
// SystemSpecPath is a path to spec files used for performing node conformance tests.
SystemSpecPath = "test/e2e_node/system/specs"
)