diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-04-10 19:44:09 +0100 |
|---|---|---|
| committer | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-04-10 19:44:09 +0100 |
| commit | 1fe26fe352a854523337842b16d6d0be5e68be5a (patch) | |
| tree | e8ab1488c66b840abfb6be2623473b77973d15c2 /tests/Jellyfin.Networking.Tests/NetworkParseTests.cs | |
| parent | b2fbf97abd3b603c76178455992a70383afd213b (diff) | |
Work through dns failure on test.
Diffstat (limited to 'tests/Jellyfin.Networking.Tests/NetworkParseTests.cs')
| -rw-r--r-- | tests/Jellyfin.Networking.Tests/NetworkParseTests.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs b/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs index caea0d265..b6bbfc5e1 100644 --- a/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs +++ b/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs @@ -382,6 +382,8 @@ namespace Jellyfin.Networking.Tests [InlineData("jellyfin.org", "eth16", false, "eth16")] // User on external network, no binding - so result is the 1st external. [InlineData("jellyfin.org", "", false, "eth11")] + // Dns failure - should skip the test. + [InlineData("ospoakdposkd.abc", "", false, "eth11")] // User assumed to be internal, no binding - so result is the 1st internal. [InlineData("", "", false, "eth16")] public void TestBindInterfaces(string source, string bindAddresses, bool ipv6enabled, string result) @@ -414,10 +416,13 @@ namespace Jellyfin.Networking.Tests _ = nm.TryParseInterface(result, out Collection<IPObject>? resultObj); - if (resultObj != null) + // Check to see if dns resolution is working. If not, skip test. + _ = IPHost.TryParse(source, out var host); + + if (resultObj != null && host?.HasAddress == true) { result = ((IPNetAddress)resultObj[0]).ToString(true); - var intf = nm.GetBindInterface(source, out int? _); + var intf = nm.GetBindInterface(source, out _); Assert.Equal(intf, result); } |
