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
79373b69
Commit
79373b69
authored
Sep 13, 2016
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip kubectl tests (create quota and exit code) on not supported versions
parent
a26da7a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
util.go
test/e2e/framework/util.go
+10
-0
kubectl.go
test/e2e/kubectl.go
+13
-1
No files found.
test/e2e/framework/util.go
View file @
79373b69
...
@@ -1756,6 +1756,16 @@ func ServerVersionGTE(v semver.Version, c discovery.ServerVersionInterface) (boo
...
@@ -1756,6 +1756,16 @@ func ServerVersionGTE(v semver.Version, c discovery.ServerVersionInterface) (boo
return
sv
.
GTE
(
v
),
nil
return
sv
.
GTE
(
v
),
nil
}
}
func
SkipUnlessKubectlVersionGTE
(
v
semver
.
Version
)
{
gte
,
err
:=
KubectlVersionGTE
(
v
)
if
err
!=
nil
{
Failf
(
"Failed to get kubectl version: %v"
,
err
)
}
if
!
gte
{
Skipf
(
"Not supported for kubectl versions before %q"
,
v
)
}
}
// KubectlVersionGTE returns true if the kubectl version is greater than or
// KubectlVersionGTE returns true if the kubectl version is greater than or
// equal to v.
// equal to v.
func
KubectlVersionGTE
(
v
semver
.
Version
)
(
bool
,
error
)
{
func
KubectlVersionGTE
(
v
semver
.
Version
)
(
bool
,
error
)
{
...
...
test/e2e/kubectl.go
View file @
79373b69
...
@@ -119,11 +119,19 @@ var (
...
@@ -119,11 +119,19 @@ var (
// TODO(ihmccreery): remove once we don't care about v1.1 anymore, (tentatively in v1.4).
// TODO(ihmccreery): remove once we don't care about v1.1 anymore, (tentatively in v1.4).
deploymentsVersion
=
version
.
MustParse
(
"v1.2.0-alpha.7.726"
)
deploymentsVersion
=
version
.
MustParse
(
"v1.2.0-alpha.7.726"
)
// Pod probe parameters were introduced in #15967 (v1.2) so we dont expect tests that use
// Pod probe parameters were introduced in #15967 (v1.2) so we don
'
t expect tests that use
// these probe parameters to work on clusters before that.
// these probe parameters to work on clusters before that.
//
//
// TODO(ihmccreery): remove once we don't care about v1.1 anymore, (tentatively in v1.4).
// TODO(ihmccreery): remove once we don't care about v1.1 anymore, (tentatively in v1.4).
podProbeParametersVersion
=
version
.
MustParse
(
"v1.2.0-alpha.4"
)
podProbeParametersVersion
=
version
.
MustParse
(
"v1.2.0-alpha.4"
)
// 'kubectl create quota' was introduced in #28351 (v1.4) so we don't expect tests that use
// 'kubectl create quota' to work on kubectl clients before that.
kubectlCreateQuotaVersion
=
version
.
MustParse
(
"v1.4.0-alpha.2"
)
// Returning container command exit codes in kubectl run/exec was introduced in #26541 (v1.4)
// so we don't expect tests that verifies return code to work on kubectl clients before that.
kubectlContainerExitCodeVersion
=
version
.
MustParse
(
"v1.4.0-alpha.3"
)
)
)
// Stops everything from filePath from namespace ns and checks if everything matching selectors from the given namespace is correctly stopped.
// Stops everything from filePath from namespace ns and checks if everything matching selectors from the given namespace is correctly stopped.
...
@@ -351,6 +359,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
...
@@ -351,6 +359,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
})
})
It
(
"should return command exit codes"
,
func
()
{
It
(
"should return command exit codes"
,
func
()
{
framework
.
SkipUnlessKubectlVersionGTE
(
kubectlContainerExitCodeVersion
)
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
By
(
"execing into a container with a successful command"
)
By
(
"execing into a container with a successful command"
)
...
@@ -1316,6 +1325,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
...
@@ -1316,6 +1325,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
framework
.
KubeDescribe
(
"Kubectl create quota"
,
func
()
{
framework
.
KubeDescribe
(
"Kubectl create quota"
,
func
()
{
It
(
"should create a quota without scopes"
,
func
()
{
It
(
"should create a quota without scopes"
,
func
()
{
framework
.
SkipUnlessKubectlVersionGTE
(
kubectlCreateQuotaVersion
)
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
quotaName
:=
"million"
quotaName
:=
"million"
...
@@ -1345,6 +1355,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
...
@@ -1345,6 +1355,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
})
})
It
(
"should create a quota with scopes"
,
func
()
{
It
(
"should create a quota with scopes"
,
func
()
{
framework
.
SkipUnlessKubectlVersionGTE
(
kubectlCreateQuotaVersion
)
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
quotaName
:=
"scopes"
quotaName
:=
"scopes"
...
@@ -1373,6 +1384,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
...
@@ -1373,6 +1384,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
})
})
It
(
"should reject quota with invalid scopes"
,
func
()
{
It
(
"should reject quota with invalid scopes"
,
func
()
{
framework
.
SkipUnlessKubectlVersionGTE
(
kubectlCreateQuotaVersion
)
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
quotaName
:=
"scopes"
quotaName
:=
"scopes"
...
...
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