Skip to content

Commit

Permalink
fix(unit): modify unit tests for backup targets
Browse files Browse the repository at this point in the history
Add more parameters in creating BackupVolume for testing
volume_controller.go

Ref: 5411

Signed-off-by: James Lu <james.lu@suse.com>
  • Loading branch information
mantissahz committed Nov 23, 2023
1 parent 22cef5a commit ba8df4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const (
TestDeploymentName = "test-deployment"

TestBackupTarget = "s3://backupbucket@us-east-1/backupstore"
TestBackupTargetName = "default"
TestBackupVolumeName = "test-backup-volume-for-restoration"
TestBackupName = "test-backup-for-restoration"

Expand Down
11 changes: 10 additions & 1 deletion controller/volume_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1318,10 +1318,19 @@ func (s *TestSuite) runTestCases(c *C, testCases map[string]*VolumeTestCase) {

backupVolume := &longhorn.BackupVolume{
ObjectMeta: metav1.ObjectMeta{
Name: bvName,
Name: bvName + "-" + TestBackupTargetName,
Finalizers: []string{
longhorn.SchemeGroupVersion.Group,
},
Labels: map[string]string{
types.LonghornLabelBackupTarget: TestBackupTargetName,
types.LonghornLabelBackupVolume: bvName,
},
},
Spec: longhorn.BackupVolumeSpec{
BackupTargetName: TestBackupTargetName,
BackupTargetURL: TestBackupTarget,
VolumeName: bvName,
},
Status: longhorn.BackupVolumeStatus{
LastBackupName: bName,
Expand Down

0 comments on commit ba8df4a

Please sign in to comment.