Skip to content

Commit

Permalink
Add support for cf cli v7
Browse files Browse the repository at this point in the history
- dont use -d when pushing an app
- specify an app manifest when pushing to an isolated org/space

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

Signed-off-by: Paul Warren <pwarren@pivotal.io>
  • Loading branch information
acosta11 authored and paulcwarren committed Jul 16, 2020
1 parent 2c3f12c commit 746b4a1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
26 changes: 24 additions & 2 deletions smoke/isolation_segments/isolation_segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package isolation_segments
import (
"fmt"
"io/ioutil"
"os"

"github.com/cloudfoundry/cf-smoke-tests/smoke"
. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -92,7 +93,6 @@ var _ = Describe("RoutingIsolationSegments", func() {
"-b", "binary_buildpack",
"-m", "30M",
"-k", "16M",
"-d", appsDomain,
"-c", "./app"),
testConfig.GetPushTimeout()).Should(Exit(0))
})
Expand All @@ -118,6 +118,8 @@ var _ = Describe("RoutingIsolationSegments", func() {

Context("When an app is pushed to a space that has been assigned an Isolation Segment", func() {
BeforeEach(func() {
manifestPath := CreateManifestWithRoute(appName, isoSegDomain)

CreateOrGetIsolationSegment(isoSegName, testConfig.GetDefaultTimeout())
isoSegGUID = GetIsolationSegmentGUID(isoSegName, testConfig.GetDefaultTimeout())
if !testConfig.GetUseExistingOrganization() {
Expand All @@ -134,7 +136,7 @@ var _ = Describe("RoutingIsolationSegments", func() {
"-b", "binary_buildpack",
"-m", "30M",
"-k", "16M",
"-d", isoSegDomain,
"-f", manifestPath,
"-c", "./app"),
testConfig.GetPushTimeout()).Should(Exit(0))
})
Expand Down Expand Up @@ -166,3 +168,23 @@ var _ = Describe("RoutingIsolationSegments", func() {
})
})
})

func CreateManifestWithRoute(name string, domain string) string {
file, err := ioutil.TempFile(os.TempDir(), "iso-segment-manifest-*.yml")
Expect(err).NotTo(HaveOccurred())

filePath := file.Name()

_, err = file.Write([]byte(fmt.Sprintf("---\n" +
"applications:\n" +
"- name: %s\n" +
" routes:\n" +
" - route: %s.%s",
name, name, domain)))
Expect(err).NotTo(HaveOccurred())

err = file.Close()
Expect(err).NotTo(HaveOccurred())

return filePath
}
2 changes: 1 addition & 1 deletion smoke/isolation_segments/v3_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func EntitleOrgToIsolationSegment(orgGUID, isoSegGUID string, timeout time.Durat
}

func ResetSpaceIsolationSegment(spaceName, isoSegName string, timeout time.Duration) {
Eventually(cf.Cf("reset-space-isolation-segment", spaceName, isoSegName), timeout).Should(Exit(0))
Eventually(cf.Cf("reset-space-isolation-segment", spaceName), timeout).Should(Exit(0))
}

func DisableOrgIsolationSegment(orgName, isoSegName string, timeout time.Duration) {
Expand Down
5 changes: 2 additions & 3 deletions smoke/logging/loggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
"github.com/cloudfoundry-incubator/cf-test-helpers/generator"
"github.com/cloudfoundry/cf-smoke-tests/smoke"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
Expand Down Expand Up @@ -33,7 +32,7 @@ var _ = Describe("Loggregator:", func() {
} else {
appName = testConfig.LoggingApp
}
Expect(cf.Cf("push", appName, "-b", "binary_buildpack", "-m", "30M", "-k", "16M", "-p", smoke.SimpleBinaryAppBitsPath, "-d", testConfig.AppsDomain).Wait(testConfig.GetPushTimeout())).To(Exit(0))
Expect(cf.Cf("push", appName, "-b", "binary_buildpack", "-m", "30M", "-k", "16M", "-p", smoke.SimpleBinaryAppBitsPath).Wait(testConfig.GetPushTimeout())).To(Exit(0))
})

It("can see app messages in the logs", func() {
Expand All @@ -51,7 +50,7 @@ var _ = Describe("Loggregator:", func() {
smoke.SkipIfNotWindows(testConfig)

appName = generator.PrefixedRandomName("SMOKES", "APP")
Expect(cf.Cf("push", appName, "-p", smoke.SimpleDotnetAppBitsPath, "-d", testConfig.AppsDomain, "-s", testConfig.GetWindowsStack(), "-b", "hwc_buildpack").Wait(testConfig.GetPushTimeout())).To(Exit(0))
Expect(cf.Cf("push", appName, "-p", smoke.SimpleDotnetAppBitsPath, "-s", testConfig.GetWindowsStack(), "-b", "hwc_buildpack").Wait(testConfig.GetPushTimeout())).To(Exit(0))
})

It("can see app messages in the logs", func() {
Expand Down
4 changes: 2 additions & 2 deletions smoke/runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var _ = Describe("Runtime:", func() {

Context("linux apps", func() {
It("can be pushed, scaled and deleted", func() {
Expect(cf.Cf("push", "-b", "binary_buildpack", "-m", "30M", "-k", "16M", appName, "-p", smoke.SimpleBinaryAppBitsPath, "-d", testConfig.AppsDomain).Wait(testConfig.GetPushTimeout())).To(Exit(0))
Expect(cf.Cf("push", "-b", "binary_buildpack", "-m", "30M", "-k", "16M", appName, "-p", smoke.SimpleBinaryAppBitsPath).Wait(testConfig.GetPushTimeout())).To(Exit(0))

runPushTests(appName, appURL, expectedNullResponse, testConfig)
})
Expand All @@ -60,7 +60,7 @@ var _ = Describe("Runtime:", func() {
It("can be pushed, scaled and deleted", func() {
smoke.SkipIfNotWindows(testConfig)

Expect(cf.Cf("push", appName, "-p", smoke.SimpleDotnetAppBitsPath, "-d", testConfig.AppsDomain, "-s", testConfig.GetWindowsStack(), "-b", "hwc_buildpack").Wait(testConfig.GetPushTimeout())).To(Exit(0))
Expect(cf.Cf("push", appName, "-p", smoke.SimpleDotnetAppBitsPath, "-s", testConfig.GetWindowsStack(), "-b", "hwc_buildpack").Wait(testConfig.GetPushTimeout())).To(Exit(0))

runPushTests(appName, appURL, expectedNullResponse, testConfig)
})
Expand Down

0 comments on commit 746b4a1

Please sign in to comment.