package testing
import "k8s.io/kubernetes/cmd/kube-apiserver/app/testing"
Index ¶
Types ¶
type TearDownFunc ¶
type TearDownFunc func()
TearDownFunc is to be called to tear down a test server.
type TestServer ¶
type TestServer struct { ClientConfig *restclient.Config // Rest client config ServerOpts *options.ServerRunOptions // ServerOpts TearDownFn TearDownFunc // TearDown function TmpDir string // Temp Dir used, by the apiserver }
TestServer return values supplied by kube-test-ApiServer
func StartTestServer ¶
func StartTestServer(t *testing.T, customFlags []string, storageConfig *storagebackend.Config) (result TestServer, err error)
StartTestServer starts a etcd server and kube-apiserver. A rest client config and a tear-down func, and location of the tmpdir are returned.
Note: we return a tear-down func instead of a stop channel because the later will leak temporariy
files that becaues Golang testing's call to os.Exit will not give a stop channel go routine enough time to remove temporariy files.
func StartTestServerOrDie ¶
func StartTestServerOrDie(t *testing.T, flags []string, storageConfig *storagebackend.Config) *TestServer
StartTestServerOrDie calls StartTestServer t.Fatal if it does not succeed.
Source Files ¶
testserver.go
- Version
- v1.10.0-alpha.1
- Published
- Dec 18, 2017
- Platform
- js/wasm
- Imports
- 14 packages
- Last checked
- 4 minutes ago –
Tools for package owners.