Documentation ¶
Index ¶
- Variables
- func CorruptImage(corruptee, corruptor, strategy string)
- func CreatePodForImage(dockerImageReference string) *kapi.Pod
- func ExtendedTestPath() string
- func FatalErr(msg interface{})
- func FixturePath(elem ...string) string
- func GetDockerImageReference(c client.ImageStreamInterface, name, tag string) (string, error)
- func GetImageIDForTags(comps []string) ([]string, error)
- func KubeConfigPath() string
- func PullImage(name string) error
- func ResetImage(tags map[string]string)
- func StartBuild(jsonFile, buildPrefix string, oc *CLI)
- func TagImage(tagee, tagor string) error
- func VerifyImagesDifferent(comp1, comp2, strategy string)
- func VerifyImagesSame(comp1, comp2, strategy string)
- func WaitForABuild(c client.BuildInterface, name string, ...) error
- func WaitForADeployment(client kclient.ReplicationControllerInterface, name string, ...) error
- func WaitForAnImageStream(client client.ImageStreamInterface, name string, ...) error
- func WaitForBuild(context, buildName string, oc *CLI)
- func WaitForBuilderAccount(c kclient.ServiceAccountsInterface) error
- func WriteObjectToFile(obj runtime.Object, filename string) error
- type CLI
- func (c *CLI) AdminREST() *client.Client
- func (c *CLI) Args(args ...string) *CLI
- func (c *CLI) ChangeUser(name string) *CLI
- func (c *CLI) Execute() error
- func (c *CLI) KubeFramework() *e2e.Framework
- func (c *CLI) KubeREST() *kclient.Client
- func (c *CLI) Namespace() string
- func (c *CLI) Output() (string, error)
- func (c *CLI) OutputToFile(filename string) (string, error)
- func (c *CLI) REST() *client.Client
- func (c *CLI) Run(verb string) *CLI
- func (c *CLI) SetNamespace(ns string) *CLI
- func (c *CLI) SetOutput(out io.Writer) *CLI
- func (c *CLI) SetOutputDir(dir string) *CLI
- func (c *CLI) SetupProject(name string, kubeClient *kclient.Client) (*kapi.Namespace, error)
- func (c *CLI) Template(t string) *CLI
- func (c *CLI) Username() string
- func (c *CLI) Verbose() *CLI
- type MissingTagError
Constants ¶
This section is empty.
Variables ¶
var CheckBuildFailedFunc = func(b *buildapi.Build) bool { return b.Status.Phase == buildapi.BuildPhaseFailed || b.Status.Phase == buildapi.BuildPhaseError }
CheckBuildFailedFunc return true if the build failed
var CheckBuildSuccessFunc = func(b *buildapi.Build) bool { return b.Status.Phase == buildapi.BuildPhaseComplete }
CheckBuildSuccessFunc returns true if the build succeeded
var CheckDeploymentCompletedFunc = func(d *kapi.ReplicationController) bool { return d.Annotations[deployapi.DeploymentStatusAnnotation] == string(deployapi.DeploymentStatusComplete) }
CheckDeploymentCompletedFunc returns true if the deployment completed
var CheckDeploymentFailedFunc = func(d *kapi.ReplicationController) bool { return d.Annotations[deployapi.DeploymentStatusAnnotation] == string(deployapi.DeploymentStatusFailed) }
CheckDeploymentFailedFunc returns true if the deployment failed
var CheckImageStreamLatestTagPopulatedFunc = func(i *imageapi.ImageStream) bool {
_, ok := i.Status.Tags["latest"]
return ok
}
CheckImageStreamLatestTagPopulatedFunc returns true if the imagestream has a ':latest' tag filed
var CheckImageStreamTagNotFoundFunc = func(i *imageapi.ImageStream) bool { return strings.Contains(i.Annotations[imageapi.DockerImageRepositoryCheckAnnotation], "not") || strings.Contains(i.Annotations[imageapi.DockerImageRepositoryCheckAnnotation], "error") }
CheckImageStreamTagNotFoundFunc return true if the imagestream update was not successful
var TestContext e2e.TestContextType
Functions ¶
func CorruptImage ¶
func CorruptImage(corruptee, corruptor, strategy string)
CorruptImage is a helper that tags the image to be corrupted, the corruptee, as the corruptor string, resulting in the wrong image being used when corruptee is referenced later on; strategy is for ginkgo debug; ginkgo error checking leveraged
func CreatePodForImage ¶
CreatePodForImage creates a Pod for the given image name. The dockerImageReference must be full docker pull spec.
func ExtendedTestPath ¶
func ExtendedTestPath() string
ExtendedTestPath returns absolute path to extended tests directory
func FatalErr ¶
func FatalErr(msg interface{})
FatalErr exits the test in case a fatal error has occured.
func FixturePath ¶
FixturePath returns absolute path to given fixture file The path is relative to EXTENDED_TEST_PATH (./test/extended/*)
func GetDockerImageReference ¶
func GetDockerImageReference(c client.ImageStreamInterface, name, tag string) (string, error)
GetDockerImageReference retrieves the full Docker pull spec from the given ImageStream and tag
func GetImageIDForTags ¶
GetImageIDForTags will obtain the hexadecimal IDs for the array of human readible image tags IDs provided
func KubeConfigPath ¶
func KubeConfigPath() string
KubeConfigPath returns the value of KUBECONFIG environment variable
func PullImage ¶
PullImage, as the name implies, initiates the equivalent of a `docker pull` for the "name" parameter
func ResetImage ¶
ResetImage is a helper the allows the programmer to undo any corruption performed by CorruptImage; ginkgo error checking leveraged
func StartBuild ¶
StartBuild creates a build config from the supplied json file (not a template) and then starts a build, using the supplied oc/cli client for both operations; ginkgo error checking included
func TagImage ¶
TagImage, as the name implies, will apply the "tagor" tag string to the image current tagged by "tagee"
func VerifyImagesDifferent ¶
func VerifyImagesDifferent(comp1, comp2, strategy string)
VerifyImagesDifferent will that the two supplied image tags and see if they reference different hexadecimal image IDs; strategy is for ginkgo debug, also leverage ginkgo error checking
func VerifyImagesSame ¶
func VerifyImagesSame(comp1, comp2, strategy string)
VerifyImagesSame will take the two supplied image tags and see if they reference the same hexadecimal image ID; strategy is for debug
func WaitForABuild ¶
func WaitForABuild(c client.BuildInterface, name string, isOK, isFailed func(*buildapi.Build) bool) error
WaitForABuild waits for a Build object to match either isOK or isFailed conditions
func WaitForADeployment ¶ added in v1.0.6
func WaitForADeployment(client kclient.ReplicationControllerInterface, name string, isOK, isFailed func(*kapi.ReplicationController) bool) error
WaitForADeployment waits for a Deployment to fulfill the isOK function
func WaitForAnImageStream ¶ added in v1.0.6
func WaitForAnImageStream(client client.ImageStreamInterface, name string, isOK, isFailed func(*imageapi.ImageStream) bool) error
WaitForAnImageStream waits for an ImageStream to fulfill the isOK function
func WaitForBuild ¶
WaitForBuild is a wrapper for WaitForABuild in this package that takes in an oc/cli client; some ginkgo based debug along with ginkgo error checking
func WaitForBuilderAccount ¶ added in v1.0.6
func WaitForBuilderAccount(c kclient.ServiceAccountsInterface) error
WaitForBuilderAccount waits until the builder service account gets fully provisioned
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI provides function to call the OpenShift CLI and Kubernetes and OpenShift REST 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 (*CLI) ChangeUser ¶
ChangeUser changes the user used by the current CLI session.
func (*CLI) Execute ¶
Execute executes the current command and return error if the execution failed This function will set the default output to stdout.
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) REST ¶
REST provides an OpenShift REST client for the current user. If the user is not set, then it provides REST client for the cluster admin user
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) SetOutputDir ¶
SetOutputDir change the default output directory for temporary files
func (*CLI) SetupProject ¶
SetupProject creates a new project and assign a random user to the project. All resources will be then created within this project and Kubernetes E2E suite will destroy the project after test case finish. Note that the kubeClient is not used and serves just to make this function compatible with upstream function.
func (*CLI) Template ¶
Template sets a Go template for the OpenShift CLI command. This is equivalent of running "oc get foo -o template -t '{{ .spec }}'"
type MissingTagError ¶
type MissingTagError struct {
Tags []string
}
func (MissingTagError) Error ¶
func (mte MissingTagError) Error() string