Documentation ¶
Index ¶
- Variables
- 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
- func DeleteBucketContents(client *ds3.Client, bucketName string)
- func DeleteBucketLogError(t *testing.T, client *ds3.Client, bucketName string) error
- func DeleteDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyId string) error
- func DeleteObject(client *ds3.Client, bucketName string, objectName string) error
- func DeleteObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string) error
- func GetBucket(client *ds3.Client, bucketName string) (*models.GetBucketResponse, error)
- func GetBucketLogError(t *testing.T, client *ds3.Client, bucketName string) (*models.GetBucketResponse, error)
- func GetDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyId string) (*models.GetDataPolicySpectraS3Response, error)
- func GetObject(client *ds3.Client, bucketName string, objectName string) (*models.GetObjectResponse, error)
- func GetObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string) (*models.GetObjectResponse, error)
- 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)
- func LoadBook(book string) ([]byte, error)
- func LoadBookLogError(t *testing.T, book string) ([]byte, error)
- func PutBucket(client *ds3.Client, bucketName string) error
- func PutBucketLogError(t *testing.T, client *ds3.Client, bucketName string) error
- func PutDataPolicyLogError(t *testing.T, client *ds3.Client, dataPolicyName string) (*models.PutDataPolicySpectraS3Response, error)
- func PutEmptyObjects(client *ds3.Client, bucketName string, objects []models.Ds3PutObject) error
- func PutObject(client *ds3.Client, bucketName string, objectName string, data []byte) error
- func PutObjectLogError(t *testing.T, client *ds3.Client, bucketName string, objectName string, ...) error
- func PutObjectWithJobId(client *ds3.Client, bucketName string, objectName string, jobId string, ...) error
- func PutTestBooks(client *ds3.Client, bucketName string) error
- func TeardownTestEnv(client *ds3.Client, ids *TestIds, testBucket string)
- func VerifyBookContent(t *testing.T, bookName string, actual io.ReadCloser)
- func VerifyFilesOnBP(t *testing.T, bucketName string, objectNames []string, filePath string, ...)
- func VerifyPartialFile(t *testing.T, filePath string, length int64, offset int64, actual io.Reader)
- type TestIds
Constants ¶
This section is empty.
Variables ¶
var BookPath = "./resources/books/"
var BookTitles = []string{"beowulf.txt", "sherlock_holmes.txt", "tale_of_two_cities.txt", "ulysses.txt"}
Functions ¶
func CancelAllJobsForBucket ¶
func ConvertBooksToDs3Objects ¶
func ConvertBooksToDs3Objects(books map[string]models.ReaderWithSizeDecorator) ([]models.Ds3PutObject, error)
func DeleteBucket ¶
Deletes the specified bucket and returns an error if one occurs
func DeleteBucketContents ¶
func DeleteBucketLogError ¶
Deletes the specified bucket. If an error occurs, it is logged, and the calling test is marked as failed.
func DeleteDataPolicyLogError ¶
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 ¶
Deletes the specified object. Returns an error if not successful.
func DeleteObjectLogError ¶
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 GetBucketLogError ¶
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 ¶
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 ¶
func GetObject(client *ds3.Client, bucketName string, objectName string) (*models.GetObjectResponse, error)
Retrieves the specified object. Returns an error if not successful.
func GetObjectLogError ¶
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 ¶
func GetResourceBookAsStream(book string) (*models.ReadCloserWithSizeDecorator, error)
func GetResourceBooks ¶
func GetResourceBooks() (map[string]models.ReaderWithSizeDecorator, error)
func GetUserByNameLogError ¶
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 ¶
Loads the specified book. Assumes that the book is located in the /resources/books/ folder.
func LoadBookLogError ¶
Loads the specified book. If an error occurs, it is logged, and the calling test is marked as failed.
func PutBucketLogError ¶
Puts the specified bucket. If an error occurs, it is logged, and the calling test is marked as failed.
func PutDataPolicyLogError ¶
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 ¶
func PutObjectLogError ¶
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 ¶
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 ¶
Puts the test books onto the BP
func TeardownTestEnv ¶
Tears down the test environment by deleting all contents in the test bucket and deleting all items created in SetupTestEnv
func VerifyBookContent ¶
func VerifyBookContent(t *testing.T, bookName string, actual io.ReadCloser)
Types ¶
type TestIds ¶
type TestIds struct { DataPersistenceRuleId *string DataPolicyId *string OriginalDataPolicyId *string PoolPartitionId *string StorageDomainId *string StorageDomainMemberId *string UserId *string }
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.
func SetupTestEnv ¶
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