...

Source file src/github.com/redhat-developer/odo/tests/helper/helper_cli.go

Documentation: github.com/redhat-developer/odo/tests/helper

     1  package helper
     2  
     3  import "github.com/onsi/gomega/gexec"
     4  
     5  // CliRunner requires functions which are common for oc and kubectl
     6  // By abstracting these functions into an interface, it handles the cli runner and calls the functions specified to particular cluster only
     7  type CliRunner interface {
     8  	Run(args ...string) *gexec.Session
     9  	ExecListDir(podName string, projectName string, dir string) string
    10  	// Exec executes the command in the specified pod and project/namespace.
    11  	// If expectedSuccess is nil, the command is just supposed to run, with no assertion on its exit code.
    12  	// If *expectedSuccess is true, the command exit code is expected to be 0.
    13  	// If *expectedSuccess is false, the command exit code is expected to be non-zero.
    14  	Exec(podName string, projectName string, args []string, expectedSuccess *bool) (string, string)
    15  	CheckCmdOpInRemoteDevfilePod(podName string, containerName string, prjName string, cmd []string, checkOp func(cmdOp string, err error) bool) bool
    16  	GetRunningPodNameByComponent(compName string, namespace string) string
    17  	GetJobNameByComponent(compName string, namespace string) string
    18  	GetVolumeMountNamesandPathsFromContainer(deployName string, containerName, namespace string) string
    19  	WaitAndCheckForExistence(resourceType, namespace string, timeoutMinutes int) bool
    20  	GetServices(namespace string) string
    21  	CreateAndSetRandNamespaceProject() string
    22  	CreateAndSetRandNamespaceProjectOfLength(i int) string
    23  	SetProject(namespace string) string
    24  
    25  	// DeleteNamespaceProject deletes the specified namespace or project, optionally waiting until it is gone
    26  	DeleteNamespaceProject(projectName string, wait bool)
    27  
    28  	DeletePod(podName string, projectName string)
    29  	GetAllNamespaceProjects() []string
    30  	GetNamespaceProject() string
    31  
    32  	// HasNamespaceProject returns whether the specified namespace or project exists in the cluster
    33  	HasNamespaceProject(name string) bool
    34  	// ListNamespaceProject checks if the namespace is present in the list of namespaces
    35  	ListNamespaceProject(name string)
    36  
    37  	GetActiveNamespace() string
    38  	GetEnvsDevFileDeployment(componentName, appName, projectName string) map[string]string
    39  	GetEnvRefNames(componentName, appName, projectName string) []string
    40  	GetPVCSize(compName, storageName, namespace string) string
    41  	GetAllPVCNames(namespace string) []string
    42  	GetPodInitContainers(compName, namespace string) []string
    43  	GetContainerEnv(podName, containerName, namespace string) string
    44  	WaitAndCheckForTerminatingState(resourceType, namespace string, timeoutMinutes int) bool
    45  	VerifyResourceDeleted(ri ResourceInfo)
    46  	VerifyResourceToBeDeleted(ri ResourceInfo)
    47  	GetAnnotationsDeployment(cmpName, appName, projectName string) map[string]string
    48  	GetAllPodsInNs(namespace string) string
    49  	WaitForRunnerCmdOut(args []string, timeout int, errOnFail bool, check func(output string) bool, includeStdErr ...bool) bool
    50  	PodsShouldBeRunning(project string, regex string)
    51  	CreateSecret(secretName, secretPass, project string)
    52  	GetSecrets(project string) string
    53  	GetEnvFromEntry(componentName string, appName string, projectName string) string
    54  	GetVolumeNamesFromDeployment(componentName, appName, projectName string) map[string]string
    55  	ScalePodToZero(componentName, appName, projectName string)
    56  	GetAllPodNames(namespace string) []string
    57  	EnsureOperatorIsInstalled(partialOperatorName string)
    58  	GetBindableKinds() (string, string)
    59  	GetServiceBinding(name, projectName string) (string, string)
    60  	GetLogs(podName string) string
    61  	AssertContainsLabel(kind, namespace, componentName, appName, mode, key, value string)
    62  	AssertNoContainsLabel(kind, namespace, componentName, appName, mode, key string)
    63  	EnsurePodIsUp(namespace, podName string)
    64  	AssertNonAuthenticated()
    65  	GetVersion() string
    66  	SetLabelsOnNamespace(ns string, labelValues ...string)
    67  }
    68  

View as plain text