mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
Add E2E framework
deploys rook deploy cephfs plugin deploy rbd plugin create PVC/POD to test cephfs create PVC/POD to test rbd Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
52
e2e/e2e_test.go
Normal file
52
e2e/e2e_test.go
Normal file
@ -0,0 +1,52 @@
|
||||
package e2e
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
)
|
||||
|
||||
var (
|
||||
RookVersion string
|
||||
rookRequired bool
|
||||
deployTimeout int
|
||||
)
|
||||
|
||||
func init() {
|
||||
log.SetOutput(GinkgoWriter)
|
||||
flag.StringVar(&RookVersion, "rook-version", "master", "rook version to pull yaml files")
|
||||
|
||||
flag.BoolVar(&rookRequired, "deploy-rook", true, "deploy rook on kubernetes")
|
||||
flag.IntVar(&deployTimeout, "deploy-timeout", 10, "timeout to wait for created kubernetes resources")
|
||||
|
||||
// Register framework flags, then handle flags
|
||||
framework.HandleFlags()
|
||||
framework.AfterReadingAllFlags(&framework.TestContext)
|
||||
|
||||
formRookURL(RookVersion)
|
||||
fmt.Println("timeout for deploytimeout ", deployTimeout)
|
||||
}
|
||||
|
||||
//BeforeSuite deploys the rook-operator and ceph cluster
|
||||
var _ = BeforeSuite(func() {
|
||||
if rookRequired {
|
||||
deployRook()
|
||||
}
|
||||
})
|
||||
|
||||
//AfterSuite removes the rook-operator and ceph cluster
|
||||
var _ = AfterSuite(func() {
|
||||
if rookRequired {
|
||||
tearDownRook()
|
||||
}
|
||||
})
|
||||
|
||||
func TestE2E(t *testing.T) {
|
||||
RegisterFailHandler(Fail)
|
||||
RunSpecs(t, "E2e Suite")
|
||||
}
|
Reference in New Issue
Block a user