Documentation ¶
Index ¶
- Variables
- func CheckEnvVars(want []corev1.EnvVar, have []corev1.EnvVar, includes bool) []error
- func ConsoleResourcesAvailable(client *ClientSet) error
- func ConsoleResourcesUnavailable(client *ClientSet) error
- func DeleteAll(t *testing.T, client *ClientSet)
- func DeleteCompletely(getObject func() (runtime.Object, error), ...) error
- func DumpObject(t *testing.T, prefix string, obj interface{})
- func DumpOperatorLogs(t *testing.T, client *ClientSet)
- func DumpPodLogs(t *testing.T, podLogs PodSetLogs)
- func GenerationChanged(oldGeneration, newGeneration int64) bool
- func GetConfig() (*rest.Config, error)
- func GetConsoleCLIDownloads(client *ClientSet, consoleCLIDownloadName string) (*consolev1.ConsoleCLIDownload, error)
- func GetConsoleConfigMap(client *ClientSet) (*corev1.ConfigMap, error)
- func GetConsoleDeployment(client *ClientSet) (*appv1.Deployment, error)
- func GetConsolePodDisruptionBudget(client *ClientSet, pdbName string) (*policyv1.PodDisruptionBudget, error)
- func GetConsoleRoute(client *ClientSet) (*routev1.Route, error)
- func GetConsoleService(client *ClientSet) (*corev1.Service, error)
- func GetCustomLogoConfigMap(client *ClientSet) (*corev1.ConfigMap, error)
- func GetDownloadsDeployment(client *ClientSet) (*appv1.Deployment, error)
- func GetResource(client *ClientSet, resource TestingResource) (runtime.Object, error)
- func IsResourceAvailable(errChan chan error, client *ClientSet, resource TestingResource)
- func IsResourceUnavailable(errChan chan error, client *ClientSet, resource TestingResource)
- func LoopResources(client *ClientSet, ...) error
- func MustManageConsole(t *testing.T, client *ClientSet) error
- func MustNormalLogLevel(t *testing.T, client *ClientSet) error
- func MustPristine(t *testing.T, client *ClientSet) *operatorsv1.Console
- func MustRemoveConsole(t *testing.T, client *ClientSet) error
- func MustUnmanageConsole(t *testing.T, client *ClientSet) error
- func NewClientConfigForTest() (*rest.Config, error)
- func Pristine(t *testing.T, client *ClientSet) (*operatorsv1.Console, error)
- func ResetClusterProxyConfig(client *ClientSet) error
- func SetClusterProxyConfig(proxyConfig configv1.ProxySpec, client *ClientSet) error
- func SetLogLevel(t *testing.T, client *ClientSet, logLevel operatorsv1.LogLevel) error
- func StandardCleanup(t *testing.T, client *ClientSet)
- func WaitForSettledState(t *testing.T, client *ClientSet, phase string) (settled bool, err error)
- type ClientSet
- type PodLog
- type PodSetLogs
- type TestFramework
- type TestingResource
Constants ¶
This section is empty.
Variables ¶
var (
AsyncOperationTimeout = 5 * time.Minute
)
Functions ¶
func CheckEnvVars ¶
func ConsoleResourcesUnavailable ¶
checks 3 times if the resources are unavailable - is fine if fails or 1st or 2nd run, resources could be in the process of being removed - is not fine if resources disappear, then reappear - it seems to take a bit longer to remove resources, so this wrapper should account for that.
func DeleteCompletely ¶
func DeleteCompletely(getObject func() (runtime.Object, error), deleteObject func(*metav1.DeleteOptions) error) error
DeleteCompletely sends a delete request and waits until the resource and its dependents are deleted.
func DumpObject ¶
DumpObject prints the object to the test log.
func DumpOperatorLogs ¶
func DumpPodLogs ¶
func DumpPodLogs(t *testing.T, podLogs PodSetLogs)
func GenerationChanged ¶
func GetConfig ¶
GetConfig creates a *rest.Config for talking to a Kubernetes apiserver. Otherwise will assume running in cluster and use the cluster provided kubeconfig.
Config precedence ¶
* KUBECONFIG environment variable pointing at a file
* In-cluster config if running in cluster
* $HOME/.kube/config if exists
Note that if you have done `oc login...` the `current-context` will be used. this means that the test will run as whatever user is currently logged in. kube:admin has a token, but no certs. - kube:admin is an oauth user, this is why it has tokens. system:admin has certs, but no token. - system:admin is a cert based user only. other users, your mileage may vary.
func GetConsoleCLIDownloads ¶
func GetConsoleCLIDownloads(client *ClientSet, consoleCLIDownloadName string) (*consolev1.ConsoleCLIDownload, error)
func GetConsoleDeployment ¶
func GetConsoleDeployment(client *ClientSet) (*appv1.Deployment, error)
func GetConsolePodDisruptionBudget ¶
func GetConsolePodDisruptionBudget(client *ClientSet, pdbName string) (*policyv1.PodDisruptionBudget, error)
func GetCustomLogoConfigMap ¶
custom-logo in openshift-console should exist when custom branding is used
func GetDownloadsDeployment ¶
func GetDownloadsDeployment(client *ClientSet) (*appv1.Deployment, error)
func GetResource ¶
func GetResource(client *ClientSet, resource TestingResource) (runtime.Object, error)
func IsResourceAvailable ¶
func IsResourceAvailable(errChan chan error, client *ClientSet, resource TestingResource)
IsResourceAvailable checks if tested resource is available during a 30 second period. if the resource does not exist by the end of the period, an error will be returned.
func IsResourceUnavailable ¶
func IsResourceUnavailable(errChan chan error, client *ClientSet, resource TestingResource)
IsResourceUnavailable checks if tested resource is unavailable during a 15 second period. If the resource exists during that time, an error will be returned.
func LoopResources ¶
func LoopResources(client *ClientSet, inner func(errChan chan error, client *ClientSet, resource TestingResource)) error
func MustPristine ¶
func MustPristine(t *testing.T, client *ClientSet) *operatorsv1.Console
func NewClientConfigForTest ¶
authn operator approach to getting config. choose func as needed. https://github.com/openshift/cluster-authentication-operator/blob/master/test/library/client.go NewClientConfigForTest returns a config configured to connect to the api server
func Pristine ¶
set the operator config to a pristine state to start a next round of tests this should by default nullify out any customizations a user sets
func ResetClusterProxyConfig ¶
func SetClusterProxyConfig ¶
func SetLogLevel ¶
func StandardCleanup ¶
courtesy func to return state to something reasonable before the next test runs.
Types ¶
type ClientSet ¶
type ClientSet struct { // embedded Core clientcorev1.CoreV1Interface Apps clientappsv1.AppsV1Interface Routes clientroutev1.RouteV1Interface ConsoleCliDownloads consoleclientv1.ConsoleCLIDownloadInterface ConsoleExternalLogLink consoleclientv1.ConsoleExternalLogLinkInterface ConsoleLink consoleclientv1.ConsoleLinkInterface ConsoleNotification consoleclientv1.ConsoleNotificationInterface ConsolePluginV1 consoleclientv1.ConsolePluginInterface ConsoleYAMLSample consoleclientv1.ConsoleYAMLSampleInterface Operator operatorclientv1.ConsolesGetter Console configv1.ConsolesGetter ClusterOperator configv1.ClusterOperatorsGetter Proxy configv1.ProxiesGetter Infrastructure configv1.InfrastructuresGetter Ingress configv1.IngressesGetter PodDisruptionBudget policyv1client.PodDisruptionBudgetsGetter }
ClientSet is a set of Kubernetes clients.
func MustNewClientset ¶
func MustNewClientset(t *testing.T, kubeconfig *restclient.Config) *ClientSet
MustNewClientset is like NewClienset but aborts the test if clienset cannot be constructed.
func NewClientset ¶
func NewClientset(kubeconfig *restclient.Config) (*ClientSet, error)
NewClientset creates a set of Kubernetes clients. The default kubeconfig is used if not provided.
type PodSetLogs ¶
func GetLogsByLabelSelector ¶
func GetLogsByLabelSelector(client *ClientSet, namespace string, labelSelector *metav1.LabelSelector) (PodSetLogs, error)
func GetOperatorLogs ¶
func GetOperatorLogs(client *ClientSet) (PodSetLogs, error)
type TestFramework ¶
type TestFramework struct {
// contains filtered or unexported fields
}
type TestingResource ¶
type TestingResource struct {
// contains filtered or unexported fields
}