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
05d2ae56
Commit
05d2ae56
authored
May 22, 2015
by
Daniel Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add framework to service accounts test
parent
86799cdd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
23 deletions
+4
-23
service_accounts.go
test/e2e/service_accounts.go
+4
-23
No files found.
test/e2e/service_accounts.go
View file @
05d2ae56
...
...
@@ -32,26 +32,7 @@ import (
)
var
_
=
Describe
(
"ServiceAccounts"
,
func
()
{
var
c
*
client
.
Client
var
ns
string
BeforeEach
(
func
()
{
var
err
error
c
,
err
=
loadClient
()
expectNoError
(
err
)
ns_
,
err
:=
createTestingNS
(
"service-accounts"
,
c
)
ns
=
ns_
.
Name
expectNoError
(
err
)
})
AfterEach
(
func
()
{
// Clean up the namespace if a non-default one was used
if
ns
!=
api
.
NamespaceDefault
{
By
(
"Cleaning up the namespace"
)
err
:=
c
.
Namespaces
()
.
Delete
(
ns
)
expectNoError
(
err
)
}
})
f
:=
NewFramework
(
"svcaccounts"
)
It
(
"should mount an API token into pods"
,
func
()
{
var
tokenName
string
...
...
@@ -61,7 +42,7 @@ var _ = Describe("ServiceAccounts", func() {
expectNoError
(
wait
.
Poll
(
time
.
Millisecond
*
500
,
time
.
Second
*
10
,
func
()
(
bool
,
error
)
{
By
(
"getting the auto-created API token"
)
tokenSelector
:=
fields
.
SelectorFromSet
(
map
[
string
]
string
{
client
.
SecretType
:
string
(
api
.
SecretTypeServiceAccountToken
)})
secrets
,
err
:=
c
.
Secrets
(
ns
)
.
List
(
labels
.
Everything
(),
tokenSelector
)
secrets
,
err
:=
f
.
Client
.
Secrets
(
f
.
Namespace
.
Name
)
.
List
(
labels
.
Everything
(),
tokenSelector
)
if
err
!=
nil
{
return
false
,
err
}
...
...
@@ -94,8 +75,8 @@ var _ = Describe("ServiceAccounts", func() {
},
}
testContainerOutputInNamespace
(
"consume service account token"
,
c
,
pod
,
[]
string
{
f
.
TestContainerOutput
(
"consume service account token"
,
pod
,
[]
string
{
fmt
.
Sprintf
(
`content of file "%s/%s": %s`
,
serviceaccount
.
DefaultAPITokenMountPath
,
api
.
ServiceAccountTokenKey
,
tokenContent
),
}
,
ns
)
})
})
})
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