(cherry picked from commit 760de88e7c1835affe184fed16bc3895ceca9358) (cherry picked from commit add271967f64b426fd0687c2c3209280e4a65754)pull/60/head
parent
42403ac1c3
commit
f27e9f73a9
@ -1,8 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
|
<clear />
|
||||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||||
<add key="MyFeed" value="https://pkgs.dev.azure.com/Servarr/Servarr/_packaging/SQLite/nuget/v3/index.json" />
|
|
||||||
<add key="FluentMigrator" value="https://pkgs.dev.azure.com/fluentmigrator/fluentmigrator/_packaging/fluentmigrator/nuget/v3/index.json" />
|
<add key="FluentMigrator" value="https://pkgs.dev.azure.com/fluentmigrator/fluentmigrator/_packaging/fluentmigrator/nuget/v3/index.json" />
|
||||||
|
<add key="dotnet-bsd-crossbuild" value="https://pkgs.dev.azure.com/Servarr/Servarr/_packaging/dotnet-bsd-crossbuild/nuget/v3/index.json" />
|
||||||
|
<add key="Mono.Posix.NETStandard" value="https://pkgs.dev.azure.com/Servarr/Servarr/_packaging/Mono.Posix.NETStandard/nuget/v3/index.json" />
|
||||||
|
<add key="SQLite" value="https://pkgs.dev.azure.com/Servarr/Servarr/_packaging/SQLite/nuget/v3/index.json" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
using FluentAssertions;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
|
using NzbDrone.Common.Processes;
|
||||||
|
using NzbDrone.Mono.EnvironmentInfo.VersionAdapters;
|
||||||
|
using NzbDrone.Test.Common;
|
||||||
|
|
||||||
|
namespace NzbDrone.Mono.Test.EnvironmentInfo
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
[Platform("Linux")]
|
||||||
|
public class FreebsdVersionAdapterFixture : TestBase<FreebsdVersionAdapter>
|
||||||
|
{
|
||||||
|
[SetUp]
|
||||||
|
public void Setup()
|
||||||
|
{
|
||||||
|
if (OsInfo.Os != Os.Bsd)
|
||||||
|
{
|
||||||
|
throw new IgnoreException("BSD Only");
|
||||||
|
}
|
||||||
|
|
||||||
|
Mocker.SetConstant<IProcessProvider>(Mocker.Resolve<ProcessProvider>());
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void should_get_version_info()
|
||||||
|
{
|
||||||
|
var info = Subject.Read();
|
||||||
|
info.FullName.Should().NotBeNullOrWhiteSpace();
|
||||||
|
info.Name.Should().NotBeNullOrWhiteSpace();
|
||||||
|
info.Version.Should().NotBeNullOrWhiteSpace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
|
using NzbDrone.Common.Processes;
|
||||||
|
|
||||||
|
namespace NzbDrone.Mono.EnvironmentInfo.VersionAdapters
|
||||||
|
{
|
||||||
|
public class FreebsdVersionAdapter : IOsVersionAdapter
|
||||||
|
{
|
||||||
|
private readonly IProcessProvider _processProvider;
|
||||||
|
|
||||||
|
public FreebsdVersionAdapter(IProcessProvider processProvider)
|
||||||
|
{
|
||||||
|
_processProvider = processProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OsVersionModel Read()
|
||||||
|
{
|
||||||
|
var output = _processProvider.StartAndCapture("freebsd-version");
|
||||||
|
|
||||||
|
var version = output.Standard.First().Content;
|
||||||
|
|
||||||
|
return new OsVersionModel("FreeBSD", version, $"FreeBSD {version}");
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Enabled => OsInfo.Os == Os.Bsd;
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue