Fixed test for BackupRead

This commit is contained in:
Kenneth Skovhede
2025-07-04 16:31:03 +02:00
parent cfb1fec331
commit 285617245b
2 changed files with 20 additions and 16 deletions
+11 -16
View File
@@ -181,26 +181,21 @@ namespace Duplicati.UnitTest
public void Run10kBackupRead()
{
if (!PermissionHelper.HasSeBackupPrivilege())
return;
try
{
Assert.Ignore("This test requires the SeBackupPrivilege to be set, which is not available in this environment.");
using var _ = Duplicati.Library.Snapshots.Windows.WindowsShimLoader.NewSeBackupPrivilegeScope();
}
else
catch (Exception ex)
{
try
{
using var _ = Duplicati.Library.Snapshots.Windows.WindowsShimLoader.NewSeBackupPrivilegeScope();
}
catch (Exception ex)
{
Assert.Inconclusive("Failed to activate WindowsShimLoader for SeBackupPrivilege: " + ex.Message);
return;
}
return;
}
RunCommands(1024 * 10, modifyOptions: opts =>
{
opts["backupread-policy"] = "required";
});
}
RunCommands(1024 * 10, modifyOptions: opts =>
{
opts["backupread-policy"] = "required";
});
}
public static Dictionary<string, int> WriteTestFilesToFolder(string targetfolder, int blocksize, int basedatasize = 0)
@@ -39,4 +39,13 @@
<ProjectReference Include="..\..\Tools\RemoteSynchronization\RemoteSynchronization.csproj" />
</ItemGroup>
<!-- Copy in WindowsModules for easier debug, or if we are targeting Windows -->
<Target Name="CopyWindowsModulesRuntime" AfterTargets="Build" Condition="'$(OS)' == 'Windows_NT'">
<ItemGroup>
<_WinMods Include="..\Library\WindowsModules\bin\$(Configuration)\net8.0-windows7.0\**\*.dll" />
</ItemGroup>
<Copy SourceFiles="@(_WinMods)" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
</Target>
</Project>