Port the downward api test to the node e2e suite

Also extend the framework to allow a custom client config loading function, so
that the node e2e suite can reuse the same framework across tests.
This commit is contained in:
Yu-Ju Hong
2016-06-03 18:10:33 -07:00
parent 525140a278
commit a6a3ed210c
5 changed files with 191 additions and 16 deletions

View File

@@ -19,8 +19,8 @@ package e2e_node
import (
"flag"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/restclient"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/test/e2e/framework"
)
@@ -32,9 +32,17 @@ var startServices = flag.Bool("start-services", true, "If true, start local node
var stopServices = flag.Bool("stop-services", true, "If true, stop local node services after running tests")
func NewDefaultFramework(baseName string) *framework.Framework {
client := client.NewOrDie(&restclient.Config{Host: *apiServerAddress})
return framework.NewFramework(baseName, framework.FrameworkOptions{
ClientQPS: 100,
ClientBurst: 100,
}, client)
// Provides a client config for the framework to create a client.
f := func() (*restclient.Config, error) {
return &restclient.Config{Host: *apiServerAddress}, nil
}
return framework.NewFrameworkWithConfigGetter(baseName,
framework.FrameworkOptions{
ClientQPS: 100,
ClientBurst: 100,
}, nil, f)
}
func assignPodToNode(pod *api.Pod) {
pod.Spec.NodeName = *nodeName
}