@@ -69,13 +69,40 @@ public async Task BackupRestoreZipTest()
69
69
var backupName = $ "{ Guid . NewGuid ( ) } .bak";
70
70
var csb = BuildServicesConnectionStringBuilder ( ServerType , Compression , WireCrypt , true ) ;
71
71
var connectionString = csb . ToString ( ) ;
72
- await BackupPartHelper ( backupName , connectionString , FbBackupFlags . Zip ) ;
72
+ await BackupPartHelper ( backupName , connectionString , x =>
73
+ {
74
+ x . Options |= FbBackupFlags . Zip ;
75
+ } ) ;
73
76
await RestorePartHelper ( backupName , connectionString ) ;
74
77
// test the database was actually restored fine
75
78
await Connection . OpenAsync ( ) ;
76
79
await Connection . CloseAsync ( ) ;
77
80
}
78
81
82
+ [ Test ]
83
+ public async Task BackupRestoreVerbIntTest ( )
84
+ {
85
+ if ( ! EnsureServerVersionAtLeast ( new Version ( 3 , 0 , 0 , 0 ) ) )
86
+ return ;
87
+
88
+ var backupName = $ "{ Guid . NewGuid ( ) } .bak";
89
+ var csb = BuildServicesConnectionStringBuilder ( ServerType , Compression , WireCrypt , true ) ;
90
+ var connectionString = csb . ToString ( ) ;
91
+ await BackupPartHelper ( backupName , connectionString , x =>
92
+ {
93
+ x . Verbose = true ;
94
+ x . VerboseInterval = 1_000_000 ;
95
+ } ) ;
96
+ await RestorePartHelper ( backupName , connectionString , x =>
97
+ {
98
+ x . Verbose = true ;
99
+ x . VerboseInterval = 1_000_000 ;
100
+ } ) ;
101
+ // test the database was actually restored fine
102
+ await Connection . OpenAsync ( ) ;
103
+ await Connection . CloseAsync ( ) ;
104
+ }
105
+
79
106
[ Test ]
80
107
public async Task BackupRestoreParallelTest ( )
81
108
{
@@ -469,18 +496,19 @@ public async Task NFixupTest()
469
496
Assert . DoesNotThrowAsync ( ( ) => Connection . OpenAsync ( ) ) ;
470
497
}
471
498
472
- static Task BackupPartHelper ( string backupName , string connectionString , FbBackupFlags backupFlags = FbBackupFlags . IgnoreLimbo )
499
+ static Task BackupPartHelper ( string backupName , string connectionString , Action < FbBackup > configure = null )
473
500
{
474
501
var backupSvc = new FbBackup ( ) ;
475
502
backupSvc . ConnectionString = connectionString ;
476
- backupSvc . Options = backupFlags ;
503
+ backupSvc . Options = FbBackupFlags . IgnoreLimbo ;
477
504
backupSvc . BackupFiles . Add ( new FbBackupFile ( backupName , 2048 ) ) ;
478
505
backupSvc . Verbose = true ;
479
506
backupSvc . Statistics = FbBackupRestoreStatistics . TotalTime | FbBackupRestoreStatistics . TimeDelta ;
480
507
backupSvc . ServiceOutput += ServiceOutput ;
508
+ configure ? . Invoke ( backupSvc ) ;
481
509
return backupSvc . ExecuteAsync ( ) ;
482
510
}
483
- static Task RestorePartHelper ( string backupName , string connectionString )
511
+ static Task RestorePartHelper ( string backupName , string connectionString , Action < FbRestore > configure = null )
484
512
{
485
513
var restoreSvc = new FbRestore ( ) ;
486
514
restoreSvc . ConnectionString = connectionString ;
@@ -490,6 +518,7 @@ static Task RestorePartHelper(string backupName, string connectionString)
490
518
restoreSvc . Statistics = FbBackupRestoreStatistics . TotalTime | FbBackupRestoreStatistics . TimeDelta ;
491
519
restoreSvc . BackupFiles . Add ( new FbBackupFile ( backupName , 2048 ) ) ;
492
520
restoreSvc . ServiceOutput += ServiceOutput ;
521
+ configure ? . Invoke ( restoreSvc ) ;
493
522
return restoreSvc . ExecuteAsync ( ) ;
494
523
}
495
524
0 commit comments