var BookPath = "./resources/books/"
var BookTitles = []string{"beowulf.txt", "sherlock_holmes.txt", "tale_of_two_cities.txt", "ulysses.txt"}
func CancelAllJobsForBucket(client *ds3.Client, bucketName string)
func ConvertBooksToDs3Objects(books map[string]models.ReaderWithSizeDecorator) ([]models.Ds3PutObject, error)
func ConvertObjectsIntoObjectNameList(objects []models.Contents) []string
func DeleteBucket(client *ds3.Client, bucketName string) error
Deletes the specified bucket and returns an error if one occurs
func DeleteBucketContents(client *ds3.Client, bucketName string)
func DeleteBucketLogError(t *testing.T, client *ds3.Client, bucketName string) error
Deletes the specified bucket. If an error occurs, it is logged, and the calling test is marked as failed.
func DeleteDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyId string) error
Deletes the specified data policy. If an error occurs, it is logged, and the calling test is marked as failed, but continues running.
func DeleteObject(client *ds3.Client, bucketName string, objectName string) error
Deletes the specified object. Returns an error if not successful.
func DeleteObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string) error
Deletes the specified object. If an error occurs, it is logged, and the calling test is marked as failed.
func GetBucket(client *ds3.Client, bucketName string) (*models.GetBucketResponse, error)
Retrieves the specified bucket. Returns an error if unsuccessful.
func GetBucketLogError(t *testing.T, client *ds3.Client, bucketName string) (*models.GetBucketResponse, error)
Retrieves the specified bucket. If an error occurs, it is logged, and the calling test is marked as failed.
func GetDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyId string) (*models.GetDataPolicySpectraS3Response, error)
Retrieves the specified data policy. If an error occurs, it is logged, and the calling test is marked as failed, but continues running
func GetObject(client *ds3.Client, bucketName string, objectName string) (*models.GetObjectResponse, error)
Retrieves the specified object. Returns an error if not successful.
func GetObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string) (*models.GetObjectResponse, error)
Retrieves the specified object. If an error occurs, it is logged, and the calling test is marked as failed.
func GetResourceBookAsStream(book string) (*models.ReadCloserWithSizeDecorator, error)
func GetResourceBooks() (map[string]models.ReaderWithSizeDecorator, error)
func GetUserByNameLogError(t *testing.T, client *ds3.Client, userName string) (*models.SpectraUser, error)
Retrieves the specified user by name. Expects there to be one user with the specified name. If there is not exactly 1 user with the specified name, it is treated as an error. If an error occurs, it is logged, and the calling test is marked as failed, but continues running.
func LoadBook(book string) ([]byte, error)
Loads the specified book. Assumes that the book is located in the /resources/books/ folder.
func LoadBookLogError(t *testing.T, book string) ([]byte, error)
Loads the specified book. If an error occurs, it is logged, and the calling test is marked as failed.
func PutBucket(client *ds3.Client, bucketName string) error
Puts the specified bucket. Returns an error if not successful.
func PutBucketLogError(t *testing.T, client *ds3.Client, bucketName string) error
Puts the specified bucket. If an error occurs, it is logged, and the calling test is marked as failed.
func PutDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyName string) (*models.PutDataPolicySpectraS3Response, error)
Creates the specified data policy. If an error occurs, it is logged, and the calling test is marked as failed, but continues running.
func PutEmptyObjects(client *ds3.Client, bucketName string, objects []models.Ds3PutObject) error
func PutObject(client *ds3.Client, bucketName string, objectName string, data []byte) error
Puts the specified object. Returns an error if not successful.
func PutObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string, data []byte) error
Puts the specified object. If an error occurs, it is logged, and the calling test is marked as failed.
func PutObjectWithJobId(client *ds3.Client, bucketName string, objectName string, jobId string, data []byte) error
Puts the specified object. Returns an error if not successful.
func PutTestBooks(client *ds3.Client, bucketName string) error
Puts the test books onto the BP
func SetupTestEnv(testBucket string, userName string, envTestNameSpace string) (*ds3.Client, *TestIds, error)
Sets up the test environment by 1) creating a client from environment variables and 2) creating a test bucket 3) creating new data policy 4) setting default user to use new data policy 5) crating a pool partition 6) creating a storage domain 7) creating a storage domain member 8) creating a data persistence rule
func TeardownTestEnv(client *ds3.Client, ids *TestIds, testBucket string)
Tears down the test environment by deleting all contents in the test bucket and deleting all items created in SetupTestEnv
func VerifyBookContent(t *testing.T, bookName string, actual io.ReadCloser)
func VerifyFilesOnBP(t *testing.T, bucketName string, objectNames []string, filePath string, client *ds3.Client)
Retrieves the specified objects from the BP bucket and compares the content to to local files. Assumes that local file names and BP object names are the same.
func VerifyPartialFile(t *testing.T, filePath string, length int64, offset int64, actual io.ReadCloser)
Used to keep track of all IDs for items created in SetupTestEnv, and used in TeardownTestEnv. Items that have not been initialized are represented with nil, denoting no teardown is required for that element.
type TestIds struct { DataPersistenceRuleId *string DataPolicyId *string OriginalDataPolicyId *string PoolPartitionId *string StorageDomainId *string StorageDomainMemberId *string UserId *string }