Skip to content

Commit

Permalink
e2e for dynamic pv provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey1330 committed Mar 14, 2024
1 parent 7f07621 commit 9151ae9
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 510 deletions.
41 changes: 41 additions & 0 deletions e2e/iscsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,47 @@ var _ = ginkgo.Describe("SPDKCSI-ISCSI", func() {
ginkgo.Fail(err.Error())
}
})

///////////////////////////////////////
ginkgo.By("create multiple pvcs and a pod with multiple pvcs attached, and check data persistence after the pod is removed and recreated", func() {
deployMultiPvcs()
deployTestPodWithMultiPvcs()
defer func() {
deleteMultiPvcsAndTestPodWithMultiPvcs()
if err := waitForTestPodGone(f.ClientSet); err != nil {
ginkgo.Fail(err.Error())
}
for _, pvcName := range []string{"spdkcsi-pvc1", "spdkcsi-pvc2", "spdkcsi-pvc3"} {
if err := waitForPvcGone(f.ClientSet, pvcName); err != nil {
ginkgo.Fail(err.Error())
}
}
}()
err := waitForTestPodReady(f.ClientSet, 5*time.Minute)
if err != nil {
ginkgo.Fail(err.Error())
}

ginkgo.By("restart csi driver", func() {
rolloutNodeServer()
rolloutControllerServer()
err = waitForNodeServerReady(f.ClientSet, 3*time.Minute)
if err != nil {
ginkgo.Fail(err.Error())
}
err = waitForControllerReady(f.ClientSet, 4*time.Minute)
if err != nil {
ginkgo.Fail(err.Error())
}
})

err = checkDataPersistForMultiPvcs(f)
if err != nil {
ginkgo.Fail(err.Error())
}
})

//////////////////////////////////////
})
})
})
78 changes: 0 additions & 78 deletions e2e/nvmf.go

This file was deleted.

20 changes: 0 additions & 20 deletions e2e/opi-nvme.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions e2e/opi-virtioblk.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion e2e/pod_restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
var _ = ginkgo.Describe("SPDKCSI-DRIVER-RESTART", func() {
f := framework.NewDefaultFramework("spdkcsi")
ginkgo.BeforeEach(func() {
deployConfigs(nvmeofConfigMapData)
deployConfigs(iscsiConfigMapData)
deployCsi()
})
ginkgo.AfterEach(func() {
Expand Down
20 changes: 0 additions & 20 deletions e2e/sma-nvme.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions e2e/sma-nvmf.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions e2e/sma-virtioblk.yaml

This file was deleted.

70 changes: 0 additions & 70 deletions e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,76 +102,6 @@ func deleteCsi() {
}
}

func deploySmaNvmfConfig() {
_, err := framework.RunKubectl(nameSpace, "apply", "-f", smaNvmfConfigPath)
if err != nil {
e2elog.Logf("failed to create Sma Nvmf configmap %s", err)
}
}

func deleteSmaNvmfConfig() {
_, err := framework.RunKubectl(nameSpace, "delete", "-f", smaNvmfConfigPath)
if err != nil {
e2elog.Logf("failed to delete Sma Nvmf configmap %s", err)
}
}

func deploySmaNvmeConfig() {
_, err := framework.RunKubectl(nameSpace, "apply", "-f", smaNvmeConfigPath)
if err != nil {
e2elog.Logf("failed to create Sma Nvme configmap %s", err)
}
}

func deleteSmaNvmeConfig() {
_, err := framework.RunKubectl(nameSpace, "delete", "-f", smaNvmeConfigPath)
if err != nil {
e2elog.Logf("failed to delete Sma Nvme configmap %s", err)
}
}

func deploySmaVirtioBlkConfig() {
_, err := framework.RunKubectl(nameSpace, "apply", "-f", smaVirtioBlkConfigPath)
if err != nil {
e2elog.Logf("failed to create Sma VirtioBlk configmap %s", err)
}
}

func deleteSmaVirtioBlkConfig() {
_, err := framework.RunKubectl(nameSpace, "delete", "-f", smaVirtioBlkConfigPath)
if err != nil {
e2elog.Logf("failed to delete Sma VirtioBlk configmap %s", err)
}
}

func deployOpiNvmeConfig() {
_, err := framework.RunKubectl(nameSpace, "apply", "-f", opiNvmeConfigPath)
if err != nil {
e2elog.Logf("failed to create Opi Nvme configmap %s", err)
}
}

func deleteOpiNvmeConfig() {
_, err := framework.RunKubectl(nameSpace, "delete", "-f", opiNvmeConfigPath)
if err != nil {
e2elog.Logf("failed to delete Opi Nvme configmap %s", err)
}
}

func deployOpiVirtioBlkConfig() {
_, err := framework.RunKubectl(nameSpace, "apply", "-f", opiVirtioBlkConfigPath)
if err != nil {
e2elog.Logf("failed to create Opi VirtioBlk configmap %s", err)
}
}

func deleteOpiVirtioBlkConfig() {
_, err := framework.RunKubectl(nameSpace, "delete", "-f", opiVirtioBlkConfigPath)
if err != nil {
e2elog.Logf("failed to delete Opi VirtioBlk configmap %s", err)
}
}

func deployTestPod() {
_, err := framework.RunKubectl(nameSpace, "apply", "-f", testPodPath)
if err != nil {
Expand Down
Loading

0 comments on commit 9151ae9

Please sign in to comment.