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
090809d8
Commit
090809d8
authored
Nov 14, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dependency on kubelet related flags.
parent
08204bea
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
24 deletions
+29
-24
test_context.go
test/e2e/framework/test_context.go
+4
-0
cgroup_manager_test.go
test/e2e_node/cgroup_manager_test.go
+6
-6
disk_eviction_test.go
test/e2e_node/disk_eviction_test.go
+1
-1
e2e_node_suite_test.go
test/e2e_node/e2e_node_suite_test.go
+12
-12
mirror_pod_test.go
test/e2e_node/mirror_pod_test.go
+6
-4
services.go
test/e2e_node/services/services.go
+0
-1
No files found.
test/e2e/framework/test_context.go
View file @
090809d8
...
...
@@ -23,6 +23,7 @@ import (
"github.com/onsi/ginkgo/config"
"github.com/spf13/viper"
"k8s.io/kubernetes/pkg/apis/componentconfig"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
"k8s.io/kubernetes/pkg/cloudprovider"
)
...
...
@@ -125,6 +126,9 @@ type NodeTestContextType struct {
ContainerRuntimeEndpoint
string
// MounterPath is the path to the program to run to perform a mount
MounterPath
string
// KubeletConfig is the kubelet configuration the test is running against.
// TODO(random-liu): Remove kubelet configuration related fields above after removing kubelet start logic out.
KubeletConfig
componentconfig
.
KubeletConfiguration
}
type
CloudConfig
struct
{
...
...
test/e2e_node/cgroup_manager_test.go
View file @
090809d8
...
...
@@ -54,7 +54,7 @@ func makePodToVerifyCgroups(cgroupNames []cm.CgroupName) *api.Pod {
// convert the names to their literal cgroupfs forms...
cgroupFsNames
:=
[]
string
{}
for
_
,
cgroupName
:=
range
cgroupNames
{
if
framework
.
TestContext
.
CgroupDriver
==
"systemd"
{
if
framework
.
TestContext
.
KubeletConfig
.
CgroupDriver
==
"systemd"
{
cgroupFsNames
=
append
(
cgroupFsNames
,
cm
.
ConvertCgroupNameToSystemd
(
cgroupName
,
true
))
}
else
{
cgroupFsNames
=
append
(
cgroupFsNames
,
string
(
cgroupName
))
...
...
@@ -103,7 +103,7 @@ func makePodToVerifyCgroups(cgroupNames []cm.CgroupName) *api.Pod {
// makePodToVerifyCgroupRemoved verfies the specified cgroup does not exist.
func
makePodToVerifyCgroupRemoved
(
cgroupName
cm
.
CgroupName
)
*
api
.
Pod
{
cgroupFsName
:=
string
(
cgroupName
)
if
framework
.
TestContext
.
CgroupDriver
==
"systemd"
{
if
framework
.
TestContext
.
KubeletConfig
.
CgroupDriver
==
"systemd"
{
cgroupFsName
=
cm
.
ConvertCgroupNameToSystemd
(
cm
.
CgroupName
(
cgroupName
),
true
)
}
pod
:=
&
api
.
Pod
{
...
...
@@ -143,7 +143,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
Describe
(
"QOS containers"
,
func
()
{
Context
(
"On enabling QOS cgroup hierarchy"
,
func
()
{
It
(
"Top level QoS containers should have been created"
,
func
()
{
if
!
framework
.
TestContext
.
CgroupsPerQOS
{
if
!
framework
.
TestContext
.
KubeletConfig
.
Experimental
CgroupsPerQOS
{
return
}
cgroupsToVerify
:=
[]
cm
.
CgroupName
{
cm
.
CgroupName
(
qos
.
Burstable
),
cm
.
CgroupName
(
qos
.
BestEffort
)}
...
...
@@ -158,7 +158,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
Describe
(
"Pod containers"
,
func
()
{
Context
(
"On scheduling a Guaranteed Pod"
,
func
()
{
It
(
"Pod containers should have been created under the cgroup-root"
,
func
()
{
if
!
framework
.
TestContext
.
CgroupsPerQOS
{
if
!
framework
.
TestContext
.
KubeletConfig
.
Experimental
CgroupsPerQOS
{
return
}
var
(
...
...
@@ -202,7 +202,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
})
Context
(
"On scheduling a BestEffort Pod"
,
func
()
{
It
(
"Pod containers should have been created under the BestEffort cgroup"
,
func
()
{
if
!
framework
.
TestContext
.
CgroupsPerQOS
{
if
!
framework
.
TestContext
.
KubeletConfig
.
Experimental
CgroupsPerQOS
{
return
}
var
(
...
...
@@ -246,7 +246,7 @@ var _ = framework.KubeDescribe("Kubelet Cgroup Manager", func() {
})
Context
(
"On scheduling a Burstable Pod"
,
func
()
{
It
(
"Pod containers should have been created under the Burstable cgroup"
,
func
()
{
if
!
framework
.
TestContext
.
CgroupsPerQOS
{
if
!
framework
.
TestContext
.
KubeletConfig
.
Experimental
CgroupsPerQOS
{
return
}
var
(
...
...
test/e2e_node/disk_eviction_test.go
View file @
090809d8
...
...
@@ -223,7 +223,7 @@ func nodeHasDiskPressure(cs clientset.Interface) bool {
}
func
evictionOptionIsSet
()
bool
{
return
len
(
framework
.
TestContext
.
EvictionHard
)
>
0
return
len
(
framework
.
TestContext
.
KubeletConfig
.
EvictionHard
)
>
0
}
// TODO(random-liu): Use OSImage in node status to do the check.
...
...
test/e2e_node/e2e_node_suite_test.go
View file @
090809d8
...
...
@@ -20,7 +20,6 @@ package e2e_node
import
(
"bytes"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
...
...
@@ -151,15 +150,8 @@ var _ = SynchronizedBeforeSuite(func() []byte {
// Reference common test to make the import valid.
commontest
.
CurrentSuite
=
commontest
.
NodeE2E
data
,
err
:=
json
.
Marshal
(
&
framework
.
TestContext
.
NodeTestContextType
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"should be able to serialize node test context."
)
return
data
},
func
(
data
[]
byte
)
{
// The node test context is updated in the first function, update it on every test node.
err
:=
json
.
Unmarshal
(
data
,
&
framework
.
TestContext
.
NodeTestContextType
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"should be able to deserialize node test context."
)
return
nil
},
func
([]
byte
)
{
// update test context with node configuration.
Expect
(
updateTestContext
())
.
To
(
Succeed
(),
"update test context with node config."
)
})
...
...
@@ -235,12 +227,20 @@ func updateTestContext() error {
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to get apiserver client: %v"
,
err
)
}
// Update test context with current node object.
node
,
err
:=
getNode
(
client
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to get node: %v"
,
err
)
}
// Initialize the node name
framework
.
TestContext
.
NodeName
=
node
.
Name
framework
.
TestContext
.
NodeName
=
node
.
Name
// Set node name.
// Update test context with current kubelet configuration.
// This assumes all tests which dynamically change kubelet configuration
// must: 1) run in serial; 2) restore kubelet configuration after test.
kubeletCfg
,
err
:=
getCurrentKubeletConfig
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to get kubelet configuration: %v"
,
err
)
}
framework
.
TestContext
.
KubeletConfig
=
*
kubeletCfg
// Set kubelet config.
return
nil
}
...
...
test/e2e_node/mirror_pod_test.go
View file @
090809d8
...
...
@@ -37,14 +37,16 @@ import (
var
_
=
framework
.
KubeDescribe
(
"MirrorPod"
,
func
()
{
f
:=
framework
.
NewDefaultFramework
(
"mirror-pod"
)
Context
(
"when create a mirror pod "
,
func
()
{
var
ns
,
staticPodName
,
mirrorPodName
string
var
ns
,
manifestPath
,
staticPodName
,
mirrorPodName
string
BeforeEach
(
func
()
{
ns
=
f
.
Namespace
.
Name
staticPodName
=
"static-pod-"
+
string
(
uuid
.
NewUUID
())
mirrorPodName
=
staticPodName
+
"-"
+
framework
.
TestContext
.
NodeName
manifestPath
=
framework
.
TestContext
.
KubeletConfig
.
PodManifestPath
By
(
"create the static pod"
)
err
:=
createStaticPod
(
framework
.
TestContext
.
M
anifestPath
,
staticPodName
,
ns
,
err
:=
createStaticPod
(
m
anifestPath
,
staticPodName
,
ns
,
"gcr.io/google_containers/nginx-slim:0.7"
,
api
.
RestartPolicyAlways
)
Expect
(
err
)
.
ShouldNot
(
HaveOccurred
())
...
...
@@ -61,7 +63,7 @@ var _ = framework.KubeDescribe("MirrorPod", func() {
By
(
"update the static pod container image"
)
image
:=
framework
.
GetPauseImageNameForHostArch
()
err
=
createStaticPod
(
framework
.
TestContext
.
M
anifestPath
,
staticPodName
,
ns
,
image
,
api
.
RestartPolicyAlways
)
err
=
createStaticPod
(
m
anifestPath
,
staticPodName
,
ns
,
image
,
api
.
RestartPolicyAlways
)
Expect
(
err
)
.
ShouldNot
(
HaveOccurred
())
By
(
"wait for the mirror pod to be updated"
)
...
...
@@ -107,7 +109,7 @@ var _ = framework.KubeDescribe("MirrorPod", func() {
})
AfterEach
(
func
()
{
By
(
"delete the static pod"
)
err
:=
deleteStaticPod
(
framework
.
TestContext
.
M
anifestPath
,
staticPodName
,
ns
)
err
:=
deleteStaticPod
(
m
anifestPath
,
staticPodName
,
ns
)
Expect
(
err
)
.
ShouldNot
(
HaveOccurred
())
By
(
"wait for the mirror pod to disappear"
)
...
...
test/e2e_node/services/services.go
View file @
090809d8
...
...
@@ -209,7 +209,6 @@ func (e *E2EServices) startKubelet() (*server, error) {
"--eviction-pressure-transition-period"
,
"30s"
,
"--feature-gates"
,
framework
.
TestContext
.
FeatureGates
,
"--v"
,
LOG_VERBOSITY_LEVEL
,
"--logtostderr"
,
"--experimental-mounter-path"
,
framework
.
TestContext
.
MounterPath
,
)
if
framework
.
TestContext
.
NodeName
!=
""
{
// If node name is specified, set hostname override.
...
...
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