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
065217e4
Commit
065217e4
authored
Jun 28, 2016
by
k8s-merge-robot
Committed by
GitHub
Jun 28, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #27350 from jsafrane/integration-deleteetcd
Automatic merge from submit-queue Remove duplicate deleteAllEtcdKeys() from integration tests.
parents
5e50ee79
2d24d981
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
29 deletions
+15
-29
client_test.go
test/integration/client_test.go
+1
-1
persistent_volumes_test.go
test/integration/persistent_volumes_test.go
+13
-13
service_account_test.go
test/integration/service_account_test.go
+1
-1
utils.go
test/integration/utils.go
+0
-14
No files found.
test/integration/client_test.go
View file @
065217e4
...
@@ -442,7 +442,7 @@ func TestSingleWatch(t *testing.T) {
...
@@ -442,7 +442,7 @@ func TestSingleWatch(t *testing.T) {
defer
s
.
Close
()
defer
s
.
Close
()
ns
:=
"blargh"
ns
:=
"blargh"
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
client
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
client
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
mkEvent
:=
func
(
i
int
)
*
api
.
Event
{
mkEvent
:=
func
(
i
int
)
*
api
.
Event
{
...
...
test/integration/persistent_volumes_test.go
View file @
065217e4
...
@@ -108,7 +108,7 @@ func TestPersistentVolumeRecycler(t *testing.T) {
...
@@ -108,7 +108,7 @@ func TestPersistentVolumeRecycler(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
defer
watchPVC
.
Stop
()
...
@@ -156,7 +156,7 @@ func TestPersistentVolumeDeleter(t *testing.T) {
...
@@ -156,7 +156,7 @@ func TestPersistentVolumeDeleter(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
defer
watchPVC
.
Stop
()
...
@@ -208,7 +208,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
...
@@ -208,7 +208,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
defer
watchPVC
.
Stop
()
...
@@ -273,7 +273,7 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
...
@@ -273,7 +273,7 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
defer
watchPVC
.
Stop
()
...
@@ -346,7 +346,7 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
...
@@ -346,7 +346,7 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
defer
watchPVC
.
Stop
()
...
@@ -438,7 +438,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
...
@@ -438,7 +438,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
defer
watchPVC
.
Stop
()
...
@@ -513,7 +513,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
...
@@ -513,7 +513,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
waitForAnyPersistentVolumePhase
(
watchPV
,
api
.
VolumeReleased
)
waitForAnyPersistentVolumePhase
(
watchPV
,
api
.
VolumeReleased
)
t
.
Log
(
"volumes released"
)
t
.
Log
(
"volumes released"
)
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
}
}
// TestPersistentVolumeMultiPVsPVCs tests binding of 100 PVC to 100 PVs.
// TestPersistentVolumeMultiPVsPVCs tests binding of 100 PVC to 100 PVs.
...
@@ -522,7 +522,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
...
@@ -522,7 +522,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
binder
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
testClient
,
binder
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
defer
watchPVC
.
Stop
()
...
@@ -593,7 +593,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
...
@@ -593,7 +593,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
glog
.
V
(
2
)
.
Infof
(
"PVC %q is bound to PV %q"
,
pvc
.
Name
,
pvc
.
Spec
.
VolumeName
)
glog
.
V
(
2
)
.
Infof
(
"PVC %q is bound to PV %q"
,
pvc
.
Name
,
pvc
.
Spec
.
VolumeName
)
}
}
testSleep
()
testSleep
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
}
}
// TestPersistentVolumeProvisionMultiPVCs tests provisioning of many PVCs.
// TestPersistentVolumeProvisionMultiPVCs tests provisioning of many PVCs.
...
@@ -602,7 +602,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
...
@@ -602,7 +602,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
binder
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
testClient
,
binder
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
defer
watchPVC
.
Stop
()
...
@@ -672,7 +672,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
...
@@ -672,7 +672,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
}
}
glog
.
V
(
2
)
.
Infof
(
"TestPersistentVolumeProvisionMultiPVCs: volumes are deleted"
)
glog
.
V
(
2
)
.
Infof
(
"TestPersistentVolumeProvisionMultiPVCs: volumes are deleted"
)
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
}
}
// TestPersistentVolumeMultiPVsDiffAccessModes tests binding of one PVC to two
// TestPersistentVolumeMultiPVsDiffAccessModes tests binding of one PVC to two
...
@@ -681,7 +681,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
...
@@ -681,7 +681,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
defer
watchPVC
.
Stop
()
...
@@ -747,7 +747,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
...
@@ -747,7 +747,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
waitForAnyPersistentVolumePhase
(
watchPV
,
api
.
VolumeReleased
)
waitForAnyPersistentVolumePhase
(
watchPV
,
api
.
VolumeReleased
)
t
.
Log
(
"volume released"
)
t
.
Log
(
"volume released"
)
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
}
}
func
waitForPersistentVolumePhase
(
client
*
clientset
.
Clientset
,
pvName
string
,
w
watch
.
Interface
,
phase
api
.
PersistentVolumePhase
)
{
func
waitForPersistentVolumePhase
(
client
*
clientset
.
Clientset
,
pvName
string
,
w
watch
.
Interface
,
phase
api
.
PersistentVolumePhase
)
{
...
...
test/integration/service_account_test.go
View file @
065217e4
...
@@ -337,7 +337,7 @@ func TestServiceAccountTokenAuthentication(t *testing.T) {
...
@@ -337,7 +337,7 @@ func TestServiceAccountTokenAuthentication(t *testing.T) {
// It is the responsibility of the caller to ensure the returned stopFunc is called
// It is the responsibility of the caller to ensure the returned stopFunc is called
func
startServiceAccountTestServer
(
t
*
testing
.
T
)
(
*
clientset
.
Clientset
,
restclient
.
Config
,
func
())
{
func
startServiceAccountTestServer
(
t
*
testing
.
T
)
(
*
clientset
.
Clientset
,
restclient
.
Config
,
func
())
{
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
// Listener
// Listener
var
m
*
master
.
Master
var
m
*
master
.
Master
...
...
test/integration/utils.go
View file @
065217e4
...
@@ -51,20 +51,6 @@ func withEtcdKey(f func(string)) {
...
@@ -51,20 +51,6 @@ func withEtcdKey(f func(string)) {
f
(
prefix
)
f
(
prefix
)
}
}
func
deleteAllEtcdKeys
()
{
keysAPI
:=
etcd
.
NewKeysAPI
(
newEtcdClient
())
keys
,
err
:=
keysAPI
.
Get
(
context
.
TODO
(),
"/"
,
nil
)
if
err
!=
nil
{
glog
.
Fatalf
(
"Unable to list root etcd keys: %v"
,
err
)
}
for
_
,
node
:=
range
keys
.
Node
.
Nodes
{
if
_
,
err
:=
keysAPI
.
Delete
(
context
.
TODO
(),
node
.
Key
,
&
etcd
.
DeleteOptions
{
Recursive
:
true
});
err
!=
nil
{
glog
.
Fatalf
(
"Unable delete key: %v"
,
err
)
}
}
}
func
deletePodOrErrorf
(
t
*
testing
.
T
,
c
*
client
.
Client
,
ns
,
name
string
)
{
func
deletePodOrErrorf
(
t
*
testing
.
T
,
c
*
client
.
Client
,
ns
,
name
string
)
{
if
err
:=
c
.
Pods
(
ns
)
.
Delete
(
name
,
nil
);
err
!=
nil
{
if
err
:=
c
.
Pods
(
ns
)
.
Delete
(
name
,
nil
);
err
!=
nil
{
t
.
Errorf
(
"unable to delete pod %v: %v"
,
name
,
err
)
t
.
Errorf
(
"unable to delete pod %v: %v"
,
name
,
err
)
...
...
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