Skip to content

Commit

Permalink
Merge pull request #392 from lisamcho/develop
Browse files Browse the repository at this point in the history
Revert "Randomize the shared domain created by this spec"

[finishes #169470152](https://www.pivotaltracker.com/story/show/169470152)

Co-authored-by: Dave Walter <[email protected]>
Co-authored-by: Andrew Costa <[email protected]>
  • Loading branch information
3 people authored Nov 21, 2019
2 parents 8c6115a + f1a29d1 commit 6aa8092
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions volume_services/volume_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"path/filepath"
"strings"
"time"

"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
Expand Down Expand Up @@ -46,12 +45,17 @@ var _ = VolumeServicesDescribe("Volume Services", func() {
session = cf.Cf("curl", fmt.Sprintf("/routing/v1/router_groups/%s", routerGroupGuid), "-X", "PUT", "-d", payload).Wait()
Expect(session).To(Exit(0), "cannot update tcp router group to allow nfs traffic")

randomDomain := strings.ReplaceAll(random_name.CATSRandomName("SHARED_DOMAIN"), "_", "-")

tcpDomain = fmt.Sprintf("%s.%s", randomDomain, Config.GetAppsDomain())
tcpDomain = fmt.Sprintf("tcp.%s", Config.GetAppsDomain())

session = cf.Cf("create-shared-domain", tcpDomain, "--router-group", "default-tcp").Wait()
Expect(session).To(Exit(0), "can not create shared tcp domain")
Eventually(session).Should(Exit())
contents := string(session.Out.Contents()) + string(session.Err.Contents())
Expect(contents).Should(
SatisfyAny(
ContainSubstring(fmt.Sprintf("The domain name is taken: %s", tcpDomain)),
ContainSubstring("OK"),
), "can not create shared tcp domain >>>" + contents)

})

By("pushing an nfs server")
Expand Down Expand Up @@ -114,20 +118,19 @@ var _ = VolumeServicesDescribe("Volume Services", func() {
Expect(bindSession.Wait(TestSetup.ShortTimeout())).To(Exit(0), "cannot bind the nfs service instance to the test app")

By("starting the app")
Expect(cf.Cf("start", appName).Wait(Config.CfPushTimeoutDuration())).To(Exit(0), "cannot start the test app")
session = cf.Cf("start", appName).Wait(Config.CfPushTimeoutDuration())
Eventually(session).Should(Exit())
if session.ExitCode() != 0 {
cf.Cf("logs", appName, "--recent")
}
Expect(session.ExitCode()).To(Equal(0))
})

AfterEach(func() {
workflowhelpers.AsUser(TestSetup.AdminUserContext(), TestSetup.ShortTimeout(), func() {
payload := fmt.Sprintf(`{ "reservable_ports":"%s", "name":"default-tcp", "type": "tcp"}`, reservablePorts)
session := cf.Cf("curl", fmt.Sprintf("/routing/v1/router_groups/%s", routerGroupGuid), "-X", "PUT", "-d", payload).Wait()
Expect(session).To(Exit(0), "cannot retrieve current router groups")

session = cf.Cf("target", "-o", TestSetup.RegularUserContext().Org, "-s", TestSetup.RegularUserContext().Space).Wait()
Expect(session).To(Exit(0), "can not target space")

session = cf.Cf("delete-shared-domain", "-f", tcpDomain).Wait()
Expect(session).To(Exit(0), "can not delete shared tcp domain")
})
})

Expand Down

0 comments on commit 6aa8092

Please sign in to comment.