Merge pull request #410 from Madhu-1/fix-e2e

use filesystem-test.yaml in e2e
This commit is contained in:
Humble Devassy Chirammal 2019-06-07 15:53:03 +05:30 committed by GitHub
commit 10192f9a3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 5 deletions

View File

@ -35,8 +35,9 @@ var _ = Describe("cephfs", func() {
//deploy cephfs CSI
BeforeEach(func() {
createFileSystem(f.ClientSet)
createConfigMap(f.ClientSet, f)
deployCephfsPlugin()
createCephfsStorageClass(f.ClientSet)
createCephfsStorageClass(f.ClientSet, f)
createCephfsSecret(f.ClientSet, f)
})

View File

@ -48,7 +48,7 @@ func createRBDPool() {
framework.RunKubectlOrDie("create", "-f", commonPath)
}
func deleteFileSystem() {
commonPath := fmt.Sprintf("%s/%s", rookURL, "filesystem.yaml")
commonPath := fmt.Sprintf("%s/%s", rookURL, "filesystem-test.yaml")
framework.RunKubectlOrDie("delete", "-f", commonPath)
}

View File

@ -36,7 +36,7 @@ var _ = Describe("RBD", func() {
//deploy RBD CSI
BeforeEach(func() {
createRBDPool()
createRBDConfigMap(f.ClientSet, f)
createConfigMap(f.ClientSet, f)
deployRBDPlugin()
createRBDStorageClass(f.ClientSet, f)
createRBDSecret(f.ClientSet, f)

View File

@ -154,10 +154,16 @@ func getStorageClass(c kubernetes.Interface, path string) scv1.StorageClass {
return sc
}
func createCephfsStorageClass(c kubernetes.Interface) {
func createCephfsStorageClass(c kubernetes.Interface, f *framework.Framework) {
scPath := fmt.Sprintf("%s/%s", cephfsExamplePath, "storageclass.yaml")
sc := getStorageClass(c, scPath)
sc.Parameters["pool"] = "myfs-data0"
sc.Parameters["fsName"] = "myfs"
fsID := execCommandInToolBox(f, "ceph fsid")
//remove new line present in fsID
fsID = strings.Trim(fsID, "\n")
sc.Parameters["clusterID"] = fsID
_, err := c.StorageV1().StorageClasses().Create(&sc)
Expect(err).Should(BeNil())
}
@ -177,7 +183,7 @@ func createRBDStorageClass(c kubernetes.Interface, f *framework.Framework) {
Expect(err).Should(BeNil())
}
func createRBDConfigMap(c kubernetes.Interface, f *framework.Framework) {
func createConfigMap(c kubernetes.Interface, f *framework.Framework) {
path := rbdDirPath + rbdConfigMap
cm := v1.ConfigMap{}
err := unmarshal(path, &cm)