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
d82c3023
Commit
d82c3023
authored
Jun 20, 2016
by
Marek Grabowski
Committed by
GitHub
Jun 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #27719 from gmarek/dependency
Remove dependency on test/integration from kubemark
parents
3b57f868
9bbcb5e3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
23 deletions
+45
-23
integration.go
cmd/integration/integration.go
+4
-4
hollow_kubelet.go
pkg/kubemark/hollow_kubelet.go
+3
-3
utils.go
test/integration/utils.go
+0
-16
tmpdir.go
test/utils/tmpdir.go
+38
-0
No files found.
cmd/integration/integration.go
View file @
d82c3023
...
@@ -64,8 +64,8 @@ import (
...
@@ -64,8 +64,8 @@ import (
_
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithmprovider"
_
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithmprovider"
"k8s.io/kubernetes/plugin/pkg/scheduler/factory"
"k8s.io/kubernetes/plugin/pkg/scheduler/factory"
e2e
"k8s.io/kubernetes/test/e2e/framework"
e2e
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/integration"
"k8s.io/kubernetes/test/integration/framework"
"k8s.io/kubernetes/test/integration/framework"
testutils
"k8s.io/kubernetes/test/utils"
etcd
"github.com/coreos/etcd/client"
etcd
"github.com/coreos/etcd/client"
"github.com/golang/glog"
"github.com/golang/glog"
...
@@ -210,8 +210,8 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
...
@@ -210,8 +210,8 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
cadvisorInterface
:=
new
(
cadvisortest
.
Fake
)
cadvisorInterface
:=
new
(
cadvisortest
.
Fake
)
// Kubelet (localhost)
// Kubelet (localhost)
testRootDir
:=
integration
.
MakeTempDirOrDie
(
"kubelet_integ_1."
,
""
)
testRootDir
:=
testutils
.
MakeTempDirOrDie
(
"kubelet_integ_1."
,
""
)
configFilePath
:=
integration
.
MakeTempDirOrDie
(
"config"
,
testRootDir
)
configFilePath
:=
testutils
.
MakeTempDirOrDie
(
"config"
,
testRootDir
)
glog
.
Infof
(
"Using %s as root dir for kubelet #1"
,
testRootDir
)
glog
.
Infof
(
"Using %s as root dir for kubelet #1"
,
testRootDir
)
cm
:=
cm
.
NewStubContainerManager
()
cm
:=
cm
.
NewStubContainerManager
()
kcfg
:=
kubeletapp
.
SimpleKubelet
(
kcfg
:=
kubeletapp
.
SimpleKubelet
(
...
@@ -245,7 +245,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
...
@@ -245,7 +245,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
// Kubelet (machine)
// Kubelet (machine)
// Create a second kubelet so that the guestbook example's two redis slaves both
// Create a second kubelet so that the guestbook example's two redis slaves both
// have a place they can schedule.
// have a place they can schedule.
testRootDir
=
integration
.
MakeTempDirOrDie
(
"kubelet_integ_2."
,
""
)
testRootDir
=
testutils
.
MakeTempDirOrDie
(
"kubelet_integ_2."
,
""
)
glog
.
Infof
(
"Using %s as root dir for kubelet #2"
,
testRootDir
)
glog
.
Infof
(
"Using %s as root dir for kubelet #2"
,
testRootDir
)
kcfg
=
kubeletapp
.
SimpleKubelet
(
kcfg
=
kubeletapp
.
SimpleKubelet
(
...
...
pkg/kubemark/hollow_kubelet.go
View file @
d82c3023
...
@@ -27,7 +27,7 @@ import (
...
@@ -27,7 +27,7 @@ import (
containertest
"k8s.io/kubernetes/pkg/kubelet/container/testing"
containertest
"k8s.io/kubernetes/pkg/kubelet/container/testing"
"k8s.io/kubernetes/pkg/kubelet/dockertools"
"k8s.io/kubernetes/pkg/kubelet/dockertools"
"k8s.io/kubernetes/pkg/volume/empty_dir"
"k8s.io/kubernetes/pkg/volume/empty_dir"
"k8s.io/kubernetes/test/
integration
"
"k8s.io/kubernetes/test/
utils
"
"github.com/golang/glog"
"github.com/golang/glog"
)
)
...
@@ -45,8 +45,8 @@ func NewHollowKubelet(
...
@@ -45,8 +45,8 @@ func NewHollowKubelet(
containerManager
cm
.
ContainerManager
,
containerManager
cm
.
ContainerManager
,
maxPods
int
,
podsPerCore
int
,
maxPods
int
,
podsPerCore
int
,
)
*
HollowKubelet
{
)
*
HollowKubelet
{
testRootDir
:=
integration
.
MakeTempDirOrDie
(
"hollow-kubelet."
,
""
)
testRootDir
:=
utils
.
MakeTempDirOrDie
(
"hollow-kubelet."
,
""
)
manifestFilePath
:=
integration
.
MakeTempDirOrDie
(
"manifest"
,
testRootDir
)
manifestFilePath
:=
utils
.
MakeTempDirOrDie
(
"manifest"
,
testRootDir
)
glog
.
Infof
(
"Using %s as root dir for hollow-kubelet"
,
testRootDir
)
glog
.
Infof
(
"Using %s as root dir for hollow-kubelet"
,
testRootDir
)
return
&
HollowKubelet
{
return
&
HollowKubelet
{
...
...
test/integration/utils.go
View file @
d82c3023
...
@@ -18,9 +18,7 @@ package integration
...
@@ -18,9 +18,7 @@ package integration
import
(
import
(
"fmt"
"fmt"
"io/ioutil"
"math/rand"
"math/rand"
"os"
"testing"
"testing"
etcd
"github.com/coreos/etcd/client"
etcd
"github.com/coreos/etcd/client"
...
@@ -67,20 +65,6 @@ func deleteAllEtcdKeys() {
...
@@ -67,20 +65,6 @@ func deleteAllEtcdKeys() {
}
}
func
MakeTempDirOrDie
(
prefix
string
,
baseDir
string
)
string
{
if
baseDir
==
""
{
baseDir
=
"/tmp"
}
tempDir
,
err
:=
ioutil
.
TempDir
(
baseDir
,
prefix
)
if
err
!=
nil
{
glog
.
Fatalf
(
"Can't make a temp rootdir: %v"
,
err
)
}
if
err
=
os
.
MkdirAll
(
tempDir
,
0750
);
err
!=
nil
{
glog
.
Fatalf
(
"Can't mkdir(%q): %v"
,
tempDir
,
err
)
}
return
tempDir
}
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
)
...
...
test/utils/tmpdir.go
0 → 100644
View file @
d82c3023
/*
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
utils
import
(
"io/ioutil"
"os"
"github.com/golang/glog"
)
func
MakeTempDirOrDie
(
prefix
string
,
baseDir
string
)
string
{
if
baseDir
==
""
{
baseDir
=
"/tmp"
}
tempDir
,
err
:=
ioutil
.
TempDir
(
baseDir
,
prefix
)
if
err
!=
nil
{
glog
.
Fatalf
(
"Can't make a temp rootdir: %v"
,
err
)
}
if
err
=
os
.
MkdirAll
(
tempDir
,
0750
);
err
!=
nil
{
glog
.
Fatalf
(
"Can't mkdir(%q): %v"
,
tempDir
,
err
)
}
return
tempDir
}
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