mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Moved the ROService test into the services suite #4162
This commit is contained in:
parent
eefd7ace56
commit
d3e04cd246
@ -1,58 +0,0 @@
|
||||
/*
|
||||
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() {
|
||||
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))
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user