Commit Graph
293 Commits
Author SHA1 Message Date
Kenneth SkovhedeandGitHub ec1975b5a7 Merge pull request #4269 from warwickmm/target_net_471
Target .NET Framework 4.7.1
2020-08-07 10:50:35 +02:00
Kenneth SkovhedeandGitHub 04dd510be0 Merge pull request #4261 from warwickmm/avoid_deleting_unrelated_files
Avoid deleting unrelated files when removing backup configuration
2020-08-07 10:33:31 +02:00
Kenneth SkovhedeandGitHub e5b0ac2749 Merge pull request #4260 from warwickmm/remove_unnecessary_path_combine
Remove unnecessary call to Path.Combine
2020-08-07 10:31:47 +02:00
Kenneth SkovhedeandGitHub 2d628053fa Merge pull request #4259 from warwickmm/test_check_warnings_and_errors
Check for errors and warnings in unit tests
2020-08-07 10:30:21 +02:00
Kenneth SkovhedeandGitHub ac5dda8be7 Merge pull request #4257 from warwickmm/test_invalid_windows_paths
Add tests for invalid Windows paths
2020-08-07 10:29:54 +02:00
warwickmmandGitHub 8f631a99f0 Merge pull request #4274 from dferreyra/CommandLineOperationsTests_setup
Fix setup/teardown for CommandLineOperationsTests
2020-07-31 16:55:26 -07:00
Kenneth Hsu d99d40717d Merge remote-tracking branch 'upstream/master' into test_invalid_windows_paths
This allows us to simplify the ProblematicPathTests because the test
teardown methods can now handle deleting directories containing
problematic paths.
2020-07-31 16:29:28 -07:00
Dean Ferreyra c70508b96e Fix setup/teardown for CommandLineOperationsTests
Change Duplicati.UnitTest.CommandLineOperationsTests to use `Setup()`
instead of `OneTimeSetUp()` to make sure the test files are in place
for each test.

This fixes #4273.
2020-07-31 07:47:09 -07:00
Dean Ferreyra 2e777b2711 Change tests to work with long paths in Windows
Change SystemIOWindows.PathGetFullPath() to convert forward
slashes to backslashes.

Change Duplicati.UnitTest.BasicSetupHelper.ZipFileExtractToDirectory()
to rely on slash fix-ups.
2020-07-30 05:08:18 -07:00
Dean Ferreyra 73e31a79a1 Change tests to work with long paths in Windows
Even in .NET 4.6.2
`System.IO.Compression.ZipFile.ExtractToDirectory()` cannot handle
long paths.  Replace call to
`System.IO.Compression.ZipFile.ExtractToDirectory()` with an
equivalent that extracts files to a temporary location and uses I/O
functions that support long paths to move them to their final
location.

In CommandLineOperationsTests.cs, use ISystemIO functions to handle
potentially long paths.

Add a fix to RecoveryTool for long paths that was missed by #4258.

This fixes #3863.
2020-07-28 05:51:53 -07:00
Kenneth Hsu e964072690 Target .NET Framework 4.7.1.
This updates all projects to target .NET Framework 4.7.1.  The
TencentCOS and Tardigrade backends depend on .NET Standard 2.0.  When a
.NET Framework prior to 4.7.1 is targeted, the system cannot be sure
that all the dependencies exist, so it copies all dependent assemblies
to the output directory.  This causes many assemblies from the System
namespace to become bundled in the release.

https://stackoverflow.com/a/48875007

We had previously attempted to make individual projects target 4.7.1
(see pull request #4242), but this can cause compatibility issues when
4.6.2 projects depend on 4.7.1. projects.

This will require Mono 5.10.0 or greater (previously, we required 5.0.0
or greater).

https://www.mono-project.com/docs/about-mono/releases/5.10.0/#class-libraries

This fixes issue #4234.
2020-07-26 19:46:01 -07:00
Kenneth Hsu ef8209bc21 Add test to verify number of included paths. 2020-07-23 19:46:23 -07:00
Kenneth Hsu 443514dabd Rename test method. 2020-07-23 19:44:10 -07:00
Kenneth Hsu 466bc3786b Extract creation of problematic file to method. 2020-07-23 19:43:24 -07:00
Kenneth Hsu 1b7d1533ee Add test for excluding problematic paths. 2020-07-23 19:40:00 -07:00
Kenneth Hsu 0314c388ef Rename test method. 2020-07-21 13:49:41 -07:00
Kenneth Hsu 00cd10062b Add test to check that only backend files with correct prefix are deleted.
This concerns issue #2678.
2020-07-21 13:20:42 -07:00
Kenneth Hsu 77a4918f36 Add test to check that only relevant backend files are deleted.
This concerns issues #3845, and #4244.
2020-07-21 13:20:42 -07:00
Kenneth Hsu f47299d7a1 Remove unnecessary call to Path.Combine. 2020-07-20 20:08:14 -07:00
Kenneth Hsu 27c5b9ef5a Check for errors and warnings in unit tests. 2020-07-19 19:51:05 -07:00
Kenneth Hsu 654ca45892 Verify contents of restored problematic paths.
This is somewhat redundant since the RestoreHandler verifies the hash of
the restored file, but it doesn't hurt to check again.
2020-07-19 14:07:26 -07:00
Kenneth Hsu 941c8892b0 Rename test methods. 2020-07-18 18:54:10 -07:00
Kenneth Hsu c8b1e093fb Add test to backup and restore paths with problematic suffixes.
Paths that end with a dot or space are problematic on Windows.

This concerns issue #3839.
This concerns pull request #4256.
2020-07-18 18:20:27 -07:00
Kenneth Hsu 7f6411eca9 Add test to backup and restore problematic long path.
This tests a path that exceeds typical limits on Windows.

This concerns issue #3839.
This concerns pull request #4256.
2020-07-18 18:15:34 -07:00
Kenneth Hsu a837144b42 Add class to help remove problematic paths from tests.
This will make it easier to create and clean up tests that involve
problematic paths (e.g., paths that end with a dot or space on Windows).
2020-07-18 18:10:02 -07:00
Dean Ferreyra 6acbbf2136 Support problematic Windows paths
Allow historically problematic Windows paths (i.e., files or
directories that end in a dot or a space) to be backed up with
Duplicati in Windows.

This fixes #3839.
2020-07-17 21:50:29 -07:00
Kenneth SkovhedeandGitHub 3a8214a0dd Merge branch 'master' into check_errors_and_warnings_in_tests 2020-07-09 13:18:28 +02:00
Kenneth Hsu 4a1697bb27 Remove commented-out code. 2020-07-08 17:37:08 -07:00
Kenneth Hsu c992e9f76e Remove source before testing resoration of inheritance breaks.
This will be a better check for the restoration of inheritance breaks,
and also allow us to expect zero warnings as a result.
2020-07-07 19:21:35 -07:00
Kenneth Hsu 0e994ea4f1 Avoid checking for warnings in some BorderTests.
The current test data sometimes yields a "No block hash found for file"
warning.
2020-07-07 19:21:35 -07:00
Kenneth Hsu e1a6ae4483 Check operation results for errors and warnings in tests. 2020-07-05 18:50:10 -07:00
Kenneth Hsu fac39c03a2 Fix typo in comment. 2020-07-02 15:40:06 -07:00
Kenneth Hsu 7bbe511f31 Reduce scope of Controller instance. 2020-07-02 15:39:56 -07:00
Kenneth Hsu 5e50435c7d Include drive letter as part of path when restoring on Windows.
When the dont-compress-restore-paths option is used, the drive letter is
included as part of the path when restoring on Windows.
2020-07-01 20:20:36 -07:00
Kenneth Hsu a3e192a8a6 Add test for restoring empty file to non-existant folder.
This concerns issue #4148.
2020-07-01 16:45:11 -07:00
Sean Templeton d5e064ae45 Fix a few more issues with stop now
When a backup is interrupted it will now show as a partial backup in the list of backups on the restore files page.

Temporary filelist volumes are protected from deletion in several places. All but the RestoreHandler
only protect the most recent filelist. The RestoreHandler protects all temporary filelist volumes as the user
might be restoring from one that would be deleted.

Prevent the CoCoL BackendRequests channel is retired exception from appearing when the backup is stopped by checking
if the channel is retired before trying to add the FlushRequest to the channel. Any exceptions from the BackendUploader
task will still be thrown.
2020-03-01 21:19:07 -06:00
Sean Templeton 446120ae3e A synthetic filelist could not be uploaded due to the logic in UploadSyntheticFilelist. The code passing in the fileset id to the class would get the id based on if the volume was in the Temporary or Uploading states. If the volume was in the Uploading state, present on the remote backend, and of the right size it would get changed to Uploaded.
One of the first things UploadSyntheticFilelist does is throw an exception if the volume is not in the Uploaded state. Or if it is in the Uploaded state, the next check would prevent a synthetic filelist from being created if the volume was not in the Uploading or Temporary states.

Removed the check for the volume not being in the Uploaded state as the warning in the second check handles that case.

Removed the using statement as it would dispose of the FilesetVolumeWriter after passing it to the UploadChannel. The UploadChannel could not use it since it had been disposed.

Fixed the GetRemoteVolumeFromIDAsync taking a fileset id and matching it up against a volume id. Now it will use fileset id to get the volume that matches the fileset.

Change the StopNow disruption test to not use a synthetic file list. The test was written with it not working and therefore fails a check on the number of filesets after stopping a backup.

Bonus fix for a possible null exception in Dispose for VolumeWriterBase.
2020-02-23 16:50:36 -06:00
Kenneth Hsu f0068456fd Disable warning about unused constructor.
This is used in the SVNCheckoutTests class.
2020-02-17 12:38:58 -08:00
Kenneth Hsu 89db40c211 Disable warning about unused constructor.
This is used in the SVNCheckoutTests class.
2020-02-17 12:38:38 -08:00
Kenneth Hsu 7cfed6a62b Remove unused LogHelper.Backupset property.
This property (and its backing field m_backupset) is only set and never
referenced.
2020-02-17 09:52:12 -08:00
Kenneth Hsu 917f749b0a Add RepairHandlerTests to solution.
This was accidentally removed via a bad merge in revision
a64671a0c6.
2020-01-25 18:59:44 -08:00
Kenneth Hsu 5ff5961019 Test RecoveryTool using file-based and in-memory index. 2020-01-23 20:45:49 -08:00
Kenneth SkovhedeandGitHub a64671a0c6 Merge pull request #4018 from warwickmm/refactor/fileset_removal
Refactor fileset deletion code and add tests
2020-01-23 13:52:43 +01:00
Kenneth Hsu 30ea3c05da Fix typo in comment. 2020-01-22 17:44:12 -08:00
Kenneth Hsu ec7d6dcc9f Merge remote-tracking branch 'upstream/master' into test/recovery_tool 2020-01-21 20:30:02 -08:00
Kenneth Hsu 35ea890f96 Merge remote-tracking branch 'upstream/master' into refactor/fileset_removal 2020-01-21 20:23:49 -08:00
warwickmmandGitHub 837a787cbf Merge pull request #4047 from warwickmm/bugfix/repair_missing_dindex
Fix bug when performing repair with missing dindex files
2020-01-21 19:46:36 -08:00
Kenneth Hsu 6a6224a10a Reset current directory before removing test files.
The RecoveryTool sets the currenty directory during its operation.  We
must reset the current directory so that the test teardown methods do
not complain that paths are being used by other processes.
2020-01-18 14:44:05 -08:00
Kenneth Hsu bfbae6fcaf Add test for restoring files using RecoveryTool. 2020-01-18 09:36:03 -08:00
Kenneth Hsu 1892ba8d0a Fix poorly named test file. 2020-01-10 20:12:01 -08:00