Documentation
¶
Index ¶
- Constants
- Variables
- func BuildE2eCommand(ctx *cli.Context) ([]string, error)
- func CheckIfBinaryExists(version string) bool
- func CheckKubeConfigEnv() string
- func DownloadBinary(version string) error
- func E2eReportParser(filename string) ([]map[string]string, error)
- func ExecuteE2ECommand(args []string, ch chan os.Signal) error
- func FileExists(filename string) bool
- func GenerateReport(report string)
- func GetLoggerFromContext(ctx context.Context) *logrus.Entry
- func GetURL(version string) (string, error)
- func Prechecks(c *cli.Context) bool
- func Prerequisites(version string) error
- func ReadTestDriverConfig(driverconfig string) string
- func SkipTests(skipFile string) (string, error)
- func UnTarBinary() error
- type DriverConfig
- type ExtendedDuration
- type Testcase
- type Testsuite
- type Testsuites
Constants ¶
const ( // KubeConfigEnv Environmental Variable KubeConfigEnv = "KUBECONFIG" XML = ".xml" // XML is an extension for .xml IgnoreFile = "pkg/utils/ignore.yaml" // IgnoreFile contains the tests to be skipped BinaryPrefix = "https://dl.k8s.io/" // BinaryPrefix Binary url prefix BinarySuffix = "/kubernetes-test-linux-amd64.tar.gz" // BinarySuffix binary url suffix BinaryFile = "kubernetes-test-linux-amd64.tar.gz" // BinaryFile downloaded binary file )
Constants to support e2e tests
const (
// LoggerContextKey logger
LoggerContextKey loggerKey = "logger"
)
Variables ¶
var ( // Home home environmental variable Home = os.Getenv("HOME") )
Functions ¶
func BuildE2eCommand ¶
BuildE2eCommand will build the command args
func CheckIfBinaryExists ¶
CheckIfBinaryExists will check the existing binary version and return true if version match else return false
func CheckKubeConfigEnv ¶
func CheckKubeConfigEnv() string
CheckKubeConfigEnv will check the environment variable KUBECONFIG and returns default KUBECONFIG if not set
func DownloadBinary ¶
DownloadBinary will download the binary from the kubernetes artifactory based the version
func E2eReportParser ¶
E2eReportParser will parse the kubernetes end-to-end report.
func ExecuteE2ECommand ¶
ExecuteE2ECommand will execute the ./e2e.test command and generates the reports
func FileExists ¶
FileExists will check the file existence and return true if it exists otherwise return false
func GenerateReport ¶
func GenerateReport(report string)
GenerateReport will call parser function and generates the report
func GetLoggerFromContext ¶
GetLoggerFromContext returns logger
func Prerequisites ¶
Prerequisites function will full-fill all prerequisites
func ReadTestDriverConfig ¶
ReadTestDriverConfig will read the driver config
func UnTarBinary ¶
func UnTarBinary() error
UnTarBinary will untar the kubernetes tar.gz file to get the e2e binaries
Types ¶
type DriverConfig ¶
type DriverConfig struct { StorageClass struct { Class string `yaml:"FromExistingClassName"` } `yaml:"StorageClass"` }
DriverConfig is used to get the storage-class name
type ExtendedDuration ¶
ExtendedDuration in weeks, days, hours, minutes and seconds
func ParseDuration ¶
func ParseDuration(str string) (*ExtendedDuration, error)
ParseDuration parse duration string and returns ExtendedDuration struct
func (ExtendedDuration) Duration ¶
func (s ExtendedDuration) Duration() time.Duration
Duration returns time duration
type Testcase ¶
type Testcase struct { XMLName xml.Name `xml:"testcase"` Name string `xml:"name,attr"` Status string `xml:"status,attr"` }
Testcase is an individual testcase in the end-to-end report
type Testsuite ¶
type Testsuite struct { XMLName xml.Name `xml:"testsuite"` // Properties []Property `xml:"properties"` Name string `xml:"name,attr"` Tests string `xml:"tests,attr"` Skipped string `xml:"skipped,attr"` Errors string `xml:"errors,attr"` Failures string `xml:"failures,attr"` Testcases []Testcase `xml:"testcase"` }
Testsuite contain all the information about the tests
type Testsuites ¶
type Testsuites struct { XMLName xml.Name `xml:"testsuites"` Testsuites []Testsuite `xml:"testsuite"` }
Testsuites contains list of testsuites