Commit 0523e54e authored by Wojciech Tyczynski's avatar Wojciech Tyczynski

Cleanup integration auth tests

parent bee29b59
...@@ -34,12 +34,12 @@ import ( ...@@ -34,12 +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(nil) _, s := framework.RunAMaster(nil)
defer s.Close() defer s.Close()
ns := framework.CreateTestingNamespace("dynamic-client", s, t)
defer framework.DeleteTestingNamespace(ns, s, t)
gv := testapi.Default.GroupVersion() gv := testapi.Default.GroupVersion()
config := &restclient.Config{ config := &restclient.Config{
Host: s.URL, Host: s.URL,
...@@ -86,13 +86,13 @@ func TestDynamicClient(t *testing.T) { ...@@ -86,13 +86,13 @@ func TestDynamicClient(t *testing.T) {
}, },
} }
actual, err := client.Pods(framework.TestNS).Create(pod) actual, err := client.Pods(ns.Name).Create(pod)
if err != nil { if err != nil {
t.Fatalf("unexpected error when creating pod: %v", err) t.Fatalf("unexpected error when creating pod: %v", err)
} }
// check dynamic list // check dynamic list
unstructuredList, err := dynamicClient.Resource(&resource, framework.TestNS).List(&v1.ListOptions{}) unstructuredList, err := dynamicClient.Resource(&resource, ns.Name).List(&v1.ListOptions{})
if err != nil { if err != nil {
t.Fatalf("unexpected error when listing pods: %v", err) t.Fatalf("unexpected error when listing pods: %v", err)
} }
...@@ -111,7 +111,7 @@ func TestDynamicClient(t *testing.T) { ...@@ -111,7 +111,7 @@ func TestDynamicClient(t *testing.T) {
} }
// check dynamic get // check dynamic get
unstruct, err := dynamicClient.Resource(&resource, framework.TestNS).Get(actual.Name) unstruct, err := dynamicClient.Resource(&resource, ns.Name).Get(actual.Name)
if err != nil { if err != nil {
t.Fatalf("unexpected error when getting pod %q: %v", actual.Name, err) t.Fatalf("unexpected error when getting pod %q: %v", actual.Name, err)
} }
...@@ -126,12 +126,12 @@ func TestDynamicClient(t *testing.T) { ...@@ -126,12 +126,12 @@ func TestDynamicClient(t *testing.T) {
} }
// delete the pod dynamically // delete the pod dynamically
err = dynamicClient.Resource(&resource, framework.TestNS).Delete(actual.Name, nil) err = dynamicClient.Resource(&resource, ns.Name).Delete(actual.Name, nil)
if err != nil { if err != nil {
t.Fatalf("unexpected error when deleting pod: %v", err) t.Fatalf("unexpected error when deleting pod: %v", err)
} }
list, err := client.Pods(framework.TestNS).List(api.ListOptions{}) list, err := client.Pods(ns.Name).List(api.ListOptions{})
if err != nil { if err != nil {
t.Fatalf("unexpected error when listing pods: %v", err) t.Fatalf("unexpected error when listing pods: %v", err)
} }
......
...@@ -64,8 +64,7 @@ func TestQuota(t *testing.T) { ...@@ -64,8 +64,7 @@ func TestQuota(t *testing.T) {
<-initializationCh <-initializationCh
m.Handler.ServeHTTP(w, req) m.Handler.ServeHTTP(w, req)
})) }))
// TODO: https://github.com/kubernetes/kubernetes/issues/25412 defer s.Close()
//defer s.Close()
admissionCh := make(chan struct{}) admissionCh := make(chan struct{})
clientset := clientset.NewForConfigOrDie(&restclient.Config{QPS: -1, Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}}) clientset := clientset.NewForConfigOrDie(&restclient.Config{QPS: -1, Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Default.GroupVersion()}})
admission, err := resourcequota.NewResourceQuota(clientset, quotainstall.NewRegistry(clientset), 5, admissionCh) admission, err := resourcequota.NewResourceQuota(clientset, quotainstall.NewRegistry(clientset), 5, admissionCh)
......
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