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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
36 deletions
+28
-36
roservice.go
test/e2e/roservice.go
+28
-36
No files found.
test/e2e/roservice.go
View file @
eefd7ace
...
@@ -17,50 +17,42 @@ limitations under the License.
...
@@ -17,50 +17,42 @@ limitations under the License.
package
e2e
package
e2e
import
(
import
(
"fmt"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/golang/glog"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/gomega"
.
"github.com/onsi/gomega"
)
)
func
TestKubernetesROService
(
c
*
client
.
Client
)
bool
{
svc
:=
api
.
ServiceList
{}
err
:=
c
.
Get
()
.
Namespace
(
"default"
)
.
AbsPath
(
"/api/v1beta1/proxy/services/kubernetes-ro/api/v1beta1/services"
)
.
Do
()
.
Into
(
&
svc
)
if
err
!=
nil
{
glog
.
Errorf
(
"unexpected error listing services using ro service: %v"
,
err
)
return
false
}
var
foundRW
,
foundRO
bool
for
i
:=
range
svc
.
Items
{
if
svc
.
Items
[
i
]
.
Name
==
"kubernetes"
{
foundRW
=
true
}
if
svc
.
Items
[
i
]
.
Name
==
"kubernetes-ro"
{
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
()
{
var
_
=
Describe
(
"TestKubernetesROService"
,
func
()
{
var
c
*
client
.
Client
BeforeEach
(
func
()
{
c
=
loadClientOrDie
()
})
It
(
"should pass"
,
func
()
{
It
(
"should pass"
,
func
()
{
// TODO: Instead of OrDie, client should Fail the test if there's a problem.
svc
:=
api
.
ServiceList
{}
// In general tests should Fail() instead of glog.Fatalf().
err
:=
c
.
Get
()
.
Expect
(
TestKubernetesROService
(
loadClientOrDie
()))
.
To
(
BeTrue
())
Namespace
(
"default"
)
.
AbsPath
(
"/api/v1beta1/proxy/services/kubernetes-ro/api/v1beta1/services"
)
.
Do
()
.
Into
(
&
svc
)
if
err
!=
nil
{
Fail
(
fmt
.
Sprintf
(
"unexpected error listing services using ro service: %v"
,
err
))
}
var
foundRW
,
foundRO
bool
for
i
:=
range
svc
.
Items
{
if
svc
.
Items
[
i
]
.
Name
==
"kubernetes"
{
foundRW
=
true
}
if
svc
.
Items
[
i
]
.
Name
==
"kubernetes-ro"
{
foundRO
=
true
}
}
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