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
2d24d981
Commit
2d24d981
authored
Jun 27, 2016
by
Jan Safranek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplicate deleteAllEtcdKeys().
parent
ecfd4aa1
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 @
2d24d981
...
...
@@ -442,7 +442,7 @@ func TestSingleWatch(t *testing.T) {
defer
s
.
Close
()
ns
:=
"blargh"
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
client
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
testapi
.
Default
.
GroupVersion
()}})
mkEvent
:=
func
(
i
int
)
*
api
.
Event
{
...
...
test/integration/persistent_volumes_test.go
View file @
2d24d981
...
...
@@ -108,7 +108,7 @@ func TestPersistentVolumeRecycler(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
...
...
@@ -156,7 +156,7 @@ func TestPersistentVolumeDeleter(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
...
...
@@ -208,7 +208,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
ctrl
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
...
...
@@ -273,7 +273,7 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
...
...
@@ -346,7 +346,7 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
...
...
@@ -438,7 +438,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
...
...
@@ -513,7 +513,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
waitForAnyPersistentVolumePhase
(
watchPV
,
api
.
VolumeReleased
)
t
.
Log
(
"volumes released"
)
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
}
// TestPersistentVolumeMultiPVsPVCs tests binding of 100 PVC to 100 PVs.
...
...
@@ -522,7 +522,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
binder
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
...
...
@@ -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
)
}
testSleep
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
}
// TestPersistentVolumeProvisionMultiPVCs tests provisioning of many PVCs.
...
...
@@ -602,7 +602,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
binder
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
...
...
@@ -672,7 +672,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
}
glog
.
V
(
2
)
.
Infof
(
"TestPersistentVolumeProvisionMultiPVCs: volumes are deleted"
)
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
}
// TestPersistentVolumeMultiPVsDiffAccessModes tests binding of one PVC to two
...
...
@@ -681,7 +681,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
_
,
s
:=
framework
.
RunAMaster
(
t
)
defer
s
.
Close
()
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
testClient
,
controller
,
watchPV
,
watchPVC
:=
createClients
(
t
,
s
)
defer
watchPV
.
Stop
()
defer
watchPVC
.
Stop
()
...
...
@@ -747,7 +747,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
waitForAnyPersistentVolumePhase
(
watchPV
,
api
.
VolumeReleased
)
t
.
Log
(
"volume released"
)
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
}
func
waitForPersistentVolumePhase
(
client
*
clientset
.
Clientset
,
pvName
string
,
w
watch
.
Interface
,
phase
api
.
PersistentVolumePhase
)
{
...
...
test/integration/service_account_test.go
View file @
2d24d981
...
...
@@ -337,7 +337,7 @@ func TestServiceAccountTokenAuthentication(t *testing.T) {
// It is the responsibility of the caller to ensure the returned stopFunc is called
func
startServiceAccountTestServer
(
t
*
testing
.
T
)
(
*
clientset
.
Clientset
,
restclient
.
Config
,
func
())
{
d
eleteAllEtcdKeys
()
framework
.
D
eleteAllEtcdKeys
()
// Listener
var
m
*
master
.
Master
...
...
test/integration/utils.go
View file @
2d24d981
...
...
@@ -51,20 +51,6 @@ func withEtcdKey(f func(string)) {
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
)
{
if
err
:=
c
.
Pods
(
ns
)
.
Delete
(
name
,
nil
);
err
!=
nil
{
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