forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mysql_ephemeral.go
36 lines (28 loc) · 1.11 KB
/
mysql_ephemeral.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
package images
import (
"fmt"
g "github.com/onsi/ginkgo"
o "github.com/onsi/gomega"
exutil "github.com/openshift/origin/test/extended/util"
)
var _ = g.Describe("default: MySQL ephemeral template", func() {
defer g.GinkgoRecover()
var (
templatePath = exutil.FixturePath("..", "..", "examples", "db-templates", "mysql-ephemeral-template.json")
oc = exutil.NewCLI("mysql-create", exutil.KubeConfigPath())
)
g.Describe("Creating from a template", func() {
g.It(fmt.Sprintf("should process and create the %q template", templatePath), func() {
oc.SetOutputDir(exutil.TestContext.OutputDir)
g.By(fmt.Sprintf("calling oc process -f %q", templatePath))
configFile, err := oc.Run("process").Args("-f", templatePath).OutputToFile("config.json")
o.Expect(err).NotTo(o.HaveOccurred())
g.By(fmt.Sprintf("calling oc create -f %q", configFile))
err = oc.Run("create").Args("-f", configFile).Execute()
o.Expect(err).NotTo(o.HaveOccurred())
g.By("expecting the mysql service get endpoints")
err = oc.KubeFramework().WaitForAnEndpoint("mysql")
o.Expect(err).NotTo(o.HaveOccurred())
})
})
})