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
9bbcb5e3
Commit
9bbcb5e3
authored
Jun 20, 2016
by
gmarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dependency on test/integration from kubemark
parent
3b57f868
Hide 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 @
9bbcb5e3
...
...
@@ -64,8 +64,8 @@ import (
_
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithmprovider"
"k8s.io/kubernetes/plugin/pkg/scheduler/factory"
e2e
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/integration"
"k8s.io/kubernetes/test/integration/framework"
testutils
"k8s.io/kubernetes/test/utils"
etcd
"github.com/coreos/etcd/client"
"github.com/golang/glog"
...
...
@@ -210,8 +210,8 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
cadvisorInterface
:=
new
(
cadvisortest
.
Fake
)
// Kubelet (localhost)
testRootDir
:=
integration
.
MakeTempDirOrDie
(
"kubelet_integ_1."
,
""
)
configFilePath
:=
integration
.
MakeTempDirOrDie
(
"config"
,
testRootDir
)
testRootDir
:=
testutils
.
MakeTempDirOrDie
(
"kubelet_integ_1."
,
""
)
configFilePath
:=
testutils
.
MakeTempDirOrDie
(
"config"
,
testRootDir
)
glog
.
Infof
(
"Using %s as root dir for kubelet #1"
,
testRootDir
)
cm
:=
cm
.
NewStubContainerManager
()
kcfg
:=
kubeletapp
.
SimpleKubelet
(
...
...
@@ -245,7 +245,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
// Kubelet (machine)
// Create a second kubelet so that the guestbook example's two redis slaves both
// 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
)
kcfg
=
kubeletapp
.
SimpleKubelet
(
...
...
pkg/kubemark/hollow_kubelet.go
View file @
9bbcb5e3
...
...
@@ -27,7 +27,7 @@ import (
containertest
"k8s.io/kubernetes/pkg/kubelet/container/testing"
"k8s.io/kubernetes/pkg/kubelet/dockertools"
"k8s.io/kubernetes/pkg/volume/empty_dir"
"k8s.io/kubernetes/test/
integration
"
"k8s.io/kubernetes/test/
utils
"
"github.com/golang/glog"
)
...
...
@@ -45,8 +45,8 @@ func NewHollowKubelet(
containerManager
cm
.
ContainerManager
,
maxPods
int
,
podsPerCore
int
,
)
*
HollowKubelet
{
testRootDir
:=
integration
.
MakeTempDirOrDie
(
"hollow-kubelet."
,
""
)
manifestFilePath
:=
integration
.
MakeTempDirOrDie
(
"manifest"
,
testRootDir
)
testRootDir
:=
utils
.
MakeTempDirOrDie
(
"hollow-kubelet."
,
""
)
manifestFilePath
:=
utils
.
MakeTempDirOrDie
(
"manifest"
,
testRootDir
)
glog
.
Infof
(
"Using %s as root dir for hollow-kubelet"
,
testRootDir
)
return
&
HollowKubelet
{
...
...
test/integration/utils.go
View file @
9bbcb5e3
...
...
@@ -18,9 +18,7 @@ package integration
import
(
"fmt"
"io/ioutil"
"math/rand"
"os"
"testing"
etcd
"github.com/coreos/etcd/client"
...
...
@@ -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
)
{
if
err
:=
c
.
Pods
(
ns
)
.
Delete
(
name
,
nil
);
err
!=
nil
{
t
.
Errorf
(
"unable to delete pod %v: %v"
,
name
,
err
)
...
...
test/utils/tmpdir.go
0 → 100644
View file @
9bbcb5e3
/*
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