-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathsearch_domains_test.go
45 lines (37 loc) · 1.26 KB
/
search_domains_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package acceptance_test
import (
"fmt"
"github.com/cloudfoundry/cf-acceptance-tests/helpers/app_helpers"
"github.com/cloudfoundry/cf-test-helpers/v2/cf"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
)
// NOTE: This test assumes that garden-cni job has been configured to have `apps.internal` as a search domain
// see `manifest-generation/opsfiles/add-apps-internal-search-domain.yml`
var _ = Describe("search domains", func() {
var (
appName string
orgName string
)
BeforeEach(func() {
if testConfig.SkipSearchDomainTests {
Skip("skipping search domains test")
}
appName = fmt.Sprintf("appName-%d", randomGenerator.Int31())
orgName = testConfig.Prefix + "search-domains-org"
setupOrgAndSpace(orgName, testConfig.Prefix+"space")
By("pushing the test app")
pushProxy(appName)
})
AfterEach(func() {
app_helpers.AppReport(appName)
By("deleting the test org")
Expect(cf.Cf("delete-org", orgName, "-f").Wait(Timeout_Push)).To(gexec.Exit(0))
})
It("/etc/resolv.conf contains apps.internal", func() {
session := cf.Cf("ssh", appName, "-c", "cat /etc/resolv.conf")
Expect(session.Wait(Timeout_Push)).To(gexec.Exit(0))
Expect(string(session.Out.Contents())).To(MatchRegexp("search.*apps\\.internal"))
})
})