mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-20 06:54:32 +00:00
data path support fallbackFull
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
@@ -89,6 +89,7 @@ func TestAsyncBackup(t *testing.T) {
|
||||
TotalBytes: 3000,
|
||||
IncrementalBytes: ptr.To(int64(200)),
|
||||
SourceSize: 2000,
|
||||
FallbackFull: true,
|
||||
},
|
||||
},
|
||||
path: "fake-path",
|
||||
@@ -112,6 +113,7 @@ func TestAsyncBackup(t *testing.T) {
|
||||
TotalBytes: 2000,
|
||||
IncrementalBytes: ptr.To(int64(200)),
|
||||
SourceSize: 2000,
|
||||
FallbackFull: false,
|
||||
},
|
||||
},
|
||||
path: "fake-path",
|
||||
@@ -126,7 +128,7 @@ func TestAsyncBackup(t *testing.T) {
|
||||
if test.result.Backup.IncrementalBytes != nil {
|
||||
incrementalBytes = *test.result.Backup.IncrementalBytes
|
||||
}
|
||||
mockProvider.On("RunBackup", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(test.result.Backup.SnapshotID, test.result.Backup.EmptySnapshot, test.result.Backup.TotalBytes, incrementalBytes, test.result.Backup.SourceSize, test.err)
|
||||
mockProvider.On("RunBackup", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(test.result.Backup.SnapshotID, test.result.Backup.EmptySnapshot, test.result.Backup.TotalBytes, incrementalBytes, test.result.Backup.SourceSize, test.result.Backup.FallbackFull, test.err)
|
||||
mockProvider.On("Close", mock.Anything).Return(nil)
|
||||
dp.uploaderProv = mockProvider
|
||||
dp.initialized = true
|
||||
@@ -201,8 +203,10 @@ func TestAsyncRestore(t *testing.T) {
|
||||
},
|
||||
result: Result{
|
||||
Restore: RestoreResult{
|
||||
Target: AccessPoint{ByPath: "fake-path"},
|
||||
TotalBytes: 1000,
|
||||
Target: AccessPoint{ByPath: "fake-path"},
|
||||
TotalBytes: 1000,
|
||||
IncrementalBytes: 500,
|
||||
FallbackFull: true,
|
||||
},
|
||||
},
|
||||
path: "fake-path",
|
||||
@@ -214,7 +218,7 @@ func TestAsyncRestore(t *testing.T) {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
dp := newGeneralDataPath("job-1", "test", nil, "velero", Callbacks{}, velerotest.NewLogger()).(*generalDataPath)
|
||||
mockProvider := providerMock.NewProvider(t)
|
||||
mockProvider.On("RunRestore", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(test.result.Restore.IncrementalBytes, test.result.Restore.TotalBytes, test.err)
|
||||
mockProvider.On("RunRestore", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(test.result.Restore.IncrementalBytes, test.result.Restore.TotalBytes, test.result.Restore.FallbackFull, test.err)
|
||||
mockProvider.On("Close", mock.Anything).Return(nil)
|
||||
dp.uploaderProv = mockProvider
|
||||
dp.initialized = true
|
||||
|
||||
Reference in New Issue
Block a user