Skip to content

Commit

Permalink
pkg: add unit-test case
Browse files Browse the repository at this point in the history
Signed-off-by: BornChanger <[email protected]>
  • Loading branch information
BornChanger committed Jul 15, 2023
1 parent 62ebf06 commit fc5081e
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions pkg/backup/restore/restore_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,47 @@ func TestBRRestoreByEBS(t *testing.T) {
},
},
},
{
name: "restore-volume",
restore: &v1alpha1.Restore{
ObjectMeta: metav1.ObjectMeta{
Name: "test-5",
Namespace: "ns-5",
},
Spec: v1alpha1.RestoreSpec{
Type: v1alpha1.BackupTypeFull,
Mode: v1alpha1.RestoreModeVolumeSnapshot,
BR: &v1alpha1.BRConfig{
ClusterNamespace: "ns-5",
Cluster: "cluster-5",
},
VolumeThroughput: 8000,
VolumeType: "io2",
VolumeIOPS: 800,
VolumeAZ: "us-east-1-az1",
StorageProvider: v1alpha1.StorageProvider{
Local: &v1alpha1.LocalStorageProvider{
// Prefix: "prefix",
Volume: corev1.Volume{
Name: "nfs",
VolumeSource: corev1.VolumeSource{
NFS: &corev1.NFSVolumeSource{
Server: "fake-server",
Path: "/tmp",
ReadOnly: true,
},
},
},
VolumeMount: corev1.VolumeMount{
Name: "nfs",
MountPath: "/tmp",
},
},
},
},
Status: v1alpha1.RestoreStatus{},
},
},
}
//generate the restore meta in local nfs
err := os.WriteFile("/tmp/restoremeta", []byte(testutils.ConstructRestoreMetaStr()), 0644) //nolint:gosec
Expand Down

0 comments on commit fc5081e

Please sign in to comment.