mirror of
https://github.com/Radarr/Radarr
synced 2024-12-29 03:15:19 +00:00
Fixed: Health Check produced warning if Sonarr binaries folder was not writable even when the external script update mechanism was selected.
fixes #964
This commit is contained in:
parent
eaf3228bb7
commit
37c621dcdb
2 changed files with 26 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
|||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Update;
|
||||
|
||||
namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
{
|
||||
|
@ -47,5 +48,28 @@ public void should_return_error_when_app_folder_is_write_protected_and_update_au
|
|||
|
||||
Subject.Check().ShouldBeError();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_return_error_when_app_folder_is_write_protected_and_external_script_enabled()
|
||||
{
|
||||
MonoOnly();
|
||||
|
||||
Mocker.GetMock<IConfigFileProvider>()
|
||||
.Setup(s => s.UpdateAutomatically)
|
||||
.Returns(true);
|
||||
|
||||
Mocker.GetMock<IConfigFileProvider>()
|
||||
.Setup(s => s.UpdateMechanism)
|
||||
.Returns(UpdateMechanism.Script);
|
||||
|
||||
Mocker.GetMock<IAppFolderInfo>()
|
||||
.Setup(s => s.StartUpFolder)
|
||||
.Returns(@"/opt/nzbdrone");
|
||||
|
||||
Mocker.GetMock<NzbDrone.Common.Disk.IDiskProvider>()
|
||||
.Verify(c => c.FolderWritable(Moq.It.IsAny<string>()), Times.Never());
|
||||
|
||||
Subject.Check().ShouldBeOk();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,8 @@ public UpdateCheck(IDiskProvider diskProvider,
|
|||
|
||||
public override HealthCheck Check()
|
||||
{
|
||||
if (OsInfo.IsWindows || _configFileProvider.UpdateAutomatically)
|
||||
if ((OsInfo.IsWindows || _configFileProvider.UpdateAutomatically) &&
|
||||
_configFileProvider.UpdateMechanism == UpdateMechanism.BuiltIn)
|
||||
{
|
||||
if (!_diskProvider.FolderWritable(_appFolderInfo.StartUpFolder))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue