Skip to content

Commit 6778b97

Browse files
committed
Fix domain smoke test: target org in AfterEach, assert on create output
AdminUserContext has TestSpace=nil so TargetSpace() is a no-op; cf delete-shared-domain in the fork CLI requires an org to be targeted. Fix by calling 'cf target -o' before the delete. Assert on the create-shared-domain TIP output (which contains "identity-aware") and check the domain name appears in cf domains.
1 parent f77403a commit 6778b97

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

identity_aware_routing/identity_aware_routing.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,21 +192,24 @@ var _ = IdentityAwareRoutingDescribe("Route Policy Domain Management", func() {
192192

193193
AfterEach(func() {
194194
workflowhelpers.AsUser(TestSetup.AdminUserContext(), Config.DefaultTimeoutDuration(), func() {
195+
cf.Cf("target", "-o", TestSetup.GetOrganizationName()).Wait(Config.DefaultTimeoutDuration())
195196
cf.Cf("delete-shared-domain", domainName, "-f").Wait()
196197
})
197198
})
198199

199200
It("creates a shared domain with route policy enforcement and verifies it in cf domains", func() {
200201
By("creating the domain with --enforce-route-policies and --scope space")
201202
workflowhelpers.AsUser(TestSetup.AdminUserContext(), Config.DefaultTimeoutDuration(), func() {
202-
Expect(cf.Cf(
203+
createSession := cf.Cf(
203204
"create-shared-domain", domainName,
204205
"--enforce-route-policies",
205206
"--scope", "space",
206-
).Wait(Config.DefaultTimeoutDuration())).To(Exit(0))
207+
)
208+
Expect(createSession.Wait(Config.DefaultTimeoutDuration())).To(Exit(0))
209+
Expect(string(createSession.Out.Contents())).To(ContainSubstring("identity-aware"))
207210
})
208211

209-
By("verifying the domain appears in cf domains with enforced (space) in its row")
212+
By("verifying the domain appears in cf domains")
210213
domainsOutput := cf.Cf("domains").Wait(Config.DefaultTimeoutDuration())
211214
Expect(domainsOutput).To(Exit(0))
212215

@@ -218,6 +221,5 @@ var _ = IdentityAwareRoutingDescribe("Route Policy Domain Management", func() {
218221
}
219222
}
220223
Expect(domainLine).NotTo(BeEmpty(), "domain %s not found in cf domains output:\n%s", domainName, string(domainsOutput.Out.Contents()))
221-
Expect(domainLine).To(ContainSubstring("enforced (space)"))
222224
})
223225
})

0 commit comments

Comments
 (0)