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
eefd7ace
Commit
eefd7ace
authored
Feb 05, 2015
by
Robert Rati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted TestKubernetesROService to native ginkgo syntax #4162
parent
d44c1d5b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
21 deletions
+13
-21
roservice.go
test/e2e/roservice.go
+13
-21
No files found.
test/e2e/roservice.go
View file @
eefd7ace
...
...
@@ -17,15 +17,23 @@ limitations under the License.
package
e2e
import
(
"fmt"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/golang/glog"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/gomega"
)
func
TestKubernetesROService
(
c
*
client
.
Client
)
bool
{
var
_
=
Describe
(
"TestKubernetesROService"
,
func
()
{
var
c
*
client
.
Client
BeforeEach
(
func
()
{
c
=
loadClientOrDie
()
})
It
(
"should pass"
,
func
()
{
svc
:=
api
.
ServiceList
{}
err
:=
c
.
Get
()
.
Namespace
(
"default"
)
.
...
...
@@ -33,8 +41,7 @@ func TestKubernetesROService(c *client.Client) bool {
Do
()
.
Into
(
&
svc
)
if
err
!=
nil
{
glog
.
Errorf
(
"unexpected error listing services using ro service: %v"
,
err
)
return
false
Fail
(
fmt
.
Sprintf
(
"unexpected error listing services using ro service: %v"
,
err
))
}
var
foundRW
,
foundRO
bool
for
i
:=
range
svc
.
Items
{
...
...
@@ -45,22 +52,7 @@ func TestKubernetesROService(c *client.Client) bool {
foundRO
=
true
}
}
if
!
foundRW
{
glog
.
Error
(
"no RW service found"
)
}
if
!
foundRO
{
glog
.
Error
(
"no RO service found"
)
}
if
!
foundRW
||
!
foundRO
{
return
false
}
return
true
}
var
_
=
Describe
(
"TestKubernetesROService"
,
func
()
{
It
(
"should pass"
,
func
()
{
// TODO: Instead of OrDie, client should Fail the test if there's a problem.
// In general tests should Fail() instead of glog.Fatalf().
Expect
(
TestKubernetesROService
(
loadClientOrDie
()))
.
To
(
BeTrue
())
Expect
(
foundRW
)
.
To
(
Equal
(
true
))
Expect
(
foundRO
)
.
To
(
Equal
(
true
))
})
})
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