New: Errors for Mono Health checks on X86 and BSD (except FreeBSD) based Operating Systems

This commit is contained in:
Robin Dadswell 2021-05-07 00:24:57 +01:00
parent 5696fa2efe
commit 9f6c48191b
3 changed files with 7 additions and 5 deletions

View File

@ -35,7 +35,7 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
[Test] [Test]
[Platform("Mono")] [Platform("Mono")]
public void should_return_ok_if_otherbsd() public void should_return_error_if_otherbsd()
{ {
Mocker.GetMock<IProcessProvider>() Mocker.GetMock<IProcessProvider>()
.Setup(x => x.StartAndCapture("uname", null, null)) .Setup(x => x.StartAndCapture("uname", null, null))
@ -46,7 +46,7 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
new ProcessOutputLine(ProcessOutputLevel.Standard, "OpenBSD") new ProcessOutputLine(ProcessOutputLevel.Standard, "OpenBSD")
} }
}); });
Subject.Check().ShouldBeOk(); Subject.Check().ShouldBeError();
} }
[Test] [Test]

View File

@ -28,14 +28,14 @@ namespace NzbDrone.Core.HealthCheck.Checks
// Don't warn on linux x86 - we don't build x86 net core // Don't warn on linux x86 - we don't build x86 net core
if (OsInfo.IsLinux && RuntimeInformation.ProcessArchitecture == Architecture.X86) if (OsInfo.IsLinux && RuntimeInformation.ProcessArchitecture == Architecture.X86)
{ {
return new HealthCheck(GetType()); return new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("Monox86SupportCheckMessage"), "mono_support_end_of_life");
} }
// Check for BSD // Check for BSD
var output = _processProvider.StartAndCapture("uname"); var output = _processProvider.StartAndCapture("uname");
if (output?.ExitCode == 0 && MonoUnames.Contains(output?.Lines.First().Content)) if (output?.ExitCode == 0 && MonoUnames.Contains(output?.Lines.First().Content))
{ {
return new HealthCheck(GetType()); return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("MonoBSDSupportCheckMessage"), OsInfo.Os), "mono_support_end_of_life");
} }
return new HealthCheck(GetType(), return new HealthCheck(GetType(),

View File

@ -529,7 +529,9 @@
"MonitoredOnly": "Monitored Only", "MonitoredOnly": "Monitored Only",
"MonitoredStatus": "Monitored/Status", "MonitoredStatus": "Monitored/Status",
"MonitorMovie": "Monitor Movie", "MonitorMovie": "Monitor Movie",
"MonoNotNetCoreCheckMessage": "Please upgrade to the .NET Core version of Radarr, Mono versions will not be supported in the next release. ", "Monox86SupportCheckMessage": "The current operating system is 32 bit, this will not be supported in the next release of Radarr.",
"MonoBSDSupportCheckMessage": "The operating system {0} will not be supported in the next release of Radarr.",
"MonoNotNetCoreCheckMessage": "Please upgrade to the .NET Core version of Radarr, Mono versions will not be supported in the next release.",
"MonoTlsCheckMessage": "Radarr Mono 4.x tls workaround still enabled, consider removing MONO_TLS_PROVIDER=legacy environment option", "MonoTlsCheckMessage": "Radarr Mono 4.x tls workaround still enabled, consider removing MONO_TLS_PROVIDER=legacy environment option",
"MonoVersion": "Mono Version", "MonoVersion": "Mono Version",
"MonoVersionCheckNotSupportedMessage": "Currently installed Mono version {0} is no longer supported. Please upgrade Mono to version {1}.", "MonoVersionCheckNotSupportedMessage": "Currently installed Mono version {0} is no longer supported. Please upgrade Mono to version {1}.",