Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
0523e54e
Commit
0523e54e
authored
Jul 04, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup integration auth tests
parent
bee29b59
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
auth_test.go
test/integration/auth_test.go
+0
-0
dynamic_client_test.go
test/integration/dynamic_client_test.go
+8
-8
quota_test.go
test/integration/quota_test.go
+1
-2
No files found.
test/integration/auth_test.go
View file @
0523e54e
This diff is collapsed.
Click to expand it.
test/integration/dynamic_client_test.go
View file @
0523e54e
...
@@ -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
)
}
}
...
...
test/integration/quota_test.go
View file @
0523e54e
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment