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
bee29b59
Commit
bee29b59
authored
Jul 04, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup integration RunAMaster
parent
11211a49
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
38 additions
and
47 deletions
+38
-47
client_test.go
test/integration/client_test.go
+8
-8
configmap_test.go
test/integration/configmap_test.go
+1
-1
dynamic_client_test.go
test/integration/dynamic_client_test.go
+1
-1
extender_test.go
test/integration/extender_test.go
+1
-1
master_utils.go
test/integration/framework/master_utils.go
+5
-14
master_test.go
test/integration/master_test.go
+5
-5
metrics_test.go
test/integration/metrics_test.go
+2
-2
persistent_volumes_test.go
test/integration/persistent_volumes_test.go
+9
-9
pods_test.go
test/integration/pods_test.go
+2
-2
scheduler_test.go
test/integration/scheduler_test.go
+3
-3
secret_test.go
test/integration/secret_test.go
+1
-1
No files found.
test/integration/client_test.go
View file @
bee29b59
...
...
@@ -44,7 +44,7 @@ import (
)
func
TestClient
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
client
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
...
...
@@ -116,7 +116,7 @@ func TestClient(t *testing.T) {
}
func
TestAtomicPut
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
c
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
...
...
@@ -208,7 +208,7 @@ func TestAtomicPut(t *testing.T) {
}
func
TestPatch
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
c
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
...
...
@@ -317,7 +317,7 @@ func TestPatch(t *testing.T) {
}
func
TestPatchWithCreateOnUpdate
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
c
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
...
...
@@ -428,7 +428,7 @@ func TestPatchWithCreateOnUpdate(t *testing.T) {
}
func
TestAPIVersions
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
c
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
...
...
@@ -450,7 +450,7 @@ func TestAPIVersions(t *testing.T) {
}
func
TestSingleWatch
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
ns
:=
framework
.
CreateTestingNamespace
(
"single-watch"
,
s
,
t
)
...
...
@@ -535,7 +535,7 @@ func TestMultiWatch(t *testing.T) {
const
watcherCount
=
50
rt
.
GOMAXPROCS
(
watcherCount
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
ns
:=
framework
.
CreateTestingNamespace
(
"multi-watch"
,
s
,
t
)
...
...
@@ -794,7 +794,7 @@ 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
(
nil
)
defer
s
.
Close
()
c
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
...
...
test/integration/configmap_test.go
View file @
bee29b59
...
...
@@ -32,7 +32,7 @@ import (
// TestConfigMap tests apiserver-side behavior of creation of ConfigMaps and pods that consume them.
func
TestConfigMap
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
client
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
...
...
test/integration/dynamic_client_test.go
View file @
bee29b59
...
...
@@ -37,7 +37,7 @@ 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
(
nil
)
defer
s
.
Close
()
gv
:=
testapi
.
Default
.
GroupVersion
()
...
...
test/integration/extender_test.go
View file @
bee29b59
...
...
@@ -188,7 +188,7 @@ func TestSchedulerExtender(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
(
nil
)
defer
s
.
Close
()
restClient
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
...
...
test/integration/framework/master_utils.go
View file @
bee29b59
...
...
@@ -347,21 +347,12 @@ func StartPods(numPods int, host string, restClient *client.Client) error {
}
}
// TODO: Merge this into startMasterOrDie.
func
RunAMaster
(
t
*
testing
.
T
)
(
*
master
.
Master
,
*
httptest
.
Server
)
{
masterConfig
:=
NewMasterConfig
()
masterConfig
.
EnableProfiling
=
true
m
,
err
:=
master
.
New
(
masterConfig
)
if
err
!=
nil
{
// TODO: Return error.
glog
.
Fatalf
(
"error in bringing up the master: %v"
,
err
)
func
RunAMaster
(
masterConfig
*
master
.
Config
)
(
*
master
.
Master
,
*
httptest
.
Server
)
{
if
masterConfig
==
nil
{
masterConfig
=
NewMasterConfig
()
masterConfig
.
EnableProfiling
=
true
}
s
:=
httptest
.
NewServer
(
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
m
.
Handler
.
ServeHTTP
(
w
,
req
)
}))
return
m
,
s
return
startMasterOrDie
(
masterConfig
)
}
// Task is a function passed to worker goroutines by RunParallel.
...
...
test/integration/master_test.go
View file @
bee29b59
...
...
@@ -42,7 +42,7 @@ import (
)
func
testPrefix
(
t
*
testing
.
T
,
prefix
string
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
resp
,
err
:=
http
.
Get
(
s
.
URL
+
prefix
)
...
...
@@ -71,7 +71,7 @@ func TestExtensionsPrefix(t *testing.T) {
}
func
TestWatchSucceedsWithoutArgs
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
resp
,
err
:=
http
.
Get
(
s
.
URL
+
"/api/v1/namespaces?watch=1"
)
...
...
@@ -118,7 +118,7 @@ func extensionsPath(resource, namespace, name string) string {
}
func
TestAutoscalingGroupBackwardCompatibility
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
transport
:=
http
.
DefaultTransport
...
...
@@ -261,7 +261,7 @@ func TestBatchGroupBackwardCompatibility(t *testing.T) {
if
*
testapi
.
Batch
.
GroupVersion
()
==
v2alpha1
.
SchemeGroupVersion
{
t
.
Skip
(
"Shared job storage is not required for batch/v2alpha1."
)
}
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
transport
:=
http
.
DefaultTransport
...
...
@@ -314,7 +314,7 @@ func TestBatchGroupBackwardCompatibility(t *testing.T) {
}
func
TestAccept
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
resp
,
err
:=
http
.
Get
(
s
.
URL
+
"/api/"
)
...
...
test/integration/metrics_test.go
View file @
bee29b59
...
...
@@ -86,7 +86,7 @@ func checkForExpectedMetrics(t *testing.T, metrics []*prometheuspb.MetricFamily,
}
func
TestMasterProcessMetrics
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
metrics
,
err
:=
scrapeMetrics
(
s
)
...
...
@@ -103,7 +103,7 @@ func TestMasterProcessMetrics(t *testing.T) {
}
func
TestApiserverMetrics
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
// Make a request to the apiserver to ensure there's at least one data point
...
...
test/integration/persistent_volumes_test.go
View file @
bee29b59
...
...
@@ -108,7 +108,7 @@ func TestPersistentVolumeRecycler(t *testing.T) {
framework
.
DeleteAllEtcdKeys
()
glog
.
V
(
2
)
.
Infof
(
"TestPersistentVolumeRecycler started"
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
...
...
@@ -158,7 +158,7 @@ func TestPersistentVolumeDeleter(t *testing.T) {
framework
.
DeleteAllEtcdKeys
()
glog
.
V
(
2
)
.
Infof
(
"TestPersistentVolumeDeleter started"
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
...
...
@@ -212,7 +212,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
// Test a race binding many claims to a PV that is pre-bound to a specific
// PVC. Only this specific PVC should get bound.
glog
.
V
(
2
)
.
Infof
(
"TestPersistentVolumeBindRace started"
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
...
...
@@ -279,7 +279,7 @@ 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
(
nil
)
defer
s
.
Close
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
...
...
@@ -354,7 +354,7 @@ 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
(
nil
)
defer
s
.
Close
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
...
...
@@ -448,7 +448,7 @@ 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
(
nil
)
defer
s
.
Close
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
...
...
@@ -532,7 +532,7 @@ 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
(
nil
)
defer
s
.
Close
()
testClient
,
binder
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
...
...
@@ -613,7 +613,7 @@ 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
(
nil
)
defer
s
.
Close
()
testClient
,
binder
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
...
...
@@ -692,7 +692,7 @@ 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
(
nil
)
defer
s
.
Close
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
...
...
test/integration/pods_test.go
View file @
bee29b59
...
...
@@ -30,7 +30,7 @@ import (
)
func
TestPodUpdateActiveDeadlineSeconds
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
ns
:=
framework
.
CreateTestingNamespace
(
"pod-activedeadline-update"
,
s
,
t
)
...
...
@@ -147,7 +147,7 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
}
func
TestPodReadOnlyFilesystem
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
isReadOnly
:=
true
...
...
test/integration/scheduler_test.go
View file @
bee29b59
...
...
@@ -53,7 +53,7 @@ func TestUnschedulableNodes(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
(
nil
)
defer
s
.
Close
()
restClient
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
...
...
@@ -292,7 +292,7 @@ func TestMultiScheduler(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
(
nil
)
// TODO: Uncomment when fix #19254
// This seems to be a different issue - it still doesn't work.
// defer s.Close()
...
...
@@ -473,7 +473,7 @@ func createPod(client *client.Client, name string, annotation map[string]string)
func
TestAllocatable
(
t
*
testing
.
T
)
{
framework
.
DeleteAllEtcdKeys
()
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
// 1. create and start default-scheduler
...
...
test/integration/secret_test.go
View file @
bee29b59
...
...
@@ -38,7 +38,7 @@ 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.
func
TestSecrets
(
t
*
testing
.
T
)
{
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
nil
)
defer
s
.
Close
()
client
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
...
...
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