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
8f5a62af
Unverified
Commit
8f5a62af
authored
May 01, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #77159 from draveness/feature/refactor-expect-no-errors
refactor: use framework.ExpectNoError instead in e2e tests
parents
ebe32557
04bb797f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
41 additions
and
45 deletions
+41
-45
resource_quota.go
test/e2e/apimachinery/resource_quota.go
+0
-0
BUILD
test/e2e/instrumentation/logging/elasticsearch/BUILD
+0
-1
kibana.go
test/e2e/instrumentation/logging/elasticsearch/kibana.go
+4
-5
kubectl.go
test/e2e/kubectl/kubectl.go
+10
-10
podpreset.go
test/e2e/servicecatalog/podpreset.go
+2
-2
BUILD
test/e2e/ui/BUILD
+0
-1
dashboard.go
test/e2e/ui/dashboard.go
+3
-4
cassandra.go
test/e2e/upgrades/cassandra.go
+4
-4
etcd.go
test/e2e/upgrades/etcd.go
+4
-4
mysql.go
test/e2e/upgrades/mysql.go
+4
-4
nvidia-gpu.go
test/e2e/upgrades/nvidia-gpu.go
+5
-5
sysctl.go
test/e2e/upgrades/sysctl.go
+4
-4
density.go
test/e2e/windows/density.go
+1
-1
No files found.
test/e2e/apimachinery/resource_quota.go
View file @
8f5a62af
This diff is collapsed.
Click to expand it.
test/e2e/instrumentation/logging/elasticsearch/BUILD
View file @
8f5a62af
...
@@ -23,7 +23,6 @@ go_library(
...
@@ -23,7 +23,6 @@ go_library(
"//test/e2e/instrumentation/common:go_default_library",
"//test/e2e/instrumentation/common:go_default_library",
"//test/e2e/instrumentation/logging/utils:go_default_library",
"//test/e2e/instrumentation/logging/utils:go_default_library",
"//vendor/github.com/onsi/ginkgo:go_default_library",
"//vendor/github.com/onsi/ginkgo:go_default_library",
"//vendor/github.com/onsi/gomega:go_default_library",
],
],
)
)
...
...
test/e2e/instrumentation/logging/elasticsearch/kibana.go
View file @
8f5a62af
...
@@ -26,7 +26,6 @@ import (
...
@@ -26,7 +26,6 @@ import (
instrumentation
"k8s.io/kubernetes/test/e2e/instrumentation/common"
instrumentation
"k8s.io/kubernetes/test/e2e/instrumentation/common"
"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/util/wait"
)
)
...
@@ -67,17 +66,17 @@ func ClusterLevelLoggingWithKibana(f *framework.Framework) {
...
@@ -67,17 +66,17 @@ func ClusterLevelLoggingWithKibana(f *framework.Framework) {
}
}
return
true
,
nil
return
true
,
nil
})
})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
// Wait for the Kibana pod(s) to enter the running state.
// Wait for the Kibana pod(s) to enter the running state.
ginkgo
.
By
(
"Checking to make sure the Kibana pods are running"
)
ginkgo
.
By
(
"Checking to make sure the Kibana pods are running"
)
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
kibanaKey
:
kibanaValue
}))
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
kibanaKey
:
kibanaValue
}))
options
:=
metav1
.
ListOptions
{
LabelSelector
:
label
.
String
()}
options
:=
metav1
.
ListOptions
{
LabelSelector
:
label
.
String
()}
pods
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Pods
(
metav1
.
NamespaceSystem
)
.
List
(
options
)
pods
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Pods
(
metav1
.
NamespaceSystem
)
.
List
(
options
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
for
_
,
pod
:=
range
pods
.
Items
{
for
_
,
pod
:=
range
pods
.
Items
{
err
=
framework
.
WaitForPodRunningInNamespace
(
f
.
ClientSet
,
&
pod
)
err
=
framework
.
WaitForPodRunningInNamespace
(
f
.
ClientSet
,
&
pod
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
}
}
ginkgo
.
By
(
"Checking to make sure we get a response from the Kibana UI."
)
ginkgo
.
By
(
"Checking to make sure we get a response from the Kibana UI."
)
...
@@ -101,5 +100,5 @@ func ClusterLevelLoggingWithKibana(f *framework.Framework) {
...
@@ -101,5 +100,5 @@ func ClusterLevelLoggingWithKibana(f *framework.Framework) {
}
}
return
true
,
nil
return
true
,
nil
})
})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
}
}
test/e2e/kubectl/kubectl.go
View file @
8f5a62af
...
@@ -141,7 +141,7 @@ func runKubectlRetryOrDie(args ...string) string {
...
@@ -141,7 +141,7 @@ func runKubectlRetryOrDie(args ...string) string {
// Expect no errors to be present after retries are finished
// Expect no errors to be present after retries are finished
// Copied from framework #ExecOrDie
// Copied from framework #ExecOrDie
framework
.
Logf
(
"stdout: %q"
,
output
)
framework
.
Logf
(
"stdout: %q"
,
output
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
return
output
return
output
}
}
...
@@ -945,7 +945,7 @@ metadata:
...
@@ -945,7 +945,7 @@ metadata:
*/
*/
framework
.
ConformanceIt
(
"should check if kubectl describe prints relevant information for rc and pods "
,
func
()
{
framework
.
ConformanceIt
(
"should check if kubectl describe prints relevant information for rc and pods "
,
func
()
{
kv
,
err
:=
framework
.
KubectlVersion
()
kv
,
err
:=
framework
.
KubectlVersion
()
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
framework
.
SkipUnlessServerVersionGTE
(
kv
,
c
.
Discovery
())
framework
.
SkipUnlessServerVersionGTE
(
kv
,
c
.
Discovery
())
controllerJSON
:=
commonutils
.
SubstituteImageName
(
string
(
readTestFileOrDie
(
redisControllerFilename
)))
controllerJSON
:=
commonutils
.
SubstituteImageName
(
string
(
readTestFileOrDie
(
redisControllerFilename
)))
serviceJSON
:=
readTestFileOrDie
(
redisServiceFilename
)
serviceJSON
:=
readTestFileOrDie
(
redisServiceFilename
)
...
@@ -1011,7 +1011,7 @@ metadata:
...
@@ -1011,7 +1011,7 @@ metadata:
// Node
// Node
// It should be OK to list unschedulable Nodes here.
// It should be OK to list unschedulable Nodes here.
nodes
,
err
:=
c
.
CoreV1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{})
nodes
,
err
:=
c
.
CoreV1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
node
:=
nodes
.
Items
[
0
]
node
:=
nodes
.
Items
[
0
]
output
=
framework
.
RunKubectlOrDie
(
"describe"
,
"node"
,
node
.
Name
)
output
=
framework
.
RunKubectlOrDie
(
"describe"
,
"node"
,
node
.
Name
)
requiredStrings
=
[][]
string
{
requiredStrings
=
[][]
string
{
...
@@ -1100,10 +1100,10 @@ metadata:
...
@@ -1100,10 +1100,10 @@ metadata:
}
}
return
true
,
nil
return
true
,
nil
})
})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
service
,
err
:=
c
.
CoreV1
()
.
Services
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
service
,
err
:=
c
.
CoreV1
()
.
Services
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
if
len
(
service
.
Spec
.
Ports
)
!=
1
{
if
len
(
service
.
Spec
.
Ports
)
!=
1
{
framework
.
Failf
(
"1 port is expected"
)
framework
.
Failf
(
"1 port is expected"
)
...
@@ -1247,7 +1247,7 @@ metadata:
...
@@ -1247,7 +1247,7 @@ metadata:
forEachPod
(
func
(
pod
v1
.
Pod
)
{
forEachPod
(
func
(
pod
v1
.
Pod
)
{
ginkgo
.
By
(
"checking for a matching strings"
)
ginkgo
.
By
(
"checking for a matching strings"
)
_
,
err
:=
framework
.
LookForStringInLog
(
ns
,
pod
.
Name
,
containerName
,
"The server is now ready to accept connections"
,
framework
.
PodStartTimeout
)
_
,
err
:=
framework
.
LookForStringInLog
(
ns
,
pod
.
Name
,
containerName
,
"The server is now ready to accept connections"
,
framework
.
PodStartTimeout
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
ginkgo
.
By
(
"limiting log lines"
)
ginkgo
.
By
(
"limiting log lines"
)
out
:=
framework
.
RunKubectlOrDie
(
"log"
,
pod
.
Name
,
containerName
,
nsFlag
,
"--tail=1"
)
out
:=
framework
.
RunKubectlOrDie
(
"log"
,
pod
.
Name
,
containerName
,
nsFlag
,
"--tail=1"
)
...
@@ -1495,7 +1495,7 @@ metadata:
...
@@ -1495,7 +1495,7 @@ metadata:
}
}
return
true
,
nil
return
true
,
nil
})
})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
})
})
/*
/*
...
@@ -1712,7 +1712,7 @@ metadata:
...
@@ -1712,7 +1712,7 @@ metadata:
gomega
.
Expect
(
runOutput
)
.
To
(
gomega
.
ContainSubstring
(
"stdin closed"
))
gomega
.
Expect
(
runOutput
)
.
To
(
gomega
.
ContainSubstring
(
"stdin closed"
))
err
:=
jobutil
.
WaitForJobGone
(
c
,
ns
,
jobName
,
wait
.
ForeverTestTimeout
)
err
:=
jobutil
.
WaitForJobGone
(
c
,
ns
,
jobName
,
wait
.
ForeverTestTimeout
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
ginkgo
.
By
(
"verifying the job "
+
jobName
+
" was deleted"
)
ginkgo
.
By
(
"verifying the job "
+
jobName
+
" was deleted"
)
_
,
err
=
c
.
BatchV1
()
.
Jobs
(
ns
)
.
Get
(
jobName
,
metav1
.
GetOptions
{})
_
,
err
=
c
.
BatchV1
()
.
Jobs
(
ns
)
.
Get
(
jobName
,
metav1
.
GetOptions
{})
...
@@ -2073,7 +2073,7 @@ func validateGuestbookApp(c clientset.Interface, ns string) {
...
@@ -2073,7 +2073,7 @@ func validateGuestbookApp(c clientset.Interface, ns string) {
framework
.
Logf
(
"Waiting for all frontend pods to be Running."
)
framework
.
Logf
(
"Waiting for all frontend pods to be Running."
)
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"tier"
:
"frontend"
,
"app"
:
"guestbook"
}))
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"tier"
:
"frontend"
,
"app"
:
"guestbook"
}))
err
:=
testutils
.
WaitForPodsWithLabelRunning
(
c
,
ns
,
label
)
err
:=
testutils
.
WaitForPodsWithLabelRunning
(
c
,
ns
,
label
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
framework
.
Logf
(
"Waiting for frontend to serve content."
)
framework
.
Logf
(
"Waiting for frontend to serve content."
)
if
!
waitForGuestbookResponse
(
c
,
"get"
,
""
,
`{"data": ""}`
,
guestbookStartupTimeout
,
ns
)
{
if
!
waitForGuestbookResponse
(
c
,
"get"
,
""
,
`{"data": ""}`
,
guestbookStartupTimeout
,
ns
)
{
framework
.
Failf
(
"Frontend service did not start serving content in %v seconds."
,
guestbookStartupTimeout
.
Seconds
())
framework
.
Failf
(
"Frontend service did not start serving content in %v seconds."
,
guestbookStartupTimeout
.
Seconds
())
...
@@ -2158,7 +2158,7 @@ func forEachReplicationController(c clientset.Interface, ns, selectorKey, select
...
@@ -2158,7 +2158,7 @@ func forEachReplicationController(c clientset.Interface, ns, selectorKey, select
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
selectorKey
:
selectorValue
}))
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
selectorKey
:
selectorValue
}))
options
:=
metav1
.
ListOptions
{
LabelSelector
:
label
.
String
()}
options
:=
metav1
.
ListOptions
{
LabelSelector
:
label
.
String
()}
rcs
,
err
=
c
.
CoreV1
()
.
ReplicationControllers
(
ns
)
.
List
(
options
)
rcs
,
err
=
c
.
CoreV1
()
.
ReplicationControllers
(
ns
)
.
List
(
options
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
if
len
(
rcs
.
Items
)
>
0
{
if
len
(
rcs
.
Items
)
>
0
{
break
break
}
}
...
...
test/e2e/servicecatalog/podpreset.go
View file @
8f5a62af
...
@@ -77,7 +77,7 @@ var _ = SIGDescribe("[Feature:PodPreset] PodPreset", func() {
...
@@ -77,7 +77,7 @@ var _ = SIGDescribe("[Feature:PodPreset] PodPreset", func() {
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
framework
.
Skipf
(
"podpresets requires k8s.io/api/settings/v1alpha1 to be enabled"
)
framework
.
Skipf
(
"podpresets requires k8s.io/api/settings/v1alpha1 to be enabled"
)
}
}
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
ginkgo
.
By
(
"creating the pod"
)
ginkgo
.
By
(
"creating the pod"
)
name
:=
"pod-preset-pod"
name
:=
"pod-preset-pod"
...
@@ -195,7 +195,7 @@ var _ = SIGDescribe("[Feature:PodPreset] PodPreset", func() {
...
@@ -195,7 +195,7 @@ var _ = SIGDescribe("[Feature:PodPreset] PodPreset", func() {
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
framework
.
Skipf
(
"podpresets requires k8s.io/api/settings/v1alpha1 to be enabled"
)
framework
.
Skipf
(
"podpresets requires k8s.io/api/settings/v1alpha1 to be enabled"
)
}
}
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
ginkgo
.
By
(
"creating the pod"
)
ginkgo
.
By
(
"creating the pod"
)
name
:=
"pod-preset-pod"
name
:=
"pod-preset-pod"
...
...
test/e2e/ui/BUILD
View file @
8f5a62af
...
@@ -16,7 +16,6 @@ go_library(
...
@@ -16,7 +16,6 @@ go_library(
"//test/e2e/framework:go_default_library",
"//test/e2e/framework:go_default_library",
"//test/utils:go_default_library",
"//test/utils:go_default_library",
"//vendor/github.com/onsi/ginkgo:go_default_library",
"//vendor/github.com/onsi/ginkgo:go_default_library",
"//vendor/github.com/onsi/gomega:go_default_library",
],
],
)
)
...
...
test/e2e/ui/dashboard.go
View file @
8f5a62af
...
@@ -29,7 +29,6 @@ import (
...
@@ -29,7 +29,6 @@ import (
testutils
"k8s.io/kubernetes/test/utils"
testutils
"k8s.io/kubernetes/test/utils"
"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
)
)
var
_
=
SIGDescribe
(
"Kubernetes Dashboard"
,
func
()
{
var
_
=
SIGDescribe
(
"Kubernetes Dashboard"
,
func
()
{
...
@@ -52,12 +51,12 @@ var _ = SIGDescribe("Kubernetes Dashboard", func() {
...
@@ -52,12 +51,12 @@ var _ = SIGDescribe("Kubernetes Dashboard", func() {
ginkgo
.
It
(
"should check that the kubernetes-dashboard instance is alive"
,
func
()
{
ginkgo
.
It
(
"should check that the kubernetes-dashboard instance is alive"
,
func
()
{
ginkgo
.
By
(
"Checking whether the kubernetes-dashboard service exists."
)
ginkgo
.
By
(
"Checking whether the kubernetes-dashboard service exists."
)
err
:=
framework
.
WaitForService
(
f
.
ClientSet
,
uiNamespace
,
uiServiceName
,
true
,
framework
.
Poll
,
framework
.
ServiceStartTimeout
)
err
:=
framework
.
WaitForService
(
f
.
ClientSet
,
uiNamespace
,
uiServiceName
,
true
,
framework
.
Poll
,
framework
.
ServiceStartTimeout
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
ginkgo
.
By
(
"Checking to make sure the kubernetes-dashboard pods are running"
)
ginkgo
.
By
(
"Checking to make sure the kubernetes-dashboard pods are running"
)
selector
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"k8s-app"
:
uiAppName
}))
selector
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"k8s-app"
:
uiAppName
}))
err
=
testutils
.
WaitForPodsWithLabelRunning
(
f
.
ClientSet
,
uiNamespace
,
selector
)
err
=
testutils
.
WaitForPodsWithLabelRunning
(
f
.
ClientSet
,
uiNamespace
,
selector
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
ginkgo
.
By
(
"Checking to make sure we get a response from the kubernetes-dashboard."
)
ginkgo
.
By
(
"Checking to make sure we get a response from the kubernetes-dashboard."
)
err
=
wait
.
Poll
(
framework
.
Poll
,
serverStartTimeout
,
func
()
(
bool
,
error
)
{
err
=
wait
.
Poll
(
framework
.
Poll
,
serverStartTimeout
,
func
()
(
bool
,
error
)
{
...
@@ -90,6 +89,6 @@ var _ = SIGDescribe("Kubernetes Dashboard", func() {
...
@@ -90,6 +89,6 @@ var _ = SIGDescribe("Kubernetes Dashboard", func() {
// Don't return err here as it aborts polling.
// Don't return err here as it aborts polling.
return
status
==
http
.
StatusOK
,
nil
return
status
==
http
.
StatusOK
,
nil
})
})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
})
})
})
})
test/e2e/upgrades/cassandra.go
View file @
8f5a62af
...
@@ -95,7 +95,7 @@ func (t *CassandraUpgradeTest) Setup(f *framework.Framework) {
...
@@ -95,7 +95,7 @@ func (t *CassandraUpgradeTest) Setup(f *framework.Framework) {
}
}
return
true
,
nil
return
true
,
nil
})
})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
framework
.
Logf
(
"Service endpoint is up"
)
framework
.
Logf
(
"Service endpoint is up"
)
ginkgo
.
By
(
"Adding 2 dummy users"
)
ginkgo
.
By
(
"Adding 2 dummy users"
)
...
@@ -105,7 +105,7 @@ func (t *CassandraUpgradeTest) Setup(f *framework.Framework) {
...
@@ -105,7 +105,7 @@ func (t *CassandraUpgradeTest) Setup(f *framework.Framework) {
ginkgo
.
By
(
"Verifying that the users exist"
)
ginkgo
.
By
(
"Verifying that the users exist"
)
users
,
err
:=
t
.
listUsers
()
users
,
err
:=
t
.
listUsers
()
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
gomega
.
Expect
(
len
(
users
))
.
To
(
gomega
.
Equal
(
2
))
gomega
.
Expect
(
len
(
users
))
.
To
(
gomega
.
Equal
(
2
))
}
}
...
@@ -151,7 +151,7 @@ func (t *CassandraUpgradeTest) addUser(name string) error {
...
@@ -151,7 +151,7 @@ func (t *CassandraUpgradeTest) addUser(name string) error {
// getServiceIP is a helper method to extract the Ingress IP from the service.
// getServiceIP is a helper method to extract the Ingress IP from the service.
func
(
t
*
CassandraUpgradeTest
)
getServiceIP
(
f
*
framework
.
Framework
,
ns
,
svcName
string
)
string
{
func
(
t
*
CassandraUpgradeTest
)
getServiceIP
(
f
*
framework
.
Framework
,
ns
,
svcName
string
)
string
{
svc
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Services
(
ns
)
.
Get
(
svcName
,
metav1
.
GetOptions
{})
svc
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Services
(
ns
)
.
Get
(
svcName
,
metav1
.
GetOptions
{})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
ingress
:=
svc
.
Status
.
LoadBalancer
.
Ingress
ingress
:=
svc
.
Status
.
LoadBalancer
.
Ingress
if
len
(
ingress
)
==
0
{
if
len
(
ingress
)
==
0
{
return
""
return
""
...
@@ -212,6 +212,6 @@ func (t *CassandraUpgradeTest) Test(f *framework.Framework, done <-chan struct{}
...
@@ -212,6 +212,6 @@ func (t *CassandraUpgradeTest) Test(f *framework.Framework, done <-chan struct{}
// Teardown does one final check of the data's availability.
// Teardown does one final check of the data's availability.
func
(
t
*
CassandraUpgradeTest
)
Teardown
(
f
*
framework
.
Framework
)
{
func
(
t
*
CassandraUpgradeTest
)
Teardown
(
f
*
framework
.
Framework
)
{
users
,
err
:=
t
.
listUsers
()
users
,
err
:=
t
.
listUsers
()
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
gomega
.
Expect
(
len
(
users
)
>=
t
.
successfulWrites
)
.
To
(
gomega
.
BeTrue
())
gomega
.
Expect
(
len
(
users
)
>=
t
.
successfulWrites
)
.
To
(
gomega
.
BeTrue
())
}
}
test/e2e/upgrades/etcd.go
View file @
8f5a62af
...
@@ -90,7 +90,7 @@ func (t *EtcdUpgradeTest) Setup(f *framework.Framework) {
...
@@ -90,7 +90,7 @@ func (t *EtcdUpgradeTest) Setup(f *framework.Framework) {
}
}
return
true
,
nil
return
true
,
nil
})
})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
framework
.
Logf
(
"Service endpoint is up"
)
framework
.
Logf
(
"Service endpoint is up"
)
ginkgo
.
By
(
"Adding 2 dummy users"
)
ginkgo
.
By
(
"Adding 2 dummy users"
)
...
@@ -100,7 +100,7 @@ func (t *EtcdUpgradeTest) Setup(f *framework.Framework) {
...
@@ -100,7 +100,7 @@ func (t *EtcdUpgradeTest) Setup(f *framework.Framework) {
ginkgo
.
By
(
"Verifying that the users exist"
)
ginkgo
.
By
(
"Verifying that the users exist"
)
users
,
err
:=
t
.
listUsers
()
users
,
err
:=
t
.
listUsers
()
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
gomega
.
Expect
(
len
(
users
))
.
To
(
gomega
.
Equal
(
2
))
gomega
.
Expect
(
len
(
users
))
.
To
(
gomega
.
Equal
(
2
))
}
}
...
@@ -143,7 +143,7 @@ func (t *EtcdUpgradeTest) addUser(name string) error {
...
@@ -143,7 +143,7 @@ func (t *EtcdUpgradeTest) addUser(name string) error {
func
(
t
*
EtcdUpgradeTest
)
getServiceIP
(
f
*
framework
.
Framework
,
ns
,
svcName
string
)
string
{
func
(
t
*
EtcdUpgradeTest
)
getServiceIP
(
f
*
framework
.
Framework
,
ns
,
svcName
string
)
string
{
svc
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Services
(
ns
)
.
Get
(
svcName
,
metav1
.
GetOptions
{})
svc
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Services
(
ns
)
.
Get
(
svcName
,
metav1
.
GetOptions
{})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
ingress
:=
svc
.
Status
.
LoadBalancer
.
Ingress
ingress
:=
svc
.
Status
.
LoadBalancer
.
Ingress
if
len
(
ingress
)
==
0
{
if
len
(
ingress
)
==
0
{
return
""
return
""
...
@@ -200,6 +200,6 @@ func (t *EtcdUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upg
...
@@ -200,6 +200,6 @@ func (t *EtcdUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, upg
// Teardown does one final check of the data's availability.
// Teardown does one final check of the data's availability.
func
(
t
*
EtcdUpgradeTest
)
Teardown
(
f
*
framework
.
Framework
)
{
func
(
t
*
EtcdUpgradeTest
)
Teardown
(
f
*
framework
.
Framework
)
{
users
,
err
:=
t
.
listUsers
()
users
,
err
:=
t
.
listUsers
()
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
gomega
.
Expect
(
len
(
users
)
>=
t
.
successfulWrites
)
.
To
(
gomega
.
BeTrue
())
gomega
.
Expect
(
len
(
users
)
>=
t
.
successfulWrites
)
.
To
(
gomega
.
BeTrue
())
}
}
test/e2e/upgrades/mysql.go
View file @
8f5a62af
...
@@ -67,7 +67,7 @@ func mysqlKubectlCreate(ns, file string) {
...
@@ -67,7 +67,7 @@ func mysqlKubectlCreate(ns, file string) {
func
(
t
*
MySQLUpgradeTest
)
getServiceIP
(
f
*
framework
.
Framework
,
ns
,
svcName
string
)
string
{
func
(
t
*
MySQLUpgradeTest
)
getServiceIP
(
f
*
framework
.
Framework
,
ns
,
svcName
string
)
string
{
svc
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Services
(
ns
)
.
Get
(
svcName
,
metav1
.
GetOptions
{})
svc
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Services
(
ns
)
.
Get
(
svcName
,
metav1
.
GetOptions
{})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
ingress
:=
svc
.
Status
.
LoadBalancer
.
Ingress
ingress
:=
svc
.
Status
.
LoadBalancer
.
Ingress
if
len
(
ingress
)
==
0
{
if
len
(
ingress
)
==
0
{
return
""
return
""
...
@@ -105,7 +105,7 @@ func (t *MySQLUpgradeTest) Setup(f *framework.Framework) {
...
@@ -105,7 +105,7 @@ func (t *MySQLUpgradeTest) Setup(f *framework.Framework) {
}
}
return
true
,
nil
return
true
,
nil
})
})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
framework
.
Logf
(
"Service endpoint is up"
)
framework
.
Logf
(
"Service endpoint is up"
)
ginkgo
.
By
(
"Adding 2 names to the database"
)
ginkgo
.
By
(
"Adding 2 names to the database"
)
...
@@ -114,7 +114,7 @@ func (t *MySQLUpgradeTest) Setup(f *framework.Framework) {
...
@@ -114,7 +114,7 @@ func (t *MySQLUpgradeTest) Setup(f *framework.Framework) {
ginkgo
.
By
(
"Verifying that the 2 names have been inserted"
)
ginkgo
.
By
(
"Verifying that the 2 names have been inserted"
)
count
,
err
:=
t
.
countNames
()
count
,
err
:=
t
.
countNames
()
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
gomega
.
Expect
(
count
)
.
To
(
gomega
.
Equal
(
2
))
gomega
.
Expect
(
count
)
.
To
(
gomega
.
Equal
(
2
))
}
}
...
@@ -166,7 +166,7 @@ func (t *MySQLUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, up
...
@@ -166,7 +166,7 @@ func (t *MySQLUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, up
// Teardown performs one final check of the data's availability.
// Teardown performs one final check of the data's availability.
func
(
t
*
MySQLUpgradeTest
)
Teardown
(
f
*
framework
.
Framework
)
{
func
(
t
*
MySQLUpgradeTest
)
Teardown
(
f
*
framework
.
Framework
)
{
count
,
err
:=
t
.
countNames
()
count
,
err
:=
t
.
countNames
()
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
gomega
.
Expect
(
count
>=
t
.
successfulWrites
)
.
To
(
gomega
.
BeTrue
())
gomega
.
Expect
(
count
>=
t
.
successfulWrites
)
.
To
(
gomega
.
BeTrue
())
}
}
...
...
test/e2e/upgrades/nvidia-gpu.go
View file @
8f5a62af
...
@@ -56,7 +56,7 @@ func (t *NvidiaGPUUpgradeTest) Test(f *framework.Framework, done <-chan struct{}
...
@@ -56,7 +56,7 @@ func (t *NvidiaGPUUpgradeTest) Test(f *framework.Framework, done <-chan struct{}
if
upgrade
==
MasterUpgrade
||
upgrade
==
ClusterUpgrade
{
if
upgrade
==
MasterUpgrade
||
upgrade
==
ClusterUpgrade
{
// MasterUpgrade should be totally hitless.
// MasterUpgrade should be totally hitless.
job
,
err
:=
jobutil
.
GetJob
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"cuda-add"
)
job
,
err
:=
jobutil
.
GetJob
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"cuda-add"
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
gomega
.
Expect
(
job
.
Status
.
Failed
)
.
To
(
gomega
.
BeZero
(),
"Job pods failed during master upgrade: %v"
,
job
.
Status
.
Failed
)
gomega
.
Expect
(
job
.
Status
.
Failed
)
.
To
(
gomega
.
BeZero
(),
"Job pods failed during master upgrade: %v"
,
job
.
Status
.
Failed
)
}
}
}
}
...
@@ -88,11 +88,11 @@ func (t *NvidiaGPUUpgradeTest) startJob(f *framework.Framework) {
...
@@ -88,11 +88,11 @@ func (t *NvidiaGPUUpgradeTest) startJob(f *framework.Framework) {
}
}
ns
:=
f
.
Namespace
.
Name
ns
:=
f
.
Namespace
.
Name
_
,
err
:=
jobutil
.
CreateJob
(
f
.
ClientSet
,
ns
,
testJob
)
_
,
err
:=
jobutil
.
CreateJob
(
f
.
ClientSet
,
ns
,
testJob
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
framework
.
Logf
(
"Created job %v"
,
testJob
)
framework
.
Logf
(
"Created job %v"
,
testJob
)
ginkgo
.
By
(
"Waiting for gpu job pod start"
)
ginkgo
.
By
(
"Waiting for gpu job pod start"
)
err
=
jobutil
.
WaitForAllJobPodsRunning
(
f
.
ClientSet
,
ns
,
testJob
.
Name
,
1
)
err
=
jobutil
.
WaitForAllJobPodsRunning
(
f
.
ClientSet
,
ns
,
testJob
.
Name
,
1
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
ginkgo
.
By
(
"Done with gpu job pod start"
)
ginkgo
.
By
(
"Done with gpu job pod start"
)
}
}
...
@@ -101,9 +101,9 @@ func (t *NvidiaGPUUpgradeTest) verifyJobPodSuccess(f *framework.Framework) {
...
@@ -101,9 +101,9 @@ func (t *NvidiaGPUUpgradeTest) verifyJobPodSuccess(f *framework.Framework) {
// Wait for client pod to complete.
// Wait for client pod to complete.
ns
:=
f
.
Namespace
.
Name
ns
:=
f
.
Namespace
.
Name
err
:=
jobutil
.
WaitForAllJobPodsRunning
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"cuda-add"
,
1
)
err
:=
jobutil
.
WaitForAllJobPodsRunning
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"cuda-add"
,
1
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
pods
,
err
:=
jobutil
.
GetJobPods
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"cuda-add"
)
pods
,
err
:=
jobutil
.
GetJobPods
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"cuda-add"
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
createdPod
:=
pods
.
Items
[
0
]
.
Name
createdPod
:=
pods
.
Items
[
0
]
.
Name
framework
.
Logf
(
"Created pod %v"
,
createdPod
)
framework
.
Logf
(
"Created pod %v"
,
createdPod
)
f
.
PodClient
()
.
WaitForSuccess
(
createdPod
,
5
*
time
.
Minute
)
f
.
PodClient
()
.
WaitForSuccess
(
createdPod
,
5
*
time
.
Minute
)
...
...
test/e2e/upgrades/sysctl.go
View file @
8f5a62af
...
@@ -55,14 +55,14 @@ func (t *SysctlUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, u
...
@@ -55,14 +55,14 @@ func (t *SysctlUpgradeTest) Test(f *framework.Framework, done <-chan struct{}, u
case
MasterUpgrade
,
ClusterUpgrade
:
case
MasterUpgrade
,
ClusterUpgrade
:
ginkgo
.
By
(
"Checking the safe sysctl pod keeps running on master upgrade"
)
ginkgo
.
By
(
"Checking the safe sysctl pod keeps running on master upgrade"
)
pod
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Pods
(
t
.
validPod
.
Namespace
)
.
Get
(
t
.
validPod
.
Name
,
metav1
.
GetOptions
{})
pod
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Pods
(
t
.
validPod
.
Namespace
)
.
Get
(
t
.
validPod
.
Name
,
metav1
.
GetOptions
{})
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
gomega
.
Expect
(
pod
.
Status
.
Phase
)
.
To
(
gomega
.
Equal
(
v1
.
PodRunning
))
gomega
.
Expect
(
pod
.
Status
.
Phase
)
.
To
(
gomega
.
Equal
(
v1
.
PodRunning
))
}
}
ginkgo
.
By
(
"Checking the old unsafe sysctl pod was not suddenly started during an upgrade"
)
ginkgo
.
By
(
"Checking the old unsafe sysctl pod was not suddenly started during an upgrade"
)
pod
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Pods
(
t
.
invalidPod
.
Namespace
)
.
Get
(
t
.
invalidPod
.
Name
,
metav1
.
GetOptions
{})
pod
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Pods
(
t
.
invalidPod
.
Namespace
)
.
Get
(
t
.
invalidPod
.
Name
,
metav1
.
GetOptions
{})
if
err
!=
nil
&&
!
errors
.
IsNotFound
(
err
)
{
if
err
!=
nil
&&
!
errors
.
IsNotFound
(
err
)
{
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
}
}
if
err
==
nil
{
if
err
==
nil
{
gomega
.
Expect
(
pod
.
Status
.
Phase
)
.
NotTo
(
gomega
.
Equal
(
v1
.
PodRunning
))
gomega
.
Expect
(
pod
.
Status
.
Phase
)
.
NotTo
(
gomega
.
Equal
(
v1
.
PodRunning
))
...
@@ -86,7 +86,7 @@ func (t *SysctlUpgradeTest) verifySafeSysctlWork(f *framework.Framework) *v1.Pod
...
@@ -86,7 +86,7 @@ func (t *SysctlUpgradeTest) verifySafeSysctlWork(f *framework.Framework) *v1.Pod
ginkgo
.
By
(
"Making sure the valid pod launches"
)
ginkgo
.
By
(
"Making sure the valid pod launches"
)
ev
,
err
:=
f
.
PodClient
()
.
WaitForErrorEventOrSuccess
(
t
.
validPod
)
ev
,
err
:=
f
.
PodClient
()
.
WaitForErrorEventOrSuccess
(
t
.
validPod
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
if
ev
!=
nil
&&
ev
.
Reason
==
sysctl
.
UnsupportedReason
{
if
ev
!=
nil
&&
ev
.
Reason
==
sysctl
.
UnsupportedReason
{
framework
.
Skipf
(
"No sysctl support in Docker <1.12"
)
framework
.
Skipf
(
"No sysctl support in Docker <1.12"
)
}
}
...
@@ -104,7 +104,7 @@ func (t *SysctlUpgradeTest) verifyUnsafeSysctlsAreRejected(f *framework.Framewor
...
@@ -104,7 +104,7 @@ func (t *SysctlUpgradeTest) verifyUnsafeSysctlsAreRejected(f *framework.Framewor
ginkgo
.
By
(
"Making sure the invalid pod failed"
)
ginkgo
.
By
(
"Making sure the invalid pod failed"
)
ev
,
err
:=
f
.
PodClient
()
.
WaitForErrorEventOrSuccess
(
invalidPod
)
ev
,
err
:=
f
.
PodClient
()
.
WaitForErrorEventOrSuccess
(
invalidPod
)
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
if
ev
!=
nil
&&
ev
.
Reason
==
sysctl
.
UnsupportedReason
{
if
ev
!=
nil
&&
ev
.
Reason
==
sysctl
.
UnsupportedReason
{
framework
.
Skipf
(
"No sysctl support in Docker <1.12"
)
framework
.
Skipf
(
"No sysctl support in Docker <1.12"
)
}
}
...
...
test/e2e/windows/density.go
View file @
8f5a62af
...
@@ -267,7 +267,7 @@ func deletePodsSync(f *framework.Framework, pods []*v1.Pod) {
...
@@ -267,7 +267,7 @@ func deletePodsSync(f *framework.Framework, pods []*v1.Pod) {
defer
wg
.
Done
()
defer
wg
.
Done
()
err
:=
f
.
PodClient
()
.
Delete
(
pod
.
ObjectMeta
.
Name
,
metav1
.
NewDeleteOptions
(
30
))
err
:=
f
.
PodClient
()
.
Delete
(
pod
.
ObjectMeta
.
Name
,
metav1
.
NewDeleteOptions
(
30
))
gomega
.
Expect
(
err
)
.
NotTo
(
gomega
.
HaveOccurred
()
)
framework
.
ExpectNoError
(
err
)
gomega
.
Expect
(
framework
.
WaitForPodToDisappear
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
pod
.
ObjectMeta
.
Name
,
labels
.
Everything
(),
gomega
.
Expect
(
framework
.
WaitForPodToDisappear
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
pod
.
ObjectMeta
.
Name
,
labels
.
Everything
(),
30
*
time
.
Second
,
10
*
time
.
Minute
))
.
NotTo
(
gomega
.
HaveOccurred
())
30
*
time
.
Second
,
10
*
time
.
Minute
))
.
NotTo
(
gomega
.
HaveOccurred
())
...
...
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