Commit 08f17fef authored by Wojciech Tyczynski's avatar Wojciech Tyczynski

Unify DeleteAllEtcdKeys in integration tests.

parent 37edcc82
...@@ -412,6 +412,7 @@ func getTestRequests() []struct { ...@@ -412,6 +412,7 @@ func getTestRequests() []struct {
// //
// TODO(etune): write a fuzz test of the REST API. // TODO(etune): write a fuzz test of the REST API.
func TestAuthModeAlwaysAllow(t *testing.T) { func TestAuthModeAlwaysAllow(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
// Set up a master // Set up a master
...@@ -517,6 +518,7 @@ func getPreviousResourceVersionKey(url, id string) string { ...@@ -517,6 +518,7 @@ func getPreviousResourceVersionKey(url, id string) string {
} }
func TestAuthModeAlwaysDeny(t *testing.T) { func TestAuthModeAlwaysDeny(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
// Set up a master // Set up a master
...@@ -571,7 +573,7 @@ func (allowAliceAuthorizer) Authorize(a authorizer.Attributes) error { ...@@ -571,7 +573,7 @@ func (allowAliceAuthorizer) Authorize(a authorizer.Attributes) error {
// TestAliceNotForbiddenOrUnauthorized tests a user who is known to // TestAliceNotForbiddenOrUnauthorized tests a user who is known to
// the authentication system and authorized to do any actions. // the authentication system and authorized to do any actions.
func TestAliceNotForbiddenOrUnauthorized(t *testing.T) { func TestAliceNotForbiddenOrUnauthorized(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
// This file has alice and bob in it. // This file has alice and bob in it.
...@@ -652,6 +654,7 @@ func TestAliceNotForbiddenOrUnauthorized(t *testing.T) { ...@@ -652,6 +654,7 @@ func TestAliceNotForbiddenOrUnauthorized(t *testing.T) {
// the authentication system but not authorized to do any actions // the authentication system but not authorized to do any actions
// should receive "Forbidden". // should receive "Forbidden".
func TestBobIsForbidden(t *testing.T) { func TestBobIsForbidden(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
// This file has alice and bob in it. // This file has alice and bob in it.
...@@ -701,6 +704,7 @@ func TestBobIsForbidden(t *testing.T) { ...@@ -701,6 +704,7 @@ func TestBobIsForbidden(t *testing.T) {
// An authorization module is installed in this scenario for integration // An authorization module is installed in this scenario for integration
// test purposes, but requests aren't expected to reach it. // test purposes, but requests aren't expected to reach it.
func TestUnknownUserIsUnauthorized(t *testing.T) { func TestUnknownUserIsUnauthorized(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
// This file has alice and bob in it. // This file has alice and bob in it.
...@@ -772,6 +776,7 @@ func (impersonateAuthorizer) Authorize(a authorizer.Attributes) error { ...@@ -772,6 +776,7 @@ func (impersonateAuthorizer) Authorize(a authorizer.Attributes) error {
} }
func TestImpersonateIsForbidden(t *testing.T) { func TestImpersonateIsForbidden(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
var m *master.Master var m *master.Master
...@@ -923,6 +928,7 @@ func (a *trackingAuthorizer) Authorize(attributes authorizer.Attributes) error { ...@@ -923,6 +928,7 @@ func (a *trackingAuthorizer) Authorize(attributes authorizer.Attributes) error {
// TestAuthorizationAttributeDetermination tests that authorization attributes are built correctly // TestAuthorizationAttributeDetermination tests that authorization attributes are built correctly
func TestAuthorizationAttributeDetermination(t *testing.T) { func TestAuthorizationAttributeDetermination(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
trackingAuthorizer := &trackingAuthorizer{} trackingAuthorizer := &trackingAuthorizer{}
...@@ -993,6 +999,7 @@ func TestAuthorizationAttributeDetermination(t *testing.T) { ...@@ -993,6 +999,7 @@ func TestAuthorizationAttributeDetermination(t *testing.T) {
// TestNamespaceAuthorization tests that authorization can be controlled // TestNamespaceAuthorization tests that authorization can be controlled
// by namespace. // by namespace.
func TestNamespaceAuthorization(t *testing.T) { func TestNamespaceAuthorization(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
// This file has alice and bob in it. // This file has alice and bob in it.
...@@ -1096,6 +1103,7 @@ func TestNamespaceAuthorization(t *testing.T) { ...@@ -1096,6 +1103,7 @@ func TestNamespaceAuthorization(t *testing.T) {
// TestKindAuthorization tests that authorization can be controlled // TestKindAuthorization tests that authorization can be controlled
// by namespace. // by namespace.
func TestKindAuthorization(t *testing.T) { func TestKindAuthorization(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
// This file has alice and bob in it. // This file has alice and bob in it.
...@@ -1189,6 +1197,7 @@ func TestKindAuthorization(t *testing.T) { ...@@ -1189,6 +1197,7 @@ func TestKindAuthorization(t *testing.T) {
// TestReadOnlyAuthorization tests that authorization can be controlled // TestReadOnlyAuthorization tests that authorization can be controlled
// by namespace. // by namespace.
func TestReadOnlyAuthorization(t *testing.T) { func TestReadOnlyAuthorization(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
// This file has alice and bob in it. // This file has alice and bob in it.
...@@ -1253,6 +1262,7 @@ func TestReadOnlyAuthorization(t *testing.T) { ...@@ -1253,6 +1262,7 @@ func TestReadOnlyAuthorization(t *testing.T) {
// authenticator to call out to a remote web server for authentication // authenticator to call out to a remote web server for authentication
// decisions. // decisions.
func TestWebhookTokenAuthenticator(t *testing.T) { func TestWebhookTokenAuthenticator(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
var m *master.Master var m *master.Master
......
...@@ -44,11 +44,13 @@ import ( ...@@ -44,11 +44,13 @@ import (
) )
func TestClient(t *testing.T) { func TestClient(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
ns := api.NamespaceDefault ns := api.NamespaceDefault
framework.DeleteAllEtcdKeys()
client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
info, err := client.Discovery().ServerVersion() info, err := client.Discovery().ServerVersion()
...@@ -114,10 +116,12 @@ func TestClient(t *testing.T) { ...@@ -114,10 +116,12 @@ func TestClient(t *testing.T) {
} }
func TestAtomicPut(t *testing.T) { func TestAtomicPut(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
rcBody := api.ReplicationController{ rcBody := api.ReplicationController{
...@@ -203,10 +207,12 @@ func TestAtomicPut(t *testing.T) { ...@@ -203,10 +207,12 @@ func TestAtomicPut(t *testing.T) {
} }
func TestPatch(t *testing.T) { func TestPatch(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
name := "patchpod" name := "patchpod"
...@@ -309,10 +315,12 @@ func TestPatch(t *testing.T) { ...@@ -309,10 +315,12 @@ func TestPatch(t *testing.T) {
} }
func TestPatchWithCreateOnUpdate(t *testing.T) { func TestPatchWithCreateOnUpdate(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
endpointTemplate := &api.Endpoints{ endpointTemplate := &api.Endpoints{
...@@ -415,10 +423,12 @@ func TestPatchWithCreateOnUpdate(t *testing.T) { ...@@ -415,10 +423,12 @@ func TestPatchWithCreateOnUpdate(t *testing.T) {
} }
func TestAPIVersions(t *testing.T) { func TestAPIVersions(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
clientVersion := c.APIVersion().String() clientVersion := c.APIVersion().String()
...@@ -438,11 +448,13 @@ func TestAPIVersions(t *testing.T) { ...@@ -438,11 +448,13 @@ func TestAPIVersions(t *testing.T) {
} }
func TestSingleWatch(t *testing.T) { func TestSingleWatch(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
ns := "blargh" ns := "blargh"
framework.DeleteAllEtcdKeys()
client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
mkEvent := func(i int) *api.Event { mkEvent := func(i int) *api.Event {
...@@ -518,11 +530,13 @@ func TestMultiWatch(t *testing.T) { ...@@ -518,11 +530,13 @@ func TestMultiWatch(t *testing.T) {
// Disable this test as long as it demonstrates a problem. // Disable this test as long as it demonstrates a problem.
// TODO: Reenable this test when we get #6059 resolved. // TODO: Reenable this test when we get #6059 resolved.
return return
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
const watcherCount = 50 const watcherCount = 50
rt.GOMAXPROCS(watcherCount) rt.GOMAXPROCS(watcherCount)
framework.DeleteAllEtcdKeys()
defer framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
...@@ -777,10 +791,12 @@ func runSelfLinkTestOnNamespace(t *testing.T, c *client.Client, namespace string ...@@ -777,10 +791,12 @@ func runSelfLinkTestOnNamespace(t *testing.T, c *client.Client, namespace string
} }
func TestSelfLinkOnNamespace(t *testing.T) { func TestSelfLinkOnNamespace(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) c := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
runSelfLinkTestOnNamespace(t, c, api.NamespaceDefault) runSelfLinkTestOnNamespace(t, c, api.NamespaceDefault)
......
...@@ -35,6 +35,9 @@ import ( ...@@ -35,6 +35,9 @@ import (
// TestConfigMap tests apiserver-side behavior of creation of ConfigMaps and pods that consume them. // TestConfigMap tests apiserver-side behavior of creation of ConfigMaps and pods that consume them.
func TestConfigMap(t *testing.T) { func TestConfigMap(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
var m *master.Master var m *master.Master
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
m.Handler.ServeHTTP(w, req) m.Handler.ServeHTTP(w, req)
...@@ -47,7 +50,6 @@ func TestConfigMap(t *testing.T) { ...@@ -47,7 +50,6 @@ func TestConfigMap(t *testing.T) {
t.Fatalf("Error in bringing up the master: %v", err) t.Fatalf("Error in bringing up the master: %v", err)
} }
framework.DeleteAllEtcdKeys()
client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
DoTestConfigMap(t, client) DoTestConfigMap(t, client)
......
...@@ -34,10 +34,12 @@ import ( ...@@ -34,10 +34,12 @@ import (
) )
func TestDynamicClient(t *testing.T) { func TestDynamicClient(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
gv := testapi.Default.GroupVersion() gv := testapi.Default.GroupVersion()
config := &restclient.Config{ config := &restclient.Config{
Host: s.URL, Host: s.URL,
......
...@@ -186,6 +186,7 @@ func machine_3_Prioritizer(pod *api.Pod, nodes *api.NodeList) (*schedulerapi.Hos ...@@ -186,6 +186,7 @@ func machine_3_Prioritizer(pod *api.Pod, nodes *api.NodeList) (*schedulerapi.Hos
} }
func TestSchedulerExtender(t *testing.T) { func TestSchedulerExtender(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
var m *master.Master var m *master.Master
......
...@@ -79,5 +79,4 @@ func DeleteAllEtcdKeys() { ...@@ -79,5 +79,4 @@ func DeleteAllEtcdKeys() {
glog.Fatalf("Unable delete key: %v", err) glog.Fatalf("Unable delete key: %v", err)
} }
} }
} }
...@@ -117,6 +117,9 @@ func newOwnerRC(name string) *v1.ReplicationController { ...@@ -117,6 +117,9 @@ func newOwnerRC(name string) *v1.ReplicationController {
} }
func setup(t *testing.T) (*garbagecollector.GarbageCollector, clientset.Interface) { func setup(t *testing.T) (*garbagecollector.GarbageCollector, clientset.Interface) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
var m *master.Master var m *master.Master
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
m.Handler.ServeHTTP(w, req) m.Handler.ServeHTTP(w, req)
...@@ -130,7 +133,6 @@ func setup(t *testing.T) (*garbagecollector.GarbageCollector, clientset.Interfac ...@@ -130,7 +133,6 @@ func setup(t *testing.T) (*garbagecollector.GarbageCollector, clientset.Interfac
t.Fatalf("Error in bringing up the master: %v", err) t.Fatalf("Error in bringing up the master: %v", err)
} }
framework.DeleteAllEtcdKeys()
clientSet, err := clientset.NewForConfig(&restclient.Config{Host: s.URL}) clientSet, err := clientset.NewForConfig(&restclient.Config{Host: s.URL})
if err != nil { if err != nil {
t.Fatalf("Error in create clientset: %v", err) t.Fatalf("Error in create clientset: %v", err)
......
...@@ -392,6 +392,9 @@ func countEndpoints(eps *api.Endpoints) int { ...@@ -392,6 +392,9 @@ func countEndpoints(eps *api.Endpoints) int {
} }
func TestMasterService(t *testing.T) { func TestMasterService(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
m, err := master.New(framework.NewIntegrationTestMasterConfig()) m, err := master.New(framework.NewIntegrationTestMasterConfig())
if err != nil { if err != nil {
t.Fatalf("Error in bringing up the master: %v", err) t.Fatalf("Error in bringing up the master: %v", err)
...@@ -401,7 +404,6 @@ func TestMasterService(t *testing.T) { ...@@ -401,7 +404,6 @@ func TestMasterService(t *testing.T) {
})) }))
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
err = wait.Poll(time.Second, time.Minute, func() (bool, error) { err = wait.Poll(time.Second, time.Minute, func() (bool, error) {
......
...@@ -104,11 +104,13 @@ func testSleep() { ...@@ -104,11 +104,13 @@ func testSleep() {
} }
func TestPersistentVolumeRecycler(t *testing.T) { func TestPersistentVolumeRecycler(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
glog.V(2).Infof("TestPersistentVolumeRecycler started") glog.V(2).Infof("TestPersistentVolumeRecycler started")
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
testClient, ctrl, watchPV, watchPVC := createClients(t, s) testClient, ctrl, watchPV, watchPVC := createClients(t, s)
defer watchPV.Stop() defer watchPV.Stop()
defer watchPVC.Stop() defer watchPVC.Stop()
...@@ -152,11 +154,13 @@ func TestPersistentVolumeRecycler(t *testing.T) { ...@@ -152,11 +154,13 @@ func TestPersistentVolumeRecycler(t *testing.T) {
} }
func TestPersistentVolumeDeleter(t *testing.T) { func TestPersistentVolumeDeleter(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
glog.V(2).Infof("TestPersistentVolumeDeleter started") glog.V(2).Infof("TestPersistentVolumeDeleter started")
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
testClient, ctrl, watchPV, watchPVC := createClients(t, s) testClient, ctrl, watchPV, watchPVC := createClients(t, s)
defer watchPV.Stop() defer watchPV.Stop()
defer watchPVC.Stop() defer watchPVC.Stop()
...@@ -202,13 +206,15 @@ func TestPersistentVolumeDeleter(t *testing.T) { ...@@ -202,13 +206,15 @@ func TestPersistentVolumeDeleter(t *testing.T) {
} }
func TestPersistentVolumeBindRace(t *testing.T) { func TestPersistentVolumeBindRace(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
// Test a race binding many claims to a PV that is pre-bound to a specific // Test a race binding many claims to a PV that is pre-bound to a specific
// PVC. Only this specific PVC should get bound. // PVC. Only this specific PVC should get bound.
glog.V(2).Infof("TestPersistentVolumeBindRace started") glog.V(2).Infof("TestPersistentVolumeBindRace started")
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
testClient, ctrl, watchPV, watchPVC := createClients(t, s) testClient, ctrl, watchPV, watchPVC := createClients(t, s)
defer watchPV.Stop() defer watchPV.Stop()
defer watchPVC.Stop() defer watchPVC.Stop()
...@@ -270,10 +276,12 @@ func TestPersistentVolumeBindRace(t *testing.T) { ...@@ -270,10 +276,12 @@ func TestPersistentVolumeBindRace(t *testing.T) {
// TestPersistentVolumeClaimLabelSelector test binding using label selectors // TestPersistentVolumeClaimLabelSelector test binding using label selectors
func TestPersistentVolumeClaimLabelSelector(t *testing.T) { func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
testClient, controller, watchPV, watchPVC := createClients(t, s) testClient, controller, watchPV, watchPVC := createClients(t, s)
defer watchPV.Stop() defer watchPV.Stop()
defer watchPVC.Stop() defer watchPVC.Stop()
...@@ -343,10 +351,12 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) { ...@@ -343,10 +351,12 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
// TestPersistentVolumeClaimLabelSelectorMatchExpressions test binding using // TestPersistentVolumeClaimLabelSelectorMatchExpressions test binding using
// MatchExpressions label selectors // MatchExpressions label selectors
func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) { func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
testClient, controller, watchPV, watchPVC := createClients(t, s) testClient, controller, watchPV, watchPVC := createClients(t, s)
defer watchPV.Stop() defer watchPV.Stop()
defer watchPVC.Stop() defer watchPVC.Stop()
...@@ -435,10 +445,12 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) { ...@@ -435,10 +445,12 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
// TestPersistentVolumeMultiPVs tests binding of one PVC to 100 PVs with // TestPersistentVolumeMultiPVs tests binding of one PVC to 100 PVs with
// different size. // different size.
func TestPersistentVolumeMultiPVs(t *testing.T) { func TestPersistentVolumeMultiPVs(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
testClient, controller, watchPV, watchPVC := createClients(t, s) testClient, controller, watchPV, watchPVC := createClients(t, s)
defer watchPV.Stop() defer watchPV.Stop()
defer watchPVC.Stop() defer watchPVC.Stop()
...@@ -512,17 +524,17 @@ func TestPersistentVolumeMultiPVs(t *testing.T) { ...@@ -512,17 +524,17 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
waitForAnyPersistentVolumePhase(watchPV, api.VolumeReleased) waitForAnyPersistentVolumePhase(watchPV, api.VolumeReleased)
t.Log("volumes released") t.Log("volumes released")
framework.DeleteAllEtcdKeys()
} }
// TestPersistentVolumeMultiPVsPVCs tests binding of 100 PVC to 100 PVs. // TestPersistentVolumeMultiPVsPVCs tests binding of 100 PVC to 100 PVs.
// This test is configurable by KUBE_INTEGRATION_PV_* variables. // This test is configurable by KUBE_INTEGRATION_PV_* variables.
func TestPersistentVolumeMultiPVsPVCs(t *testing.T) { func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
testClient, binder, watchPV, watchPVC := createClients(t, s) testClient, binder, watchPV, watchPVC := createClients(t, s)
defer watchPV.Stop() defer watchPV.Stop()
defer watchPVC.Stop() defer watchPVC.Stop()
...@@ -593,16 +605,17 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) { ...@@ -593,16 +605,17 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
glog.V(2).Infof("PVC %q is bound to PV %q", pvc.Name, pvc.Spec.VolumeName) glog.V(2).Infof("PVC %q is bound to PV %q", pvc.Name, pvc.Spec.VolumeName)
} }
testSleep() testSleep()
framework.DeleteAllEtcdKeys()
} }
// TestPersistentVolumeProvisionMultiPVCs tests provisioning of many PVCs. // TestPersistentVolumeProvisionMultiPVCs tests provisioning of many PVCs.
// This test is configurable by KUBE_INTEGRATION_PV_* variables. // This test is configurable by KUBE_INTEGRATION_PV_* variables.
func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) { func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
testClient, binder, watchPV, watchPVC := createClients(t, s) testClient, binder, watchPV, watchPVC := createClients(t, s)
defer watchPV.Stop() defer watchPV.Stop()
defer watchPVC.Stop() defer watchPVC.Stop()
...@@ -671,17 +684,17 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) { ...@@ -671,17 +684,17 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
time.Sleep(time.Second) time.Sleep(time.Second)
} }
glog.V(2).Infof("TestPersistentVolumeProvisionMultiPVCs: volumes are deleted") glog.V(2).Infof("TestPersistentVolumeProvisionMultiPVCs: volumes are deleted")
framework.DeleteAllEtcdKeys()
} }
// TestPersistentVolumeMultiPVsDiffAccessModes tests binding of one PVC to two // TestPersistentVolumeMultiPVsDiffAccessModes tests binding of one PVC to two
// PVs with different access modes. // PVs with different access modes.
func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) { func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
_, s := framework.RunAMaster(t) _, s := framework.RunAMaster(t)
defer s.Close() defer s.Close()
framework.DeleteAllEtcdKeys()
testClient, controller, watchPV, watchPVC := createClients(t, s) testClient, controller, watchPV, watchPVC := createClients(t, s)
defer watchPV.Stop() defer watchPV.Stop()
defer watchPVC.Stop() defer watchPVC.Stop()
...@@ -746,8 +759,6 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) { ...@@ -746,8 +759,6 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
waitForAnyPersistentVolumePhase(watchPV, api.VolumeReleased) waitForAnyPersistentVolumePhase(watchPV, api.VolumeReleased)
t.Log("volume released") t.Log("volume released")
framework.DeleteAllEtcdKeys()
} }
func waitForPersistentVolumePhase(client *clientset.Clientset, pvName string, w watch.Interface, phase api.PersistentVolumePhase) { func waitForPersistentVolumePhase(client *clientset.Clientset, pvName string, w watch.Interface, phase api.PersistentVolumePhase) {
......
...@@ -33,6 +33,9 @@ import ( ...@@ -33,6 +33,9 @@ import (
) )
func TestPodUpdateActiveDeadlineSeconds(t *testing.T) { func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
var m *master.Master var m *master.Master
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
m.Handler.ServeHTTP(w, req) m.Handler.ServeHTTP(w, req)
...@@ -46,7 +49,6 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) { ...@@ -46,7 +49,6 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
t.Fatalf("Error in bringing up the master: %v", err) t.Fatalf("Error in bringing up the master: %v", err)
} }
framework.DeleteAllEtcdKeys()
client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
var ( var (
...@@ -158,6 +160,9 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) { ...@@ -158,6 +160,9 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
} }
func TestPodReadOnlyFilesystem(t *testing.T) { func TestPodReadOnlyFilesystem(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
var m *master.Master var m *master.Master
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
m.Handler.ServeHTTP(w, req) m.Handler.ServeHTTP(w, req)
...@@ -172,7 +177,6 @@ func TestPodReadOnlyFilesystem(t *testing.T) { ...@@ -172,7 +177,6 @@ func TestPodReadOnlyFilesystem(t *testing.T) {
t.Fatalf("Error in bringing up the master: %v", err) t.Fatalf("Error in bringing up the master: %v", err)
} }
framework.DeleteAllEtcdKeys()
client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
pod := &api.Pod{ pod := &api.Pod{
......
...@@ -54,6 +54,7 @@ func init() { ...@@ -54,6 +54,7 @@ func init() {
// quota_test.go:100: Took 4.196205966s to scale up without quota // quota_test.go:100: Took 4.196205966s to scale up without quota
// quota_test.go:115: Took 12.021640372s to scale up with quota // quota_test.go:115: Took 12.021640372s to scale up with quota
func TestQuota(t *testing.T) { func TestQuota(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
initializationCh := make(chan struct{}) initializationCh := make(chan struct{})
......
...@@ -355,6 +355,7 @@ func TestRBAC(t *testing.T) { ...@@ -355,6 +355,7 @@ func TestRBAC(t *testing.T) {
} }
for i, tc := range tests { for i, tc := range tests {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
var m *master.Master var m *master.Master
......
...@@ -53,6 +53,7 @@ type nodeStateManager struct { ...@@ -53,6 +53,7 @@ type nodeStateManager struct {
} }
func TestUnschedulableNodes(t *testing.T) { func TestUnschedulableNodes(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
var m *master.Master var m *master.Master
...@@ -300,6 +301,7 @@ func DoTestUnschedulableNodes(t *testing.T, restClient *client.Client, nodeStore ...@@ -300,6 +301,7 @@ func DoTestUnschedulableNodes(t *testing.T, restClient *client.Client, nodeStore
} }
func TestMultiScheduler(t *testing.T) { func TestMultiScheduler(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
var m *master.Master var m *master.Master
......
...@@ -41,6 +41,9 @@ func deleteSecretOrErrorf(t *testing.T, c *client.Client, ns, name string) { ...@@ -41,6 +41,9 @@ func deleteSecretOrErrorf(t *testing.T, c *client.Client, ns, name string) {
// TestSecrets tests apiserver-side behavior of creation of secret objects and their use by pods. // TestSecrets tests apiserver-side behavior of creation of secret objects and their use by pods.
func TestSecrets(t *testing.T) { func TestSecrets(t *testing.T) {
// TODO: Limit the test to a single non-default namespace and clean this up at the end.
framework.DeleteAllEtcdKeys()
var m *master.Master var m *master.Master
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
m.Handler.ServeHTTP(w, req) m.Handler.ServeHTTP(w, req)
...@@ -53,7 +56,6 @@ func TestSecrets(t *testing.T) { ...@@ -53,7 +56,6 @@ func TestSecrets(t *testing.T) {
t.Fatalf("Error in bringing up the master: %v", err) t.Fatalf("Error in bringing up the master: %v", err)
} }
framework.DeleteAllEtcdKeys()
client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) client := client.NewOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
DoTestSecrets(t, client) DoTestSecrets(t, client)
} }
......
...@@ -336,7 +336,6 @@ func TestServiceAccountTokenAuthentication(t *testing.T) { ...@@ -336,7 +336,6 @@ func TestServiceAccountTokenAuthentication(t *testing.T) {
// startServiceAccountTestServer returns a started server // startServiceAccountTestServer returns a started server
// It is the responsibility of the caller to ensure the returned stopFunc is called // It is the responsibility of the caller to ensure the returned stopFunc is called
func startServiceAccountTestServer(t *testing.T) (*clientset.Clientset, restclient.Config, func()) { func startServiceAccountTestServer(t *testing.T) (*clientset.Clientset, restclient.Config, func()) {
framework.DeleteAllEtcdKeys() framework.DeleteAllEtcdKeys()
// Listener // Listener
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment