Documentation ¶
Index ¶
- Constants
- Variables
- type Creds
- type TestFramework
- func (f *TestFramework) GetNode(externalIP string) (*v1.Node, error)
- func (f *TestFramework) GetReleaseArtifactSHA(artifactName string) (string, error)
- func (f *TestFramework) GetReleaseArtifactURL(artifactName string) (string, error)
- func (f *TestFramework) Setup(vmCount int, credentials []*types.Credentials, skipVMsetup bool) error
- func (f *TestFramework) TearDown()
- type WindowsVM
Constants ¶
const ( // RetryCount is the amount of times we will retry an api operation RetryCount = 20 // RetryInterval is the interval of time until we retry after a failure RetryInterval = 5 * time.Second // WindowsLabel represents the node label that need to be applied to the Windows node created WindowsLabel = "node.openshift.io/os_id=Windows" )
Variables ¶
var ( // clusterAddress is the address of the OpenShift cluster e.g. "foo.fah.com". // This should not include "https://api-" or a port ClusterAddress string )
Functions ¶
This section is empty.
Types ¶
type Creds ¶
type Creds []*types.Credentials
Creds is used for parsing the vmCreds command line argument
type TestFramework ¶
type TestFramework struct { // WinVms contains the Windows VMs that are created to execute the test suite WinVMs []WindowsVM // k8sclientset is the kubernetes clientset we will use to query the cluster's status K8sclientset *kubernetes.Clientset // OSConfigClient is the OpenShift config client, we will use to query the OpenShift api object status OSConfigClient *configclient.Clientset // ClusterVersion is the major.minor.patch version of the OpenShift cluster ClusterVersion string // contains filtered or unexported fields }
TestFramework holds the info to run the test suite.
func (*TestFramework) GetNode ¶
func (f *TestFramework) GetNode(externalIP string) (*v1.Node, error)
GetNode returns a pointer to the node object associated with the external IP provided
func (*TestFramework) GetReleaseArtifactSHA ¶
func (f *TestFramework) GetReleaseArtifactSHA(artifactName string) (string, error)
GetReleaseArtifactSHA returns the SHA256 of the release artifact specified, given the body of the release
func (*TestFramework) GetReleaseArtifactURL ¶
func (f *TestFramework) GetReleaseArtifactURL(artifactName string) (string, error)
GetLatestReleaseArtifactURL returns the URL of the releases artifact matching the given name
func (*TestFramework) Setup ¶
func (f *TestFramework) Setup(vmCount int, credentials []*types.Credentials, skipVMsetup bool) error
Setup creates and initializes a variable amount of Windows VMs. If the array of credentials are passed then it will be used in lieu of creating new VMs. If skipVMsetup is true then it will result in the VM setup not being run. These two options are mainly used during test development.
func (*TestFramework) TearDown ¶
func (f *TestFramework) TearDown()
TearDown destroys the resources created by the Setup function
type WindowsVM ¶
type WindowsVM interface { // CopyFile copies the given file to the remote directory in the Windows VM. The remote directory is created if it // does not exist CopyFile(string, string) error // Run executes the given command remotely on the Windows VM and returns the output of stdout and stderr. If the // bool is set, it implies that the cmd is to be execute in PowerShell. Run(string, bool) (string, string, error) // Run executes the given command remotely on the Windows VM over a ssh connection and returns the combined output // of stdout and stderr. If the bool is set, it implies that the cmd is to be execute in PowerShell. This function // should be used in scenarios where you want to execute a command that runs in the background. In these cases we // have observed that Run() returns before the command completes and as a result killing the process. RunOverSSH(string, bool) (string, error) // GetCredentials returns the interface for accessing the VM credentials. It is up to the caller to check if non-nil // Credentials are returned before usage. GetCredentials() *types.Credentials // Reinitialize re-initializes the Windows VM. Presently only the ssh client is reinitialized. Reinitialize() error // Destroy destroys the Windows VM Destroy() error }
WindowsVM is the interface for interacting with a Windows VM in the test framework