Commit d3e04cd2 authored by Robert Rati's avatar Robert Rati

Moved the ROService test into the services suite #4162

parent eefd7ace
/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package e2e
import (
"fmt"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("TestKubernetesROService", func() {
var c *client.Client
BeforeEach(func() {
c = loadClientOrDie()
})
It("should pass", func() {
svc := api.ServiceList{}
err := c.Get().
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))
})
})
...@@ -154,4 +154,27 @@ var _ = Describe("Services", func() { ...@@ -154,4 +154,27 @@ var _ = Describe("Services", func() {
fmt.Printf("DNS probes using %s succeeded\n", pod.Name) fmt.Printf("DNS probes using %s succeeded\n", pod.Name)
} }
}) })
It("should provide RW and RO services", func() {
svc := api.ServiceList{}
err := c.Get().
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))
})
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment