diff --git a/pkg/occlient/occlient.go b/pkg/occlient/occlient.go index ea509654b98..4a4d51fed29 100644 --- a/pkg/occlient/occlient.go +++ b/pkg/occlient/occlient.go @@ -96,7 +96,7 @@ const ( // Default Image that will be used containing the supervisord binary and assembly scripts // use getBoostrapperImage() function instead of this variable - defaultBootstrapperImage = "quay.io/openshiftdo/init:0.13.0" + defaultBootstrapperImage = "quay.io/openshiftdo/init:0.13.1" // ENV variable to overwrite image used to bootstrap SupervisorD in S2I builder Image bootstrapperImageEnvName = "ODO_BOOTSTRAPPER_IMAGE" diff --git a/tests/helper/helper_oc.go b/tests/helper/helper_oc.go index 2f8f6e9b337..6deb094bdd6 100644 --- a/tests/helper/helper_oc.go +++ b/tests/helper/helper_oc.go @@ -5,6 +5,7 @@ import ( "fmt" "regexp" "strings" + "time" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -393,3 +394,15 @@ func (oc *OcRunner) GetEnvs(componentName string, appName string, projectName st } return mapOutput } + +// WaitForDCRollout wait for DeploymentConfig to finish active rollout +// timeout is a maximum wait time in seconds +func (oc *OcRunner) WaitForDCRollout(dcName string, project string, timeout time.Duration) { + session := CmdRunner(oc.path, "rollout", "status", + "-w", + "-n", project, + "dc", dcName) + + Eventually(session).Should(gexec.Exit(0), runningCmd(session.Command)) + session.Wait(timeout) +} diff --git a/tests/integration/servicecatalog/cmd_link_unlink_test.go b/tests/integration/servicecatalog/cmd_link_unlink_test.go index 19ed13b1fc7..c84e38f7acc 100644 --- a/tests/integration/servicecatalog/cmd_link_unlink_test.go +++ b/tests/integration/servicecatalog/cmd_link_unlink_test.go @@ -74,7 +74,7 @@ var _ = Describe("odo link and unlink command tests", func() { }) }) - Context("When handiling link/unlink between components", func() { + Context("When handling link/unlink between components", func() { JustBeforeEach(func() { context1 = helper.CreateNewContext() context2 = helper.CreateNewContext() @@ -86,14 +86,24 @@ var _ = Describe("odo link and unlink command tests", func() { It("should link the frontend application to the backend and then unlink successfully", func() { helper.CopyExample(filepath.Join("source", "nodejs"), context1) helper.CmdShouldPass("odo", "create", "nodejs", "frontend", "--context", context1, "--project", project) + helper.CmdShouldPass("odo", "url", "create", "--port", "8080", "--context", context1) helper.CmdShouldPass("odo", "push", "--context", context1) + frontendUrl := helper.DetermineRouteURL(context1) helper.CopyExample(filepath.Join("source", "python"), context2) helper.CmdShouldPass("odo", "create", "python", "backend", "--context", context2, "--project", project) + helper.CmdShouldPass("odo", "url", "create", "--context", context2) helper.CmdShouldPass("odo", "push", "--context", context2) + helper.CmdShouldPass("odo", "link", "backend", "--component", "frontend", "--project", project, "--context", context2) // ensure that the proper envFrom entry was created envFromOutput := oc.GetEnvFromEntry("frontend", "app", project) Expect(envFromOutput).To(ContainSubstring("backend")) + + dcName := oc.GetDcName("frontend", project) + // wait for DeploymentConfig rollout to finish, so we can check if application is successfully running + oc.WaitForDCRollout(dcName, project, 20*time.Second) + helper.HttpWaitFor(frontendUrl, "Hello world from node.js!", 20, 1) + outputErr := helper.CmdShouldFail("odo", "link", "backend", "--component", "frontend", "--project", project, "--context", context2) Expect(outputErr).To(ContainSubstring("been linked")) helper.CmdShouldPass("odo", "unlink", "backend", "--component", "frontend", "--project", project, "--context", context2)