mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-26 08:10:20 +00:00
2c9d711463
We have the e2e test with --deploy-rook=true that makes all test environment. It works fine, but It does not seem to be the role of e2e test. In addition, when developing the code we need to run full test scenario with deploying rook every time, or we need to build rook environment by hand. Move rook-deploy code to minikube.sh.
54 lines
932 B
Go
54 lines
932 B
Go
package e2e
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
. "github.com/onsi/ginkgo"
|
|
. "github.com/onsi/gomega"
|
|
"k8s.io/kubernetes/test/e2e/framework"
|
|
)
|
|
|
|
var (
|
|
deployTimeout int
|
|
)
|
|
|
|
func init() {
|
|
log.SetOutput(GinkgoWriter)
|
|
|
|
flag.IntVar(&deployTimeout, "deploy-timeout", 10, "timeout to wait for created kubernetes resources")
|
|
|
|
setDefaultKubeconfig()
|
|
|
|
// Register framework flags, then handle flags
|
|
framework.HandleFlags()
|
|
framework.AfterReadingAllFlags(&framework.TestContext)
|
|
|
|
fmt.Println("timeout for deploytimeout ", deployTimeout)
|
|
}
|
|
|
|
func setDefaultKubeconfig() {
|
|
_, exists := os.LookupEnv("KUBECONFIG")
|
|
if !exists {
|
|
defaultKubeconfig := filepath.Join(os.Getenv("HOME"), ".kube", "config")
|
|
os.Setenv("KUBECONFIG", defaultKubeconfig)
|
|
}
|
|
}
|
|
|
|
var _ = BeforeSuite(func() {
|
|
|
|
})
|
|
|
|
var _ = AfterSuite(func() {
|
|
|
|
})
|
|
|
|
func TestE2E(t *testing.T) {
|
|
RegisterFailHandler(Fail)
|
|
RunSpecs(t, "E2e Suite")
|
|
}
|