Documentation ¶
Index ¶
- Constants
- type CommandArgs
- type CommandOut
- type HelmHelper
- func (h *HelmHelper) DeleteLocalRookHelmChart(deployName string) error
- func (h *HelmHelper) Execute(args ...string) (string, error)
- func (h *HelmHelper) GetLocalRookHelmChartVersion(chartName string) (string, error)
- func (h *HelmHelper) InstallLocalRookHelmChart(chartName string, deployName string, chartVersion string, namespace string) error
- type K8sHelper
- func (k8sh *K8sHelper) CheckPodCountAndState(podName string, namespace string, minExpected int, expectedPhase string) bool
- func (k8sh *K8sHelper) CreateAnonSystemClusterBinding()
- func (k8sh *K8sHelper) CreateExternalRGWService(namespace, storeName string) error
- func (k8sh *K8sHelper) DeleteResource(args []string) (string, error)
- func (k8sh *K8sHelper) DeleteRoleAndBindings(name, namespace string) error
- func (k8sh *K8sHelper) GetExternalRGWServiceURL(storeName string, namespace string) (string, error)
- func (k8sh *K8sHelper) GetInternalRGWServiceURL(storeName string, namespace string) (string, error)
- func (k8sh *K8sHelper) GetK8sServerVersion() string
- func (k8sh *K8sHelper) GetMonitorServices(namespace string) (map[string]string, error)
- func (k8sh *K8sHelper) GetPVCStatus(namespace string, name string) (v1.PersistentVolumeClaimPhase, error)
- func (k8sh *K8sHelper) GetPodDetails(podNamePattern string, namespace string) (string, error)
- func (k8sh *K8sHelper) GetPodEvents(podNamePattern string, namespace string) (*v1.EventList, error)
- func (k8sh *K8sHelper) GetPodHostID(podNamePattern string, namespace string) (string, error)
- func (k8sh *K8sHelper) GetRGWServiceURL(storeName string, namespace string) (string, error)
- func (k8sh *K8sHelper) GetResource(args []string) (string, error)
- func (k8sh *K8sHelper) GetRookLogs(podAppName string, hostType string, namespace string, testName string)
- func (k8sh *K8sHelper) GetService(servicename string, namespace string) (*v1.Service, error)
- func (k8sh *K8sHelper) GetServiceNodePort(serviceName string, namespace string) (string, error)
- func (k8sh *K8sHelper) GetVolumeAttachmentResourceName(namespace, pvcName string) (string, error)
- func (k8sh *K8sHelper) IsCRDPresent(crdName string) bool
- func (k8sh *K8sHelper) IsPodInError(podNamePattern, namespace, reason, containingMessage string) bool
- func (k8sh *K8sHelper) IsPodInExpectedState(podNamePattern string, namespace string, state string) bool
- func (k8sh *K8sHelper) IsPodRunning(name string, namespace string) bool
- func (k8sh *K8sHelper) IsPodTerminated(name string, namespace string) bool
- func (k8sh *K8sHelper) IsPodWithLabelRunning(label string, namespace string) bool
- func (k8sh *K8sHelper) IsRookInstalled(namespace string) bool
- func (k8sh *K8sHelper) IsServiceUp(name string, namespace string) bool
- func (k8sh *K8sHelper) IsStorageClassPresent(name string) (bool, error)
- func (k8sh *K8sHelper) IsThirdPartyResourcePresent(tprname string) bool
- func (k8sh *K8sHelper) IsVolumeAttachmentResourceAbsent(namespace, volumeAttachmentName string) bool
- func (k8sh *K8sHelper) IsVolumeAttachmentResourcePresent(namespace, volumeAttachmentName string) bool
- func (k8sh *K8sHelper) Kubectl(args ...string) (string, error)
- func (k8sh *K8sHelper) KubectlWithStdin(stdin string, args ...string) (string, error)
- func (k8sh *K8sHelper) ResourceOperation(action string, podDefiniton string) (string, error)
- func (k8sh *K8sHelper) ResourceOperationFromTemplate(action string, podDefinition string, config map[string]string) (string, error)
- func (k8sh *K8sHelper) VersionAtLeast(minVersion string) bool
- func (k8sh *K8sHelper) WaitUntilNameSpaceIsDeleted(namespace string) bool
- func (k8sh *K8sHelper) WaitUntilPVCIsBound(namespace string, pvcname string) bool
- func (k8sh *K8sHelper) WaitUntilPVCIsDeleted(namespace string, pvcname string) bool
- func (k8sh *K8sHelper) WaitUntilPodInNamespaceIsDeleted(podNamePattern string, namespace string) bool
- func (k8sh *K8sHelper) WaitUntilPodIsDeleted(podNamePattern string) bool
- func (k8sh *K8sHelper) WaitUntilPodWithLabelDeleted(label string, namespace string) bool
- type MySQLHelper
- func (h *MySQLHelper) CloseConnection()
- func (h *MySQLHelper) CreateTable() sql.Result
- func (h *MySQLHelper) DeleteRandomRow() sql.Result
- func (h *MySQLHelper) InsertRandomData() sql.Result
- func (h *MySQLHelper) PingSuccess() bool
- func (h *MySQLHelper) SelectRandomData(limit int) *sql.Rows
- func (h *MySQLHelper) TableExists() bool
- func (h *MySQLHelper) TableRowCount() (count int)
- type S3Helper
- func (h *S3Helper) CreateBucket(name string) (bool, error)
- func (h *S3Helper) DeleteBucket(name string) (bool, error)
- func (h *S3Helper) DeleteObjectInBucket(bucketname string, key string) (bool, error)
- func (h *S3Helper) GetObjectInBucket(bucketname string, key string) (string, error)
- func (h *S3Helper) PutObjectInBucket(bucketname string, body string, key string, contentType string) (bool, error)
Constants ¶
const ( //RetryLoop params for tests. RetryLoop = 30 //RetryInterval param for test - wait time while in RetryLoop RetryInterval = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandArgs ¶
type CommandArgs struct { Command string SubCommand string CmdArgs []string OptionalArgs []string PipeToStdIn string EnvironmentVariable []string }
CommandArgs is a warpper for cmd args
type CommandOut ¶
CommandOut is a wrapper for cmd out returned after executing command args
func ExecuteCommand ¶
func ExecuteCommand(cmdStruct CommandArgs) CommandOut
ExecuteCommand executes a os command with stdin and returns output
type HelmHelper ¶ added in v0.6.0
type HelmHelper struct {
// contains filtered or unexported fields
}
HelmHelper is wrapper for running helm commands
func NewHelmHelper ¶ added in v0.6.0
func NewHelmHelper() *HelmHelper
NewHelmHelper creates a instance of HelmHelper
func (*HelmHelper) DeleteLocalRookHelmChart ¶ added in v0.6.0
func (h *HelmHelper) DeleteLocalRookHelmChart(deployName string) error
DeleteLocalRookHelmChart uninstalls a give helm deploy
func (*HelmHelper) Execute ¶ added in v0.6.0
func (h *HelmHelper) Execute(args ...string) (string, error)
Execute is wrapper for executing helm commands
func (*HelmHelper) GetLocalRookHelmChartVersion ¶ added in v0.6.0
func (h *HelmHelper) GetLocalRookHelmChartVersion(chartName string) (string, error)
GetLocalRookHelmChartVersion returns helm chart version for a give chart
func (*HelmHelper) InstallLocalRookHelmChart ¶ added in v0.6.0
func (h *HelmHelper) InstallLocalRookHelmChart(chartName string, deployName string, chartVersion string, namespace string) error
InstallLocalRookHelmChart installs a give helm chart
type K8sHelper ¶
type K8sHelper struct { Clientset *kubernetes.Clientset RunningInCluster bool T func() *testing.T // contains filtered or unexported fields }
K8sHelper is a helper for common kubectl commads
func CreateK8sHelper ¶ added in v0.6.0
CreateK8sHelper creates a instance of k8sHelper
func (*K8sHelper) CheckPodCountAndState ¶ added in v0.6.0
func (k8sh *K8sHelper) CheckPodCountAndState(podName string, namespace string, minExpected int, expectedPhase string) bool
CheckPodCountAndState returns true if expected number of pods with matching name are found and are in expected state
func (*K8sHelper) CreateAnonSystemClusterBinding ¶ added in v0.6.0
func (k8sh *K8sHelper) CreateAnonSystemClusterBinding()
CreateAnonSystemClusterBinding Creates anon-user-access clusterrolebinding for cluster-admin role - used by kubeadm env.
func (*K8sHelper) CreateExternalRGWService ¶ added in v0.6.0
CreateExternalRGWService creates a service for rgw access external to the cluster on a node port
func (*K8sHelper) DeleteResource ¶
DeleteResource performs a kubectl delete on give args
func (*K8sHelper) DeleteRoleAndBindings ¶ added in v0.6.0
func (*K8sHelper) GetExternalRGWServiceURL ¶ added in v0.6.0
GetRGWServiceURL returns URL of ceph RGW service in the cluster
func (*K8sHelper) GetInternalRGWServiceURL ¶ added in v0.6.0
GetRGWServiceURL returns URL of ceph RGW service in the cluster
func (*K8sHelper) GetK8sServerVersion ¶
GetK8sServerVersion returns k8s server version under test
func (*K8sHelper) GetMonitorServices ¶
GetMonitorServices returns all ceph mon pod names
func (*K8sHelper) GetPVCStatus ¶
func (k8sh *K8sHelper) GetPVCStatus(namespace string, name string) (v1.PersistentVolumeClaimPhase, error)
GetPVCStatus returns status of PVC
func (*K8sHelper) GetPodDetails ¶
GetPodDetails returns details about a pod
func (*K8sHelper) GetPodEvents ¶ added in v0.6.0
GetPodEvents returns events about a pod
func (*K8sHelper) GetPodHostID ¶
GetPodHostID returns HostIP address of a pod
func (*K8sHelper) GetRGWServiceURL ¶
func (*K8sHelper) GetResource ¶
GetResource performs a kubectl get on give args
func (*K8sHelper) GetRookLogs ¶ added in v0.6.0
func (k8sh *K8sHelper) GetRookLogs(podAppName string, hostType string, namespace string, testName string)
GetRookLogs captures logs from specified rook pod and writes it to specified file
func (*K8sHelper) GetService ¶
GetService returns output from "kubectl get svc $NAME" command
func (*K8sHelper) GetServiceNodePort ¶ added in v0.6.0
GetServiceNodePort returns nodeProt of service
func (*K8sHelper) GetVolumeAttachmentResourceName ¶ added in v0.6.0
GetVolumeAttachmentResourceName gets the VolumeAttachment object name from the PVC
func (*K8sHelper) IsCRDPresent ¶
IsCRDPresent returns true if custom resource definition is present
func (*K8sHelper) IsPodInError ¶ added in v0.6.0
func (k8sh *K8sHelper) IsPodInError(podNamePattern, namespace, reason, containingMessage string) bool
IsPodInError returns true if a Pod is in error status with the given reason and contains the given message
func (*K8sHelper) IsPodInExpectedState ¶
func (k8sh *K8sHelper) IsPodInExpectedState(podNamePattern string, namespace string, state string) bool
IsPodInExpectedState waits for 90s for a pod to be an expected state If the pod is in expected state within 90s true is returned, if not false
func (*K8sHelper) IsPodRunning ¶
IsPodRunning returns true if a Pod is running status or goes to Running status within 90s else returns false
func (*K8sHelper) IsPodTerminated ¶
IsPodTerminated returns true if a Pod is terminated status or goes to Terminated status within 90s else returns false\
func (*K8sHelper) IsPodWithLabelRunning ¶ added in v0.6.0
IsPodWithLabelRunning returns true if a Pod is running status or goes to Running status within 90s else returns false
func (*K8sHelper) IsRookInstalled ¶ added in v0.6.0
IsRookInstalled returns true is rook-api service is running(indicating rook is installed)
func (*K8sHelper) IsServiceUp ¶
IsServiceUp returns true if a service is up or comes up within 150s, else returns false
func (*K8sHelper) IsStorageClassPresent ¶
IsStorageClassPresent returns true if storageClass is present, if not false
func (*K8sHelper) IsThirdPartyResourcePresent ¶
IsThirdPartyResourcePresent returns true if Third party resource is present
func (*K8sHelper) IsVolumeAttachmentResourceAbsent ¶ added in v0.6.0
func (k8sh *K8sHelper) IsVolumeAttachmentResourceAbsent(namespace, volumeAttachmentName string) bool
IsVolumeAttachmentResourceAbsent returns true if the VolumeAttachment resource is deleted/absent within 90s else returns false
func (*K8sHelper) IsVolumeAttachmentResourcePresent ¶ added in v0.6.0
func (k8sh *K8sHelper) IsVolumeAttachmentResourcePresent(namespace, volumeAttachmentName string) bool
IsVolumeAttachmentResourcePresent returns true if VolumeAttachment resource is present
func (*K8sHelper) KubectlWithStdin ¶
KubectlWithStdin is wrapper for executing kubectl commands in stdin
func (*K8sHelper) ResourceOperation ¶
ResourceOperation performs a kubectl action on a pod definition
func (*K8sHelper) ResourceOperationFromTemplate ¶
func (k8sh *K8sHelper) ResourceOperationFromTemplate(action string, podDefinition string, config map[string]string) (string, error)
ResourceOperationFromTemplate performs a kubectl action from a template file after replacing its context
func (*K8sHelper) VersionAtLeast ¶ added in v0.6.0
func (*K8sHelper) WaitUntilNameSpaceIsDeleted ¶ added in v0.6.0
WaitUntilNameSpaceIsDeleted waits for namespace to be deleted for 180s. If namespace is deleted True is returned, if not false.
func (*K8sHelper) WaitUntilPVCIsBound ¶
WaitUntilPVCIsBound waits for a PVC to be in bound state for 90 seconds if PVC goes to Bound state within 90s True is returned, if not false
func (*K8sHelper) WaitUntilPVCIsDeleted ¶ added in v0.6.0
func (*K8sHelper) WaitUntilPodInNamespaceIsDeleted ¶
func (k8sh *K8sHelper) WaitUntilPodInNamespaceIsDeleted(podNamePattern string, namespace string) bool
WaitUntilPodInNamespaceIsDeleted waits for 90s for a pod in a namespace to be terminated If the pod disappears within 90s true is returned, if not false
func (*K8sHelper) WaitUntilPodIsDeleted ¶
WaitUntilPodIsDeleted waits for 90s for a pod to be terminated If the pod disappears within 90s true is returned, if not false
type MySQLHelper ¶
MySQLHelper contains pointer to MySqlDB and wrappers for basic object on mySql database
func CreateNewMySQLHelper ¶
func CreateNewMySQLHelper(username string, password string, url string, dbname string) *MySQLHelper
CreateNewMySQLHelper creates a s3 client for specfied endpoint and creds
func (*MySQLHelper) CloseConnection ¶
func (h *MySQLHelper) CloseConnection()
CloseConnection function closes mysql connection
func (*MySQLHelper) CreateTable ¶
func (h *MySQLHelper) CreateTable() sql.Result
CreateTable func create sample Table
func (*MySQLHelper) DeleteRandomRow ¶
func (h *MySQLHelper) DeleteRandomRow() sql.Result
DeleteRandomRow deletes a random row
func (*MySQLHelper) InsertRandomData ¶
func (h *MySQLHelper) InsertRandomData() sql.Result
InsertRandomData Inserts random Data into the table
func (*MySQLHelper) PingSuccess ¶
func (h *MySQLHelper) PingSuccess() bool
PingSuccess function is used check connection to a database
func (*MySQLHelper) SelectRandomData ¶ added in v0.6.0
func (h *MySQLHelper) SelectRandomData(limit int) *sql.Rows
TableRowCount gets row count of table
func (*MySQLHelper) TableExists ¶
func (h *MySQLHelper) TableExists() bool
TableExists checks if a table exists
func (*MySQLHelper) TableRowCount ¶
func (h *MySQLHelper) TableRowCount() (count int)
TableRowCount gets row count of table
type S3Helper ¶
type S3Helper struct {
// contains filtered or unexported fields
}
S3Helper contains pointer to s3 client and wrappers for basic object store operations
func CreateNewS3Helper ¶
CreateNewS3Helper creates a s3 client for specfied endpoint and creds
func (*S3Helper) CreateBucket ¶
CreateBucket function creates bucket using s3 client
func (*S3Helper) DeleteBucket ¶
DeleteBucket function deletes given bucket using s3 client
func (*S3Helper) DeleteObjectInBucket ¶
DeleteObjectInBucket function deletes given bucket using s3 client
func (*S3Helper) GetObjectInBucket ¶
GetObjectInBucket function retrieves an object from a bucket using s3 client