mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Match regexes for error strings in e2e
This commit is contained in:
parent
3d7c79ca03
commit
a1df9ff4b4
@ -645,9 +645,8 @@ var _ = Describe("Services", func() {
|
||||
if err == nil {
|
||||
Failf("Created service with conflicting NodePort: %v", result2)
|
||||
}
|
||||
expectedErr := fmt.Sprintf("Service \"%s\" is invalid: spec.ports[0].nodePort: Invalid value: %d: provided port is already allocated",
|
||||
serviceName2, port.NodePort)
|
||||
Expect(fmt.Sprintf("%v", err)).To(Equal(expectedErr))
|
||||
expectedErr := fmt.Sprintf("%d.*port is already allocated", port.NodePort)
|
||||
Expect(fmt.Sprintf("%v", err)).To(MatchRegexp(expectedErr))
|
||||
|
||||
By("deleting service " + serviceName1 + " to release NodePort")
|
||||
err = t.DeleteService(serviceName1)
|
||||
@ -706,8 +705,8 @@ var _ = Describe("Services", func() {
|
||||
if err == nil {
|
||||
Failf("failed to prevent update of service with out-of-range NodePort: %v", result)
|
||||
}
|
||||
expectedErr := fmt.Sprintf("Service \"%s\" is invalid: spec.ports[0].nodePort: Invalid value: %d: provided port is not in the valid range", serviceName, outOfRangeNodePort)
|
||||
Expect(fmt.Sprintf("%v", err)).To(Equal(expectedErr))
|
||||
expectedErr := fmt.Sprintf("%d.*port is not in the valid range", outOfRangeNodePort)
|
||||
Expect(fmt.Sprintf("%v", err)).To(MatchRegexp(expectedErr))
|
||||
|
||||
By("deleting original service " + serviceName)
|
||||
err = t.DeleteService(serviceName)
|
||||
@ -721,7 +720,7 @@ var _ = Describe("Services", func() {
|
||||
if err == nil {
|
||||
Failf("failed to prevent create of service with out-of-range NodePort (%d): %v", outOfRangeNodePort, service)
|
||||
}
|
||||
Expect(fmt.Sprintf("%v", err)).To(Equal(expectedErr))
|
||||
Expect(fmt.Sprintf("%v", err)).To(MatchRegexp(expectedErr))
|
||||
})
|
||||
|
||||
It("should release NodePorts on delete", func() {
|
||||
|
Loading…
Reference in New Issue
Block a user