Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PB-7821: Automate the few cluster share testcases #2734

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/backup/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ const (
ApplicationOwner PxBackupRole = "px-backup-app.admin"
ApplicationUser = "px-backup-app.user"
InfrastructureOwner = "px-backup-infra.admin"
SuperAdmin = "px-backup-super.admin"
DefaultRoles = "default-roles-master"
)

Expand Down
6 changes: 6 additions & 0 deletions drivers/backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ type Cluster interface {
// DeleteCluster deletes a cluster object
DeleteCluster(ctx context.Context, req *api.ClusterDeleteRequest) (*api.ClusterDeleteResponse, error)

// ShareCluster Share a cluster object
ShareCluster(ctx context.Context, req *api.ShareClusterRequest) (*api.ShareClusterResponse, error)

// UnShareCluster UnShare a cluster object
UnShareCluster(ctx context.Context, req *api.UnShareClusterRequest) (*api.UnShareClusterResponse, error)

// ClusterUpdateBackupShare updates ownership details for backup share at cluster
ClusterUpdateBackupShare(ctx context.Context, req *api.ClusterBackupShareUpdateRequest) (*api.ClusterBackupShareUpdateResponse, error)

Expand Down
8 changes: 8 additions & 0 deletions drivers/backup/portworx/portworx.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,14 @@ func (p *portworx) DeleteCluster(ctx context.Context, req *api.ClusterDeleteRequ
return p.clusterManager.Delete(ctx, req)
}

func (p *portworx) ShareCluster(ctx context.Context, req *api.ShareClusterRequest) (*api.ShareClusterResponse, error) {
return p.clusterManager.ShareCluster(ctx, req)
}

func (p *portworx) UnShareCluster(ctx context.Context, req *api.UnShareClusterRequest) (*api.UnShareClusterResponse, error) {
return p.clusterManager.UnShareCluster(ctx, req)
}

func (p *portworx) ClusterUpdateBackupShare(ctx context.Context, req *api.ClusterBackupShareUpdateRequest) (*api.ClusterBackupShareUpdateResponse, error) {
reqInterface, err := p.SetMissingClusterUID(ctx, req)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions tests/backup/backup_test_labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const (
PSALowerPrivilegeToHigherPrivilegeWithProjectMapping TestCaseName = "PSALowerPrivilegeToHigherPrivilegeWithProjectMapping"
AzureCloudAccountCreationWithMandatoryAndNonMandatoryFields TestCaseName = "AzureCloudAccountCreationWithMandatoryAndNonMandatoryFields"
AzureCloudAccountForLockedBucket TestCaseName = "AzureCloudAccountForLockedBucket"
ClusterShare TestCaseName = "ClusterShare"
)

// Test case labels
Expand Down Expand Up @@ -271,6 +272,7 @@ const (
PSALowerPrivilegeToHigherPrivilegeWithProjectMappingLabel TestCaseLabel = "PSALowerPrivilegeToHigherPrivilegeWithProjectMapping"
AzureCloudAccountCreationWithMandatoryAndNonMandatoryFieldsLabel TestCaseLabel = "AzureCloudAccountCreationWithMandatoryAndNonMandatoryFields"
AzureCloudAccountForLockedBucketLabel TestCaseLabel = "AzureCloudAccountForLockedBucket"
ClusterShareLabel TestCaseLabel = "ClusterShare"
)

// Common Labels
Expand Down Expand Up @@ -536,4 +538,5 @@ var TestCaseLabelsMap = map[TestCaseName][]TestCaseLabel{
PartialBackupWithLowerStorkVersion: {PartialBackupWithLowerStorkVersionLabel, PartialBackupLabel},
PartialBackupSuccessWithAzureEndpoint: {PartialBackupSuccessWithAzureEndpointLabel, PartialBackupLabel, AzureBackupLocationLabel},
PSALowerPrivilegeToHigherPrivilegeWithProjectMapping: {PSALowerPrivilegeToHigherPrivilegeWithProjectMappingLabel, rkePipelineNightly},
ClusterShare: {ClusterShareLabel},
}
Loading