mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +00:00
Merge pull request #410 from Madhu-1/fix-e2e
use filesystem-test.yaml in e2e
This commit is contained in:
commit
10192f9a3e
@ -35,8 +35,9 @@ var _ = Describe("cephfs", func() {
|
|||||||
//deploy cephfs CSI
|
//deploy cephfs CSI
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
createFileSystem(f.ClientSet)
|
createFileSystem(f.ClientSet)
|
||||||
|
createConfigMap(f.ClientSet, f)
|
||||||
deployCephfsPlugin()
|
deployCephfsPlugin()
|
||||||
createCephfsStorageClass(f.ClientSet)
|
createCephfsStorageClass(f.ClientSet, f)
|
||||||
createCephfsSecret(f.ClientSet, f)
|
createCephfsSecret(f.ClientSet, f)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ func createRBDPool() {
|
|||||||
framework.RunKubectlOrDie("create", "-f", commonPath)
|
framework.RunKubectlOrDie("create", "-f", commonPath)
|
||||||
}
|
}
|
||||||
func deleteFileSystem() {
|
func deleteFileSystem() {
|
||||||
commonPath := fmt.Sprintf("%s/%s", rookURL, "filesystem.yaml")
|
commonPath := fmt.Sprintf("%s/%s", rookURL, "filesystem-test.yaml")
|
||||||
framework.RunKubectlOrDie("delete", "-f", commonPath)
|
framework.RunKubectlOrDie("delete", "-f", commonPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ var _ = Describe("RBD", func() {
|
|||||||
//deploy RBD CSI
|
//deploy RBD CSI
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
createRBDPool()
|
createRBDPool()
|
||||||
createRBDConfigMap(f.ClientSet, f)
|
createConfigMap(f.ClientSet, f)
|
||||||
deployRBDPlugin()
|
deployRBDPlugin()
|
||||||
createRBDStorageClass(f.ClientSet, f)
|
createRBDStorageClass(f.ClientSet, f)
|
||||||
createRBDSecret(f.ClientSet, f)
|
createRBDSecret(f.ClientSet, f)
|
||||||
|
10
e2e/utils.go
10
e2e/utils.go
@ -154,10 +154,16 @@ func getStorageClass(c kubernetes.Interface, path string) scv1.StorageClass {
|
|||||||
return sc
|
return sc
|
||||||
}
|
}
|
||||||
|
|
||||||
func createCephfsStorageClass(c kubernetes.Interface) {
|
func createCephfsStorageClass(c kubernetes.Interface, f *framework.Framework) {
|
||||||
scPath := fmt.Sprintf("%s/%s", cephfsExamplePath, "storageclass.yaml")
|
scPath := fmt.Sprintf("%s/%s", cephfsExamplePath, "storageclass.yaml")
|
||||||
sc := getStorageClass(c, scPath)
|
sc := getStorageClass(c, scPath)
|
||||||
sc.Parameters["pool"] = "myfs-data0"
|
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)
|
_, err := c.StorageV1().StorageClasses().Create(&sc)
|
||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
}
|
}
|
||||||
@ -177,7 +183,7 @@ func createRBDStorageClass(c kubernetes.Interface, f *framework.Framework) {
|
|||||||
Expect(err).Should(BeNil())
|
Expect(err).Should(BeNil())
|
||||||
}
|
}
|
||||||
|
|
||||||
func createRBDConfigMap(c kubernetes.Interface, f *framework.Framework) {
|
func createConfigMap(c kubernetes.Interface, f *framework.Framework) {
|
||||||
path := rbdDirPath + rbdConfigMap
|
path := rbdDirPath + rbdConfigMap
|
||||||
cm := v1.ConfigMap{}
|
cm := v1.ConfigMap{}
|
||||||
err := unmarshal(path, &cm)
|
err := unmarshal(path, &cm)
|
||||||
|
Loading…
Reference in New Issue
Block a user