1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-17 15:02:34 +02:00

Remote Test debugging yey!

This commit is contained in:
Leonardo Galli 2017-04-12 17:58:52 +02:00
parent 403fd0f0c0
commit ee1ebfd893
3 changed files with 13 additions and 9 deletions

View File

@ -29,7 +29,7 @@ public void should_get_free_space_for_folder_that_doesnt_exist()
public void should_be_able_to_check_space_on_ramdrive() public void should_be_able_to_check_space_on_ramdrive()
{ {
MonoOnly(); MonoOnly();
Subject.GetAvailableSpace("/run/").Should().NotBe(0); Subject.GetAvailableSpace("/").Should().NotBe(0);
} }
[Test] [Test]

View File

@ -17,22 +17,26 @@ public class DiskProvider : DiskProviderBase
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(DiskProvider)); private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(DiskProvider));
private readonly IProcMountProvider _procMountProvider; private readonly IProcMountProvider _procMountProvider;
private readonly NzbDrone.Mono.Disk.ISymbolicLinkResolver _symLinkResolver; private readonly ISymbLinkResolver _symLinkResolver;
private readonly Logger _logger;
// Mono supports sending -1 for a uint to indicate that the owner or group should not be set // Mono supports sending -1 for a uint to indicate that the owner or group should not be set
// `unchecked((uint)-1)` and `uint.MaxValue` are the same thing. // `unchecked((uint)-1)` and `uint.MaxValue` are the same thing.
private const uint UNCHANGED_ID = uint.MaxValue; private const uint UNCHANGED_ID = uint.MaxValue;
public DiskProvider(IProcMountProvider procMountProvider, NzbDrone.Mono.Disk.ISymbolicLinkResolver symLinkResolver) public DiskProvider(IProcMountProvider procMountProvider, ISymbLinkResolver symLinkResolver, Logger logger)
{ {
_procMountProvider = procMountProvider; _procMountProvider = procMountProvider;
_symLinkResolver = symLinkResolver; _symLinkResolver = symLinkResolver;
_logger = logger;
} }
public override IMount GetMount(string path) public override IMount GetMount(string path)
{ {
path = _symLinkResolver.GetCompleteRealPath(path); path = _symLinkResolver.GetCompletePath(path);
_logger.Warn("Testing 123: {0}, {1}", _symLinkResolver, _symLinkResolver.GetType());
_logger.Debug("Testing");
return base.GetMount(path); return base.GetMount(path);
} }

View File

@ -6,23 +6,23 @@
namespace NzbDrone.Mono.Disk namespace NzbDrone.Mono.Disk
{ {
public interface ISymbolicLinkResolver public interface ISymbLinkResolver
{ {
string GetCompleteRealPath(string path); string GetCompletePath(string path);
} }
// Mono's own implementation doesn't handle exceptions very well. // Mono's own implementation doesn't handle exceptions very well.
// All of this code was copied from mono with minor changes. // All of this code was copied from mono with minor changes.
public class SymbolicLinkResolver : ISymbolicLinkResolver public class SymbLinkResolver : ISymbLinkResolver
{ {
private readonly Logger _logger; private readonly Logger _logger;
public SymbolicLinkResolver(Logger logger) public SymbLinkResolver(Logger logger)
{ {
_logger = logger; _logger = logger;
} }
public string GetCompleteRealPath(string path) public string GetCompletePath(string path)
{ {
if (path == null) return null; if (path == null) return null;