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
fa476b80
Commit
fa476b80
authored
Apr 18, 2016
by
Vishnu kannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Framework support for node e2e.
Signed-off-by:
Vishnu kannan
<
vishnuk@google.com
>
parent
4c7abddc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
25 deletions
+60
-25
e2e-node-test.sh
hack/e2e-node-test.sh
+1
-1
framework.go
test/e2e/framework/framework.go
+18
-16
load.go
test/e2e/load.go
+1
-1
e2e_node_suite_test.go
test/e2e_node/e2e_node_suite_test.go
+0
-7
kubelet_test.go
test/e2e_node/kubelet_test.go
+0
-0
util.go
test/e2e_node/util.go
+40
-0
No files found.
hack/e2e-node-test.sh
View file @
fa476b80
...
...
@@ -18,7 +18,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
kube::golang::setup_env
focus
=
${
FOCUS
}
focus
=
${
FOCUS
:-
""
}
skip
=
${
SKIP
:-
""
}
ginkgo
=
$(
kube::util::find-binary
"ginkgo"
)
...
...
test/e2e/framework/framework.go
View file @
fa476b80
...
...
@@ -93,14 +93,15 @@ func NewDefaultFramework(baseName string) *Framework {
ClientQPS
:
20
,
ClientBurst
:
50
,
}
return
NewFramework
(
baseName
,
options
)
return
NewFramework
(
baseName
,
options
,
nil
)
}
func
NewFramework
(
baseName
string
,
options
FrameworkOptions
)
*
Framework
{
func
NewFramework
(
baseName
string
,
options
FrameworkOptions
,
client
*
client
.
Client
)
*
Framework
{
f
:=
&
Framework
{
BaseName
:
baseName
,
AddonResourceConstraints
:
make
(
map
[
string
]
ResourceConstraint
),
options
:
options
,
Client
:
client
,
}
BeforeEach
(
f
.
BeforeEach
)
...
...
@@ -115,17 +116,18 @@ func (f *Framework) BeforeEach() {
// https://github.com/onsi/ginkgo/issues/222
f
.
cleanupHandle
=
AddCleanupAction
(
f
.
AfterEach
)
By
(
"Creating a kubernetes client"
)
config
,
err
:=
LoadConfig
()
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
config
.
QPS
=
f
.
options
.
ClientQPS
config
.
Burst
=
f
.
options
.
ClientBurst
c
,
err
:=
loadClientFromConfig
(
config
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
f
.
Client
=
c
f
.
Clientset_1_2
=
adapter_1_2
.
FromUnversionedClient
(
c
)
f
.
Clientset_1_3
=
adapter_1_3
.
FromUnversionedClient
(
c
)
if
f
.
Client
==
nil
{
By
(
"Creating a kubernetes client"
)
config
,
err
:=
LoadConfig
()
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
config
.
QPS
=
f
.
options
.
ClientQPS
config
.
Burst
=
f
.
options
.
ClientBurst
c
,
err
:=
loadClientFromConfig
(
config
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
f
.
Client
=
c
}
f
.
Clientset_1_2
=
adapter_1_2
.
FromUnversionedClient
(
f
.
Client
)
f
.
Clientset_1_3
=
adapter_1_3
.
FromUnversionedClient
(
f
.
Client
)
By
(
"Building a namespace api object"
)
namespace
,
err
:=
f
.
CreateNamespace
(
f
.
BaseName
,
map
[
string
]
string
{
...
...
@@ -137,14 +139,14 @@ func (f *Framework) BeforeEach() {
if
TestContext
.
VerifyServiceAccount
{
By
(
"Waiting for a default service account to be provisioned in namespace"
)
err
=
WaitForDefaultServiceAccountInNamespace
(
c
,
namespace
.
Name
)
err
=
WaitForDefaultServiceAccountInNamespace
(
f
.
Client
,
namespace
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
}
else
{
Logf
(
"Skipping waiting for service account"
)
}
if
TestContext
.
GatherKubeSystemResourceUsageData
{
f
.
gatherer
,
err
=
NewResourceUsageGatherer
(
c
,
ResourceGathererOptions
{
inKubemark
:
ProviderIs
(
"kubemark"
)})
f
.
gatherer
,
err
=
NewResourceUsageGatherer
(
f
.
Client
,
ResourceGathererOptions
{
inKubemark
:
ProviderIs
(
"kubemark"
)})
if
err
!=
nil
{
Logf
(
"Error while creating NewResourceUsageGatherer: %v"
,
err
)
}
else
{
...
...
@@ -156,7 +158,7 @@ func (f *Framework) BeforeEach() {
f
.
logsSizeWaitGroup
=
sync
.
WaitGroup
{}
f
.
logsSizeWaitGroup
.
Add
(
1
)
f
.
logsSizeCloseChannel
=
make
(
chan
bool
)
f
.
logsSizeVerifier
=
NewLogsVerifier
(
c
,
f
.
logsSizeCloseChannel
)
f
.
logsSizeVerifier
=
NewLogsVerifier
(
f
.
Client
,
f
.
logsSizeCloseChannel
)
go
func
()
{
f
.
logsSizeVerifier
.
Run
()
f
.
logsSizeWaitGroup
.
Done
()
...
...
test/e2e/load.go
View file @
fa476b80
...
...
@@ -71,7 +71,7 @@ var _ = framework.KubeDescribe("Load capacity", func() {
ClientQPS
:
50
,
ClientBurst
:
100
,
}
f
:=
framework
.
NewFramework
(
"load"
,
options
)
f
:=
framework
.
NewFramework
(
"load"
,
options
,
nil
)
f
.
NamespaceDeletionTimeout
=
time
.
Hour
BeforeEach
(
func
()
{
...
...
test/e2e_node/e2e_node_suite_test.go
View file @
fa476b80
...
...
@@ -35,13 +35,6 @@ import (
.
"github.com/onsi/gomega"
)
var
kubeletAddress
=
flag
.
String
(
"kubelet-address"
,
"http://127.0.0.1:10255"
,
"Host and port of the kubelet"
)
var
apiServerAddress
=
flag
.
String
(
"api-server-address"
,
"http://127.0.0.1:8080"
,
"Host and port of the api server"
)
var
nodeName
=
flag
.
String
(
"node-name"
,
""
,
"Name of the node"
)
var
buildServices
=
flag
.
Bool
(
"build-services"
,
true
,
"If true, build local executables"
)
var
startServices
=
flag
.
Bool
(
"start-services"
,
true
,
"If true, start local node services"
)
var
stopServices
=
flag
.
Bool
(
"stop-services"
,
true
,
"If true, stop local node services after running tests"
)
var
e2es
*
e2eService
func
TestE2eNode
(
t
*
testing
.
T
)
{
...
...
test/e2e_node/kubelet_test.go
View file @
fa476b80
This diff is collapsed.
Click to expand it.
test/e2e_node/util.go
0 → 100644
View file @
fa476b80
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
e2e_node
import
(
"flag"
"k8s.io/kubernetes/pkg/client/restclient"
client
"k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/test/e2e/framework"
)
var
kubeletAddress
=
flag
.
String
(
"kubelet-address"
,
"http://127.0.0.1:10255"
,
"Host and port of the kubelet"
)
var
apiServerAddress
=
flag
.
String
(
"api-server-address"
,
"http://127.0.0.1:8080"
,
"Host and port of the api server"
)
var
nodeName
=
flag
.
String
(
"node-name"
,
""
,
"Name of the node"
)
var
buildServices
=
flag
.
Bool
(
"build-services"
,
true
,
"If true, build local executables"
)
var
startServices
=
flag
.
Bool
(
"start-services"
,
true
,
"If true, start local node services"
)
var
stopServices
=
flag
.
Bool
(
"stop-services"
,
true
,
"If true, stop local node services after running tests"
)
func
NewDefaultFramework
(
baseName
string
)
*
framework
.
Framework
{
client
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
*
apiServerAddress
})
return
framework
.
NewFramework
(
baseName
,
framework
.
FrameworkOptions
{
ClientQPS
:
100
,
ClientBurst
:
100
,
},
client
)
}
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