Skip to content

Commit

Permalink
Add a CAPI version check for HTTP/2 to integration tests
Browse files Browse the repository at this point in the history
* Setting the DestinationProtocol flags could cause problems if CAPI V3
is not >= 3.104.0
* Adds one new integration test for if the route destination doesn't
already exist and the DestinationProtocol flag is set
  • Loading branch information
ctlong committed Aug 20, 2021
1 parent d01e549 commit 211a4f4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/cloudcontroller/ccversion/minimum_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ const (

MinVersionCreateServiceBrokerV3 = "3.72.0"
MinVersionCreateSpaceScopedServiceBrokerV3 = "3.75.0"

MinVersionHTTP2RoutingV3 = "3.104.0"
)
19 changes: 19 additions & 0 deletions integration/v7/isolated/map_route_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package isolated
import (
"fmt"

"code.cloudfoundry.org/cli/api/cloudcontroller/ccversion"
. "code.cloudfoundry.org/cli/cf/util/testhelpers/matchers"
"code.cloudfoundry.org/cli/integration/helpers"

Expand Down Expand Up @@ -128,6 +129,10 @@ var _ = Describe("map-route command", func() {
})

When("destination protocol is provided", func() {
BeforeEach(func() {
helpers.SkipIfVersionLessThan(ccversion.MinVersionHTTP2RoutingV3)
})

It("maps the route to an app", func() {
session := helpers.CF("map-route", appName, domainName, "--hostname", route.Host, "--destination-protocol", "http2")

Expand Down Expand Up @@ -215,6 +220,20 @@ var _ = Describe("map-route command", func() {
Eventually(session).Should(Say(`OK`))
Eventually(session).Should(Exit(0))
})

When("destination protocol is provided", func() {
BeforeEach(func() {
helpers.SkipIfVersionLessThan(ccversion.MinVersionHTTP2RoutingV3)
})

It("maps the route to an app", func() {
session := helpers.CF("map-route", appName, domainName, "--hostname", hostName, "--destination-protocol", "http2")

Eventually(session).Should(Say(`Mapping route %s.%s to app %s with protocol http2 in org %s / space %s as %s\.\.\.`, hostName, domainName, appName, orgName, spaceName, userName))
Eventually(session).Should(Say(`OK`))
Eventually(session).Should(Exit(0))
})
})
})

When("it is an TCP domain", func() {
Expand Down

0 comments on commit 211a4f4

Please sign in to comment.