forked from cloudfoundry/cf-acceptance-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add diego tests for instance reporting
Signed-off-by: Zach Robinson <[email protected]>
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package diego | ||
|
||
import ( | ||
"github.com/cloudfoundry-incubator/cf-test-helpers/cf" | ||
"github.com/cloudfoundry-incubator/cf-test-helpers/generator" | ||
"github.com/cloudfoundry/cf-acceptance-tests/helpers" | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
. "github.com/onsi/gomega/gbytes" | ||
. "github.com/onsi/gomega/gexec" | ||
) | ||
|
||
var _ = Describe("Getting instance information", func() { | ||
var appName string | ||
|
||
BeforeEach(func() { | ||
appName = generator.RandomName() | ||
|
||
//Diego needs a custom buildpack until the ruby buildpack lands | ||
Eventually(cf.Cf("push", appName, "-p", helpers.NewAssets().HelloWorld, "--no-start"), CF_PUSH_TIMEOUT).Should(Exit(0)) | ||
Eventually(cf.Cf("set-env", appName, "CF_DIEGO_RUN_BETA", "true"), DEFAULT_TIMEOUT).Should(Exit(0)) | ||
|
||
Eventually(cf.Cf("scale", appName, "-i", "3"), DEFAULT_TIMEOUT).Should(Exit(0)) | ||
Eventually(cf.Cf("start", appName), CF_PUSH_TIMEOUT).Should(Exit(0)) | ||
}) | ||
|
||
AfterEach(func() { | ||
Eventually(cf.Cf("delete", appName, "-f"), DEFAULT_TIMEOUT).Should(Exit(0)) | ||
}) | ||
|
||
It("Retrieves instance information for cf app", func() { | ||
app := cf.Cf("app", appName).Wait(DEFAULT_TIMEOUT) | ||
Expect(app).To(Exit(0)) | ||
Expect(app).To(Say("instances: [0-3]/3")) | ||
Expect(app).To(Say("#0")) | ||
Expect(app).To(Say("#1")) | ||
Expect(app).To(Say("#2")) | ||
Expect(app).ToNot(Say("#3")) | ||
}) | ||
|
||
It("Retrieves instance information for cf apps", func() { | ||
app := cf.Cf("apps").Wait(DEFAULT_TIMEOUT) | ||
Expect(app).To(Exit(0)) | ||
Expect(app).To(Say(appName)) | ||
Expect(app).To(Say("[0-3]/3")) | ||
}) | ||
}) |