k8s.io/kubernetes@v1.29.3/test/e2e_node/runner/remote/run_remote.go (about)

     1  /*
     2  Copyright 2016 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  // To run the node e2e tests remotely against one or more hosts on gce:
    18  // $ go run run_remote.go --v 2 --ssh-env gce --hosts <comma separated hosts>
    19  // To run the node e2e tests remotely against one or more images on gce and provision them:
    20  // $ go run run_remote.go --v 2 --project <project> --zone <zone> --ssh-env gce --images <comma separated images>
    21  package main
    22  
    23  import (
    24  	"flag"
    25  	"fmt"
    26  
    27  	"k8s.io/klog/v2"
    28  
    29  	"k8s.io/kubernetes/test/e2e_node/remote"
    30  	_ "k8s.io/kubernetes/test/e2e_node/remote/gce"
    31  	"k8s.io/kubernetes/test/e2e_node/system"
    32  )
    33  
    34  var testSuite = flag.String("test-suite", "default", "Test suite the runner initializes with. Currently support default|cadvisor|conformance")
    35  var _ = 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))
    36  var _ = flag.String("extra-envs", "", "The extra environment variables needed for node e2e tests. Format: a list of key=value pairs, e.g., env1=val1,env2=val2")
    37  var _ = flag.String("runtime-config", "", "The runtime configuration for the API server on the node e2e tests.. Format: a list of key=value pairs, e.g., env1=val1,env2=val2")
    38  var _ = flag.String("kubelet-config-file", "", "The KubeletConfiguration file that should be applied to the kubelet")
    39  
    40  func main() {
    41  	klog.InitFlags(nil)
    42  	flag.Parse()
    43  
    44  	suite, err := remote.GetTestSuite(*testSuite)
    45  	if err != nil {
    46  		klog.Fatalf("error looking up testsuite [%v] - registered test suites [%v]",
    47  			err,
    48  			remote.GetTestSuiteKeys())
    49  	}
    50  	remote.RunRemoteTestSuite(suite)
    51  }