Documentation ¶
Index ¶
- Constants
- Variables
- func ArtifactDirPath() string
- func ArtifactPath(elem ...string) string
- func CalculatePodMetrics(adminClient kubernetes.Interface, adminConfig *restclient.Config) error
- func CheckBuildCancelled(b *buildv1.Build) bool
- func CheckBuildFailed(b *buildv1.Build) bool
- func CheckBuildSuccess(b *buildv1.Build) bool
- func CheckForBuildEvent(client corev1client.CoreV1Interface, build *buildv1.Build, ...)
- func CheckImageStreamLatestTagPopulated(i *imagev1.ImageStream) bool
- func CheckImageStreamTagNotFound(i *imagev1.ImageStream) bool
- func CheckPodIsReady(pod kapiv1.Pod) bool
- func CheckPodIsRunning(pod kapiv1.Pod) bool
- func CheckPodIsSucceeded(pod kapiv1.Pod) bool
- func CheckPodNoOp(pod kapiv1.Pod) bool
- func CreateCentosExecPodOrFail(client kubernetes.Interface, ns, generateName string, tweak func(*v1.Pod)) *v1.Pod
- func CreateExecPodOrFail(client corev1client.CoreV1Interface, ns, name string) string
- func CreateLDAPTestServer(oc *CLI) (string, []byte, error)
- func CreateResource(jsonFilePath string, oc *CLI) error
- func DeletePVCsForDeployment(client clientset.Interface, oc *CLI, deploymentPrefix string)
- func DumpAndReturnTagging(tags []string) ([]string, error)
- func DumpApplicationPodLogs(dcName string, oc *CLI)
- func DumpBuildLogs(bc string, oc *CLI)
- func DumpBuilds(oc *CLI)
- func DumpConfigMapStates(oc *CLI)
- func DumpDeploymentLogs(dcName string, version int64, oc *CLI)
- func DumpImageStreams(oc *CLI)
- func DumpPersistentVolumeInfo(oc *CLI)
- func DumpPodLogs(pods []kapiv1.Pod, oc *CLI)
- func DumpPodLogsStartingWith(prefix string, oc *CLI)
- func DumpPodLogsStartingWithInNamespace(prefix, namespace string, oc *CLI)
- func DumpPodStates(oc *CLI)
- func DumpPodStatesInNamespace(namespace string, oc *CLI)
- func DumpPodsCommand(c kubernetes.Interface, ns string, selector labels.Selector, cmd string)
- func DumpSampleOperator(oc *CLI)
- func ExamineDiskUsage()
- func ExaminePodDiskUsage(oc *CLI)
- func ExecuteTest(t ginkgo.GinkgoTestingT, suite string)
- func FatalErr(msg interface{})
- func FetchURL(oc *CLI, url string, retryTimeout time.Duration) (string, error)
- func FindCLIImage(oc *CLI) (string, bool)
- func FindImageFormatString(oc *CLI) (string, bool)
- func FindRouterImage(oc *CLI) (string, error)
- func FixturePath(elem ...string) string
- func GetApplicationPods(oc *CLI, dcName string) (*kapiv1.PodList, error)
- func GetDeploymentConfigPods(oc *CLI, dcName string, version int64) (*kapiv1.PodList, error)
- func GetDockerImageReference(c imagev1typedclient.ImageStreamInterface, name, tag string) (string, error)
- func GetEndpointAddress(oc *CLI, name string) (string, error)
- func GetImageIDForTags(comps []string) ([]string, error)
- func GetMasterThreadDump(oc *CLI)
- func GetPodForContainer(container kapiv1.Container) *kapiv1.Pod
- func GetPodNamesByFilter(c corev1client.PodInterface, label labels.Selector, ...) (podNames []string, err error)
- func GetRouterPodTemplate(oc *CLI) (*corev1.PodTemplateSpec, string, error)
- func GetStatefulSetPods(oc *CLI, setName string) (*kapiv1.PodList, error)
- func InitDefaultEnvironmentVariables()
- func InitStandardFlags()
- func InitTest(dryRun bool) error
- func IsClusterOperated(oc *CLI) bool
- func KubeConfigPath() string
- func LDAPClientMounts() ([]corev1.VolumeMount, []corev1.Volume)
- func LaunchWebserverPod(f *e2e.Framework, podName, nodeName string) (ip string)
- func ListImages() ([]string, error)
- func NewPodExecutor(oc *CLI, name, image string) (*podExecutor, error)
- func NewRuleResolver(informers rbacinformers.Interface) rbacregistryvalidation.AuthorizationRuleResolver
- func ParseLabelsOrDie(str string) labels.Selector
- func PreTestDump()
- func ReadFixture(path string) (runtime.Object, error)
- func ReadFixtureOrFail(path string) runtime.Object
- func ReadLDAPServerTestData() (*app.Deployment, *corev1.Service, *corev1.ConfigMap, *corev1.ConfigMap)
- func RemoveDeploymentConfigs(oc *CLI, dcs ...string) error
- func RemovePodsWithPrefixes(oc *CLI, prefixes ...string) error
- func RemoveStatefulSets(oc *CLI, sets ...string) error
- func RunOneShotCommandPod(oc *CLI, name, image, command string, volumeMounts []corev1.VolumeMount, ...) (string, []error)
- func SetupK8SNFSServerAndVolume(oc *CLI, count int) (*kapiv1.Pod, []*kapiv1.PersistentVolume, error)
- func StartBuild(oc *CLI, args ...string) (stdout, stderr string, err error)
- func TimedWaitForAnImageStreamTag(oc *CLI, namespace, name, tag string, waitTimeout time.Duration) error
- func VarSubOnFile(srcFile string, destFile string, vars map[string]string) error
- func WaitForABuild(c buildv1clienttyped.BuildInterface, name string, ...) error
- func WaitForAJob(c batchv1client.JobInterface, name string, timeout time.Duration) error
- func WaitForAnImageStream(client imagev1typedclient.ImageStreamInterface, name string, ...) error
- func WaitForAnImageStreamTag(oc *CLI, namespace, name, tag string) error
- func WaitForBuildResult(c buildv1clienttyped.BuildInterface, result *BuildResult) error
- func WaitForDeploymentConfig(kc kubernetes.Interface, dcClient appsv1clienttyped.DeploymentConfigsGetter, ...) error
- func WaitForEndpoint(c kclientset.Interface, ns, name string) error
- func WaitForEndpointsAvailable(oc *CLI, serviceName string) error
- func WaitForInternalRegistryHostname(oc *CLI) (string, error)
- func WaitForNoPodsAvailable(oc *CLI) error
- func WaitForOpenShiftNamespaceImageStreams(oc *CLI) error
- func WaitForPods(c corev1client.PodInterface, label labels.Selector, ...) ([]string, error)
- func WaitForQueryOutputContains(oc *CLI, d Database, timeout time.Duration, admin bool, ...) error
- func WaitForQueryOutputSatisfies(oc *CLI, d Database, timeout time.Duration, admin bool, query string, ...) error
- func WaitForResourceQuotaSync(client corev1client.ResourceQuotaInterface, name string, ...) (corev1.ResourceList, error)
- func WaitForRouterInternalIP(oc *CLI) (string, error)
- func WaitForRouterServiceIP(oc *CLI) (string, error)
- func WaitForSelfSAR(interval, timeout time.Duration, c kclientset.Interface, ...) error
- func WaitForServiceAccount(c corev1client.ServiceAccountInterface, name string) error
- func WaitForUserBeAuthorized(oc *CLI, user, verb, resource string) error
- func WaitUntilAllHelpersAreUp(oc *CLI, helpers []Database) error
- func WaitUntilPodIsGone(c corev1client.PodInterface, podName string, timeout time.Duration) error
- func WaitUntilUp(oc *CLI, d Database, timeout time.Duration) error
- type BuildResult
- type CLI
- func (c *CLI) AddExplicitResourceToDelete(resource schema.GroupVersionResource, namespace, name string)
- func (c *CLI) AddResourceToDelete(resource schema.GroupVersionResource, metadata metav1.Object)
- func (c *CLI) AdminAppsClient() appsv1client.Interface
- func (c *CLI) AdminAuthorizationClient() authorizationv1client.Interface
- func (c *CLI) AdminBuildClient() buildv1client.Interface
- func (c *CLI) AdminConfig() *rest.Config
- func (c *CLI) AdminConfigClient() configv1client.Interface
- func (c *CLI) AdminDynamicClient() dynamic.Interface
- func (c *CLI) AdminImageClient() imagev1client.Interface
- func (c *CLI) AdminKubeClient() kubernetes.Interface
- func (c *CLI) AdminOAuthClient() oauthv1client.Interface
- func (c *CLI) AdminOauthClient() oauthv1client.Interface
- func (c *CLI) AdminOperatorClient() operatorv1client.Interface
- func (c *CLI) AdminProjectClient() projectv1client.Interface
- func (c *CLI) AdminQuotaClient() quotav1client.Interface
- func (c *CLI) AdminRouteClient() routev1client.Interface
- func (c *CLI) AdminSecurityClient() securityv1client.Interface
- func (c *CLI) AdminTemplateClient() templatev1client.Interface
- func (c *CLI) AdminUserClient() userv1client.Interface
- func (c *CLI) AppsClient() appsv1client.Interface
- func (c *CLI) Args(args ...string) *CLI
- func (c *CLI) AsAdmin() *CLI
- func (c *CLI) AuthorizationClient() authorizationv1client.Interface
- func (c *CLI) Background() (*exec.Cmd, *bytes.Buffer, *bytes.Buffer, error)
- func (c *CLI) BackgroundRC() (*exec.Cmd, io.ReadCloser, error)
- func (c *CLI) BuildClient() buildv1client.Interface
- func (c *CLI) ChangeUser(name string) *CLI
- func (c *CLI) CreateProject() string
- func (c *CLI) CreateUser(prefix string) *userv1.User
- func (c *CLI) DynamicClient() dynamic.Interface
- func (c *CLI) Execute() error
- func (c *CLI) GetClientConfigForUser(username string) *rest.Config
- func (c *CLI) ImageClient() imagev1client.Interface
- func (c *CLI) InputString(input string) *CLI
- func (c *CLI) KubeClient() kubernetes.Interface
- func (c *CLI) KubeFramework() *e2e.Framework
- func (c *CLI) Namespace() string
- func (c *CLI) Output() (string, error)
- func (c *CLI) OutputToFile(filename string) (string, error)
- func (c *CLI) Outputs() (string, string, error)
- func (c *CLI) ProjectClient() projectv1client.Interface
- func (c *CLI) QuotaClient() quotav1client.Interface
- func (c *CLI) RESTMapper() meta.RESTMapper
- func (c *CLI) RouteClient() routev1client.Interface
- func (c *CLI) Run(commands ...string) *CLI
- func (c *CLI) SetNamespace(ns string) *CLI
- func (c *CLI) SetupProject()
- func (c *CLI) TeardownProject()
- func (c *CLI) Template(t string) *CLI
- func (c *CLI) TemplateClient() templatev1client.Interface
- func (c *CLI) UserConfig() *rest.Config
- func (c *CLI) Username() string
- func (c *CLI) Verbose() *CLI
- func (c *CLI) WaitForAccessAllowed(review *kubeauthorizationv1.SelfSubjectAccessReview, user string) error
- func (c *CLI) WaitForAccessDenied(review *kubeauthorizationv1.SelfSubjectAccessReview, user string) error
- func (c CLI) WithoutNamespace() *CLI
- type Database
- type ExitError
- type GitRepo
- type LogDumperFunc
- type MissingTagError
- type ReplicaSet
- type SimpleReporter
- func (r *SimpleReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary)
- func (r *SimpleReporter) BeforeSuiteDidRun(*types.SetupSummary)
- func (r *SimpleReporter) SpecDidComplete(spec *types.SpecSummary)
- func (r *SimpleReporter) SpecSuiteDidEnd(summary *types.SuiteSummary)
- func (r *SimpleReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)
- func (r *SimpleReporter) SpecWillRun(spec *types.SpecSummary)
Constants ¶
const (
// This image is used for both client and server pods. Temporary repo location.
OpenLDAPTestImage = "docker.io/mrogers950/origin-openldap-test:fedora29"
)
Variables ¶
var TestContext *e2e.TestContextType = &e2e.TestContext
Functions ¶
func ArtifactDirPath ¶
func ArtifactDirPath() string
ArtifactDirPath returns the value of ARTIFACT_DIR environment variable
func ArtifactPath ¶
ArtifactPath returns the absolute path to the fix artifact file The path is relative to ARTIFACT_DIR
func CalculatePodMetrics ¶
func CalculatePodMetrics(adminClient kubernetes.Interface, adminConfig *restclient.Config) error
CalculatePodMetrics receives an admin client and an admin.kubeconfig, and traverses a list of operator namespaces, measuring requests-per-second for each operator pod, using the overall long-running time of each pod as a base metric.
func CheckBuildCancelled ¶
CheckBuildCancelled return true if the build was canceled
func CheckBuildFailed ¶
CheckBuildFailed return true if the build failed
func CheckBuildSuccess ¶
CheckBuildSuccess returns true if the build succeeded
func CheckForBuildEvent ¶
func CheckForBuildEvent(client corev1client.CoreV1Interface, build *buildv1.Build, reason, message string)
CheckForBuildEvent will poll a build for up to 1 minute looking for an event with the specified reason and message template.
func CheckImageStreamLatestTagPopulated ¶
func CheckImageStreamLatestTagPopulated(i *imagev1.ImageStream) bool
CheckImageStreamLatestTagPopulated returns true if the imagestream has a ':latest' tag filed
func CheckImageStreamTagNotFound ¶
func CheckImageStreamTagNotFound(i *imagev1.ImageStream) bool
CheckImageStreamTagNotFound return true if the imagestream update was not successful
func CheckPodIsReady ¶
CheckPodIsReady returns true if the pod's ready probe determined that the pod is ready.
func CheckPodIsRunning ¶
CheckPodIsRunning returns true if the pod is running
func CheckPodIsSucceeded ¶
CheckPodIsSucceeded returns true if the pod status is "Succdeded"
func CreateCentosExecPodOrFail ¶
func CreateCentosExecPodOrFail(client kubernetes.Interface, ns, generateName string, tweak func(*v1.Pod)) *v1.Pod
CreateCentosExecPodOrFail creates a centos:7 pause pod used as a vessel for kubectl exec commands. Pod name is uniquely generated.
func CreateExecPodOrFail ¶
func CreateExecPodOrFail(client corev1client.CoreV1Interface, ns, name string) string
CreateExecPodOrFail creates a simple busybox pod in a sleep loop used as a vessel for kubectl exec commands. Returns the name of the created pod. TODO: expose upstream
func CreateLDAPTestServer ¶
CreateLDAPTestServer deploys an LDAP server on the service network and then confirms StartTLS connectivity with an ldapsearch against it. It returns the ldapserver host and the ldap CA, or an error.
func CreateResource ¶
CreateResource creates the resources from the supplied json file (not a template); ginkgo error checking included
func DeletePVCsForDeployment ¶
func DumpAndReturnTagging ¶
DumpAndReturnTagging takes and array of tags and obtains the hex image IDs, dumps them to ginkgo for printing, and then returns them
func DumpApplicationPodLogs ¶
DumpApplicationPodLogs will dump the latest application logs for a DeploymentConfig for debug purposes
func DumpBuildLogs ¶
DumpBuildLogs will dump the latest build logs for a BuildConfig for debug purposes
func DumpBuilds ¶
func DumpBuilds(oc *CLI)
DumpBuilds will dump the yaml for every build in the test namespace; remember, pipeline builds don't have build pods so a generic framework dump won't cat our pipeline builds objs in openshift
func DumpConfigMapStates ¶
func DumpConfigMapStates(oc *CLI)
DumpConfigMapStates dumps the state of all ConfigMaps in the CLI's current namespace.
func DumpDeploymentLogs ¶
DumpDeploymentLogs will dump the latest deployment logs for a DeploymentConfig for debug purposes
func DumpImageStreams ¶
func DumpImageStreams(oc *CLI)
DumpImageStreams will dump both the openshift namespace and local namespace imagestreams as part of debugging when the language imagestreams in the openshift namespace seem to disappear
func DumpPersistentVolumeInfo ¶
func DumpPersistentVolumeInfo(oc *CLI)
func DumpPodLogs ¶
func DumpPodLogsStartingWith ¶
DumpPodLogsStartingWith will dump any pod starting with the name prefix provided
func DumpPodLogsStartingWithInNamespace ¶
DumpPodLogsStartingWith will dump any pod starting with the name prefix provided
func DumpPodStates ¶
func DumpPodStates(oc *CLI)
DumpPodStates dumps the state of all pods in the CLI's current namespace.
func DumpPodStatesInNamespace ¶
DumpPodStatesInNamespace dumps the state of all pods in the provided namespace.
func DumpPodsCommand ¶
DumpPodsCommand runs the provided command in every pod identified by selector in the provided namespace.
func DumpSampleOperator ¶
func DumpSampleOperator(oc *CLI)
func ExamineDiskUsage ¶
func ExamineDiskUsage()
ExamineDiskUsage will dump df output on the testing system; leveraging this as part of diagnosing the registry's disk filling up during external tests on jenkins
func ExaminePodDiskUsage ¶
func ExaminePodDiskUsage(oc *CLI)
ExaminePodDiskUsage will dump df/du output on registry pod; leveraging this as part of diagnosing the registry's disk filling up during external tests on jenkins
func ExecuteTest ¶
func ExecuteTest(t ginkgo.GinkgoTestingT, suite string)
func FatalErr ¶
func FatalErr(msg interface{})
FatalErr exits the test in case a fatal error has occurred.
func FetchURL ¶
FetchURL grabs the output from the specified url and returns it. It will retry once per second for duration retryTimeout if an error occurs during the request.
func FindCLIImage ¶
func FindImageFormatString ¶
FindImageFormatString returns a format string for components on the cluster. It returns false if no format string could be inferred from the cluster. OpenShift 4.0 clusters will not be able to infer an image format string, so you must wrap this method in one that can locate your specific image.
func FindRouterImage ¶
func FixturePath ¶
FixturePath returns an absolute path to a fixture file in test/extended/testdata/, test/integration/, or examples/.
func GetDeploymentConfigPods ¶
func GetDockerImageReference ¶
func GetDockerImageReference(c imagev1typedclient.ImageStreamInterface, name, tag string) (string, error)
GetDockerImageReference retrieves the full Docker pull spec from the given ImageStream and tag
func GetEndpointAddress ¶
GetEndpointAddress will return an "ip:port" string for the endpoint.
func GetImageIDForTags ¶
GetImageIDForTags will obtain the hexadecimal IDs for the array of human readible image tags IDs provided
func GetMasterThreadDump ¶
func GetMasterThreadDump(oc *CLI)
GetMasterThreadDump will get a golang thread stack dump
func GetPodForContainer ¶
GetPodForContainer creates a new Pod that runs specified container
func GetPodNamesByFilter ¶
func GetPodNamesByFilter(c corev1client.PodInterface, label labels.Selector, predicate func(kapiv1.Pod) bool) (podNames []string, err error)
GetPodNamesByFilter looks up pods that satisfy the predicate and returns their names.
func GetRouterPodTemplate ¶
func GetRouterPodTemplate(oc *CLI) (*corev1.PodTemplateSpec, string, error)
GetRouterPodTemplate finds the router pod template across different namespaces, helping to mitigate the transition from the default namespace to an operator namespace.
func InitDefaultEnvironmentVariables ¶
func InitDefaultEnvironmentVariables()
ProwGCPSetup makes sure certain required env vars are available in the case that extended tests are invoked directly via calls to ginkgo/extended.test
func InitStandardFlags ¶
func InitStandardFlags()
func IsClusterOperated ¶
func KubeConfigPath ¶
func KubeConfigPath() string
KubeConfigPath returns the value of KUBECONFIG environment variable
func LDAPClientMounts ¶
func LDAPClientMounts() ([]corev1.VolumeMount, []corev1.Volume)
func LaunchWebserverPod ¶
LaunchWebserverPod launches a pod serving http on port 8080 to act as the target for networking connectivity checks. The ip address of the created pod will be returned if the pod is launched successfully.
func ListImages ¶
ListImages initiates the equivalent of a `docker images`
func NewPodExecutor ¶
NewPodExecutor returns an executor capable of running commands in a Pod.
func NewRuleResolver ¶
func NewRuleResolver(informers rbacinformers.Interface) rbacregistryvalidation.AuthorizationRuleResolver
func ParseLabelsOrDie ¶
ParseLabelsOrDie turns the given string into a label selector or panics; for tests or other cases where you know the string is valid. TODO: Move this to the upstream labels package.
func PreTestDump ¶
func PreTestDump()
func ReadFixtureOrFail ¶
func ReadLDAPServerTestData ¶
func RemoveDeploymentConfigs ¶
RemoveDeploymentConfigs deletes the given DeploymentConfigs in a namespace
func RemovePodsWithPrefixes ¶
RemovePodsWithPrefixes deletes pods whose name begins with the supplied prefixes
func RemoveStatefulSets ¶
RemoveStatefulSets deletes the given stateful sets in a namespace
func RunOneShotCommandPod ¶
func RunOneShotCommandPod( oc *CLI, name, image, command string, volumeMounts []corev1.VolumeMount, volumes []corev1.Volume, env []corev1.EnvVar, timeout time.Duration, ) (string, []error)
RunOneShotCommandPod runs the given command in a pod and waits for completion and log output for the given timeout duration, returning the command output or an error. TODO: merge with the PodExecutor above
func SetupK8SNFSServerAndVolume ¶
func SetupK8SNFSServerAndVolume(oc *CLI, count int) (*kapiv1.Pod, []*kapiv1.PersistentVolume, error)
SetupK8SNFSServerAndVolume sets up an nfs server pod with count number of persistent volumes
func StartBuild ¶
StartBuild executes OC start-build with the specified arguments. StdOut and StdErr from the process are returned as separate strings.
func TimedWaitForAnImageStreamTag ¶
func TimedWaitForAnImageStreamTag(oc *CLI, namespace, name, tag string, waitTimeout time.Duration) error
TimedWaitForAnImageStreamTag waits until an image stream with given name has non-empty history for given tag. Gives up waiting after the specified waitTimeout
func VarSubOnFile ¶
VarSubOnFile reads in srcFile, finds instances of ${key} from the map and replaces them with their associated values.
func WaitForABuild ¶
func WaitForABuild(c buildv1clienttyped.BuildInterface, name string, isOK, isFailed, isCanceled func(*buildv1.Build) bool) error
WaitForABuild waits for a Build object to match either isOK or isFailed conditions.
func WaitForAJob ¶
func WaitForAJob(c batchv1client.JobInterface, name string, timeout time.Duration) error
func WaitForAnImageStream ¶
func WaitForAnImageStream(client imagev1typedclient.ImageStreamInterface, name string, isOK, isFailed func(*imagev1.ImageStream) bool) error
WaitForAnImageStream waits for an ImageStream to fulfill the isOK function
func WaitForAnImageStreamTag ¶
WaitForAnImageStreamTag waits until an image stream with given name has non-empty history for given tag. Defaults to waiting for 300 seconds
func WaitForBuildResult ¶
func WaitForBuildResult(c buildv1clienttyped.BuildInterface, result *BuildResult) error
WaitForBuildResult updates result wit the state of the build
func WaitForDeploymentConfig ¶
func WaitForDeploymentConfig(kc kubernetes.Interface, dcClient appsv1clienttyped.DeploymentConfigsGetter, namespace, name string, version int64, enforceNotProgressing bool, cli *CLI) error
WaitForDeploymentConfig waits for a DeploymentConfig to complete transition to a given version and report minimum availability.
func WaitForEndpoint ¶
func WaitForEndpoint(c kclientset.Interface, ns, name string) error
func WaitForInternalRegistryHostname ¶
WaitForInternalRegistryHostname waits for the internal registry hostname to be made available to the cluster.
func WaitForNoPodsAvailable ¶
WaitForNoPodsAvailable waits until there are no pods in the given namespace
func WaitForOpenShiftNamespaceImageStreams ¶
WaitForOpenShiftNamespaceImageStreams waits for the standard set of imagestreams to be imported
func WaitForPods ¶
func WaitForPods(c corev1client.PodInterface, label labels.Selector, predicate func(kapiv1.Pod) bool, count int, timeout time.Duration) ([]string, error)
WaitForPods waits until given number of pods that match the label selector and satisfy the predicate are found
func WaitForQueryOutputContains ¶
func WaitForQueryOutputContains(oc *CLI, d Database, timeout time.Duration, admin bool, query, resultSubstr string) error
WaitForQueryOutputContains will execute the query multiple times, until the specified substring is found in the results. This function should be used for testing replication, since it might take some time until the data is propagated to slaves.
func WaitForQueryOutputSatisfies ¶
func WaitForQueryOutputSatisfies(oc *CLI, d Database, timeout time.Duration, admin bool, query string, predicate func(string) bool) error
WaitForQueryOutputSatisfies will execute the query multiple times, until the specified predicate function is return true.
func WaitForResourceQuotaSync ¶
func WaitForResourceQuotaSync( client corev1client.ResourceQuotaInterface, name string, expectedUsage corev1.ResourceList, expectedIsUpperLimit bool, timeout time.Duration, ) (corev1.ResourceList, error)
WaitForResourceQuotaSync watches given resource quota until its usage is updated to desired level or a timeout occurs. If successful, used quota values will be returned for expected resources. Otherwise an ErrWaitTimeout will be returned. If expectedIsUpperLimit is true, given expected usage must compare greater or equal to quota's usage, which is useful for expected usage increment. Otherwise expected usage must compare lower or equal to quota's usage, which is useful for expected usage decrement.
func WaitForRouterInternalIP ¶
func WaitForRouterServiceIP ¶
func WaitForSelfSAR ¶
func WaitForSelfSAR(interval, timeout time.Duration, c kclientset.Interface, selfSAR authorizationapiv1.SelfSubjectAccessReviewSpec) error
func WaitForServiceAccount ¶
func WaitForServiceAccount(c corev1client.ServiceAccountInterface, name string) error
WaitForServiceAccount waits until the named service account gets fully provisioned
func WaitForUserBeAuthorized ¶
WaitForUserBeAuthorized waits a minute until the cluster bootstrap roles are available and the provided user is authorized to perform the action on the resource.
func WaitUntilAllHelpersAreUp ¶
WaitUntilAllHelpersAreUp waits until all helpers are ready to serve requests.
func WaitUntilPodIsGone ¶
func WaitUntilPodIsGone(c corev1client.PodInterface, podName string, timeout time.Duration) error
WaitUntilPodIsGone waits until the named Pod will disappear
Types ¶
type BuildResult ¶
type BuildResult struct { // BuildPath is a resource qualified name (e.g. "build/test-1"). BuildPath string // BuildName is the non-resource qualified name. BuildName string // StartBuildStdErr is the StdErr output generated by oc start-build. StartBuildStdErr string // StartBuildStdOut is the StdOut output generated by oc start-build. StartBuildStdOut string // StartBuildErr is the error, if any, returned by the direct invocation of the start-build command. StartBuildErr error // The buildconfig which generated this build. BuildConfigName string // Build is the resource created. May be nil if there was a timeout. Build *buildv1.Build // BuildAttempt represents that a Build resource was created. // false indicates a severe error unrelated to Build success or failure. BuildAttempt bool // BuildSuccess is true if the build was finshed successfully. BuildSuccess bool // BuildFailure is true if the build was finished with an error. BuildFailure bool // BuildCancelled is true if the build was canceled. BuildCancelled bool // BuildTimeout is true if there was a timeout waiting for the build to finish. BuildTimeout bool // Alternate log dumper function. If set, this is called instead of 'oc logs' LogDumper LogDumperFunc // The openshift client which created this build. Oc *CLI }
func NewBuildResult ¶
func NewBuildResult(oc *CLI, build *buildv1.Build) *BuildResult
func StartBuildAndWait ¶
func StartBuildAndWait(oc *CLI, args ...string) (result *BuildResult, err error)
StartBuildAndWait executes OC start-build with the specified arguments on an existing buildconfig. Note that start-build will be run with "-o=name" as a parameter when using this method. If no error is returned from this method, it means that the build attempted successfully, NOT that the build completed. For completion information, check the BuildResult object.
func StartBuildResult ¶
func StartBuildResult(oc *CLI, args ...string) (result *BuildResult, err error)
func (*BuildResult) AssertFailure ¶
func (t *BuildResult) AssertFailure() *BuildResult
Dumps logs and triggers a Ginkgo assertion if the build did NOT have an error (this will not assert on timeouts)
func (*BuildResult) AssertSuccess ¶
func (t *BuildResult) AssertSuccess() *BuildResult
Dumps logs and triggers a Ginkgo assertion if the build did NOT succeed.
func (*BuildResult) DumpLogs ¶
func (t *BuildResult) DumpLogs()
DumpLogs sends logs associated with this BuildResult to the GinkgoWriter.
func (*BuildResult) Logs ¶
func (t *BuildResult) Logs() (string, error)
Logs returns the logs associated with this build.
func (*BuildResult) LogsNoTimestamp ¶
func (t *BuildResult) LogsNoTimestamp() (string, error)
LogsNoTimestamp returns the logs associated with this build.
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI provides function to call the OpenShift CLI and Kubernetes and OpenShift clients.
func NewCLI ¶
NewCLI initialize the upstream E2E framework and set the namespace to match with the project name. Note that this function does not initialize the project role bindings for the namespace.
func NewCLIWithoutNamespace ¶
NewCLIWithoutNamespace initialize the upstream E2E framework without adding a namespace. You may call SetupProject() to create one.
func (*CLI) AddExplicitResourceToDelete ¶
func (c *CLI) AddExplicitResourceToDelete(resource schema.GroupVersionResource, namespace, name string)
func (*CLI) AddResourceToDelete ¶
func (c *CLI) AddResourceToDelete(resource schema.GroupVersionResource, metadata metav1.Object)
func (*CLI) AdminAppsClient ¶
func (c *CLI) AdminAppsClient() appsv1client.Interface
func (*CLI) AdminAuthorizationClient ¶
func (c *CLI) AdminAuthorizationClient() authorizationv1client.Interface
func (*CLI) AdminBuildClient ¶
func (c *CLI) AdminBuildClient() buildv1client.Interface
func (*CLI) AdminConfig ¶
func (*CLI) AdminConfigClient ¶
func (c *CLI) AdminConfigClient() configv1client.Interface
func (*CLI) AdminDynamicClient ¶
func (*CLI) AdminImageClient ¶
func (c *CLI) AdminImageClient() imagev1client.Interface
func (*CLI) AdminKubeClient ¶
func (c *CLI) AdminKubeClient() kubernetes.Interface
AdminKubeClient provides a Kubernetes client for the cluster admin user.
func (*CLI) AdminOAuthClient ¶
func (c *CLI) AdminOAuthClient() oauthv1client.Interface
func (*CLI) AdminOauthClient ¶
func (c *CLI) AdminOauthClient() oauthv1client.Interface
func (*CLI) AdminOperatorClient ¶
func (c *CLI) AdminOperatorClient() operatorv1client.Interface
func (*CLI) AdminProjectClient ¶
func (c *CLI) AdminProjectClient() projectv1client.Interface
func (*CLI) AdminQuotaClient ¶
func (c *CLI) AdminQuotaClient() quotav1client.Interface
func (*CLI) AdminRouteClient ¶
func (c *CLI) AdminRouteClient() routev1client.Interface
func (*CLI) AdminSecurityClient ¶
func (c *CLI) AdminSecurityClient() securityv1client.Interface
func (*CLI) AdminTemplateClient ¶
func (c *CLI) AdminTemplateClient() templatev1client.Interface
func (*CLI) AdminUserClient ¶
func (c *CLI) AdminUserClient() userv1client.Interface
func (*CLI) AppsClient ¶
func (c *CLI) AppsClient() appsv1client.Interface
func (*CLI) AuthorizationClient ¶
func (c *CLI) AuthorizationClient() authorizationv1client.Interface
func (*CLI) Background ¶
Background executes the command in the background and returns the Cmd object which may be killed later via cmd.Process.Kill(). It also returns buffers holding the stdout & stderr of the command, which may be read from only after calling cmd.Wait().
func (*CLI) BackgroundRC ¶
BackgroundRC executes the command in the background and returns the Cmd object which may be killed later via cmd.Process.Kill(). It returns a ReadCloser for stdout. If in doubt, use Background(). Consult the os/exec documentation.
func (*CLI) BuildClient ¶
func (c *CLI) BuildClient() buildv1client.Interface
func (*CLI) ChangeUser ¶
ChangeUser changes the user used by the current CLI session.
func (*CLI) CreateProject ¶
SetupProject creates a new project and assign a random user to the project. All resources will be then created within this project. TODO this should be removed. It's only used by image tests.
func (*CLI) DynamicClient ¶
func (*CLI) Execute ¶
Execute executes the current command and return error if the execution failed This function will set the default output to Ginkgo writer.
func (*CLI) GetClientConfigForUser ¶
func (*CLI) ImageClient ¶
func (c *CLI) ImageClient() imagev1client.Interface
func (*CLI) InputString ¶
InputString adds expected input to the command
func (*CLI) KubeClient ¶
func (c *CLI) KubeClient() kubernetes.Interface
KubeClient provides a Kubernetes client for the current namespace
func (*CLI) KubeFramework ¶
KubeFramework returns Kubernetes framework which contains helper functions specific for Kubernetes resources
func (*CLI) Namespace ¶
Namespace returns the name of the namespace used in the current test case. If the namespace is not set, an empty string is returned.
func (*CLI) OutputToFile ¶
OutputToFile executes the command and store output to a file
func (*CLI) Outputs ¶
Outputs executes the command and returns the stdout/stderr output as separate strings
func (*CLI) ProjectClient ¶
func (c *CLI) ProjectClient() projectv1client.Interface
func (*CLI) QuotaClient ¶
func (c *CLI) QuotaClient() quotav1client.Interface
func (*CLI) RESTMapper ¶
func (c *CLI) RESTMapper() meta.RESTMapper
func (*CLI) RouteClient ¶
func (c *CLI) RouteClient() routev1client.Interface
func (*CLI) Run ¶
Run executes given OpenShift CLI command verb (iow. "oc <verb>"). This function also override the default 'stdout' to redirect all output to a buffer and prepare the global flags such as namespace and config path.
func (*CLI) SetNamespace ¶
SetNamespace sets a new namespace
func (*CLI) SetupProject ¶
func (c *CLI) SetupProject()
SetupProject creates a new project and assign a random user to the project. All resources will be then created within this project.
func (*CLI) TeardownProject ¶
func (c *CLI) TeardownProject()
TeardownProject removes projects created by this test.
func (*CLI) Template ¶
Template sets a Go template for the OpenShift CLI command. This is equivalent of running "oc get foo -o template --template='{{ .spec }}'"
func (*CLI) TemplateClient ¶
func (c *CLI) TemplateClient() templatev1client.Interface
func (*CLI) UserConfig ¶
func (*CLI) Username ¶
Username returns the name of currently logged user. If there is no user assigned for the current session, it returns 'admin'.
func (*CLI) WaitForAccessAllowed ¶
func (c *CLI) WaitForAccessAllowed(review *kubeauthorizationv1.SelfSubjectAccessReview, user string) error
func (*CLI) WaitForAccessDenied ¶
func (c *CLI) WaitForAccessDenied(review *kubeauthorizationv1.SelfSubjectAccessReview, user string) error
func (CLI) WithoutNamespace ¶
WithoutNamespace instructs the command should be invoked without adding --namespace parameter
type Database ¶
type Database interface { // PodName returns the name of the Pod this helper is bound to. PodName() string // IsReady indicates whether the underlying Pod is ready for queries. IsReady(oc *CLI) (bool, error) // Query queries the database as a regular user. Query(oc *CLI, query string) (string, error) // QueryPrivileged queries the database as a privileged user. QueryPrivileged(oc *CLI, query string) (string, error) // TestRemoteLogin tests whether it is possible to remote login to hostAddress. TestRemoteLogin(oc *CLI, hostAddress string) error }
Database interface allows testing database images.
type GitRepo ¶
type GitRepo struct { RepoPath string // contains filtered or unexported fields }
func NewGitRepo ¶
NewGitRepo creates temporary test directories with local and "remote" git repo
func (GitRepo) AddAndCommit ¶
AddAndCommit commits a file with its content to local repo
type LogDumperFunc ¶
type LogDumperFunc func(oc *CLI, br *BuildResult) (string, error)
type MissingTagError ¶
type MissingTagError struct {
Tags []string
}
func (MissingTagError) Error ¶
func (mte MissingTagError) Error() string
type ReplicaSet ¶
type ReplicaSet interface { // QueryPrimary queries the database on primary node as a regular user. QueryPrimary(oc *CLI, query string) (string, error) }
ReplicaSet interface allows to interact with database on multiple nodes.
type SimpleReporter ¶
func NewSimpleReporter ¶
func NewSimpleReporter() *SimpleReporter
func (*SimpleReporter) AfterSuiteDidRun ¶
func (r *SimpleReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary)
func (*SimpleReporter) BeforeSuiteDidRun ¶
func (r *SimpleReporter) BeforeSuiteDidRun(*types.SetupSummary)
func (*SimpleReporter) SpecDidComplete ¶
func (r *SimpleReporter) SpecDidComplete(spec *types.SpecSummary)
func (*SimpleReporter) SpecSuiteDidEnd ¶
func (r *SimpleReporter) SpecSuiteDidEnd(summary *types.SuiteSummary)
func (*SimpleReporter) SpecSuiteWillBegin ¶
func (r *SimpleReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)
func (*SimpleReporter) SpecWillRun ¶
func (r *SimpleReporter) SpecWillRun(spec *types.SpecSummary)