From 0bcb150a6c11a7a27b0c6d8ed39a5bc7509123c5 Mon Sep 17 00:00:00 2001 From: Lisa Cho Date: Wed, 30 Oct 2019 15:34:08 -0700 Subject: [PATCH 1/3] Revert "Randomize the shared domain created by this spec" This reverts commit e792d526b3199d1bb17c3bfe0ff7bff454243ad9. --- volume_services/volume_services.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/volume_services/volume_services.go b/volume_services/volume_services.go index cd13f13cb..568b13435 100644 --- a/volume_services/volume_services.go +++ b/volume_services/volume_services.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "path/filepath" - "strings" "time" "github.com/cloudfoundry-incubator/cf-test-helpers/cf" @@ -46,9 +45,7 @@ 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") From 499ebee7bd585c6df3964e33207fc11162d4379e Mon Sep 17 00:00:00 2001 From: Dennis Leon Date: Thu, 31 Oct 2019 12:08:54 -0700 Subject: [PATCH 2/3] Stop deleting shared tcp domain - Since we are using the same domain, this prevents errors with parallel tests - [#169354687](https://www.pivotaltracker.com/story/show/169354687) Co-authored-by: Dennis Leon Co-authored-by: Lisa Cho --- volume_services/volume_services.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/volume_services/volume_services.go b/volume_services/volume_services.go index 568b13435..c1ee2f85d 100644 --- a/volume_services/volume_services.go +++ b/volume_services/volume_services.go @@ -48,7 +48,14 @@ var _ = VolumeServicesDescribe("Volume Services", func() { 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") @@ -119,12 +126,6 @@ var _ = VolumeServicesDescribe("Volume Services", 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") }) }) From f1a29d1acc52c2b6396405c5c75ff885391128fe Mon Sep 17 00:00:00 2001 From: Dennis Leon Date: Thu, 31 Oct 2019 14:31:37 -0700 Subject: [PATCH 3/3] Print cf logs when volume services app fails to start up [#169354687](https://www.pivotaltracker.com/story/show/169354687) Co-authored-by: Dennis Leon Co-authored-by: Lisa Cho --- volume_services/volume_services.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/volume_services/volume_services.go b/volume_services/volume_services.go index c1ee2f85d..3e70b2c61 100644 --- a/volume_services/volume_services.go +++ b/volume_services/volume_services.go @@ -118,7 +118,12 @@ 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() {