From ee1ebfd89338179acdd4491f4f9a03072b855118 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Wed, 12 Apr 2017 17:58:52 +0200 Subject: [PATCH] Remote Test debugging yey! --- .../DiskTests/FreeSpaceFixtureBase.cs | 2 +- src/NzbDrone.Mono/Disk/DiskProvider.cs | 10 +++++++--- src/NzbDrone.Mono/Disk/SymbolicLinkResolver.cs | 10 +++++----- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/NzbDrone.Common.Test/DiskTests/FreeSpaceFixtureBase.cs b/src/NzbDrone.Common.Test/DiskTests/FreeSpaceFixtureBase.cs index a4dbe737b..1ea42a852 100644 --- a/src/NzbDrone.Common.Test/DiskTests/FreeSpaceFixtureBase.cs +++ b/src/NzbDrone.Common.Test/DiskTests/FreeSpaceFixtureBase.cs @@ -29,7 +29,7 @@ namespace NzbDrone.Common.Test.DiskTests public void should_be_able_to_check_space_on_ramdrive() { MonoOnly(); - Subject.GetAvailableSpace("/run/").Should().NotBe(0); + Subject.GetAvailableSpace("/").Should().NotBe(0); } [Test] diff --git a/src/NzbDrone.Mono/Disk/DiskProvider.cs b/src/NzbDrone.Mono/Disk/DiskProvider.cs index a9a294915..5112d351b 100644 --- a/src/NzbDrone.Mono/Disk/DiskProvider.cs +++ b/src/NzbDrone.Mono/Disk/DiskProvider.cs @@ -17,22 +17,26 @@ namespace NzbDrone.Mono.Disk private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(DiskProvider)); 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 // `unchecked((uint)-1)` and `uint.MaxValue` are the same thing. 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; _symLinkResolver = symLinkResolver; + _logger = logger; } 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); } diff --git a/src/NzbDrone.Mono/Disk/SymbolicLinkResolver.cs b/src/NzbDrone.Mono/Disk/SymbolicLinkResolver.cs index 28edae7ca..cc6c0d01b 100644 --- a/src/NzbDrone.Mono/Disk/SymbolicLinkResolver.cs +++ b/src/NzbDrone.Mono/Disk/SymbolicLinkResolver.cs @@ -6,23 +6,23 @@ using NLog; 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. // All of this code was copied from mono with minor changes. - public class SymbolicLinkResolver : ISymbolicLinkResolver + public class SymbLinkResolver : ISymbLinkResolver { private readonly Logger _logger; - public SymbolicLinkResolver(Logger logger) + public SymbLinkResolver(Logger logger) { _logger = logger; } - public string GetCompleteRealPath(string path) + public string GetCompletePath(string path) { if (path == null) return null;