ceph-csi/e2e/e2e_test.go
Humble Chirammal 7df51846da This commit adds "k8s.io/kubernetes/test/e2e/framework/config"
and its functions in E2E.

update vendor packages
log dismounter command output
use kube v1.17.1 in dependency

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2020-01-17 12:06:02 +00:00

62 lines
1.1 KiB
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"
config "k8s.io/kubernetes/test/e2e/framework/config"
)
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
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")
}
func handleFlags() {
config.CopyFlags(config.Flags, flag.CommandLine)
framework.RegisterCommonFlags(flag.CommandLine)
framework.RegisterClusterFlags(flag.CommandLine)
flag.Parse()
}