From f80b35a585426bc480fee3106ac16a56eb223c27 Mon Sep 17 00:00:00 2001 From: Michele Di Maria Date: Sat, 15 Jun 2024 20:02:46 +0200 Subject: [PATCH] Check UnitTests and version update before release. --- README.md | 4 ++-- TraceRoute/Services/ReverseLookupService.cs | 2 +- UnitTests/Services/IpApiClientTests.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 22bdf73..8c00218 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ Based on the original repository: https://github.com/bencorn/traceroute ### Running in Docker You can use the following image to run Visual Trace Route locally: -michele73/traceroute:1.2.2 +michele73/traceroute:1.2.3 Example: -docker run -d -p 8081:80 --name=traceroute --restart=always -v traecroute_logs:/app/logs michele73/traceroute:1.2.2 +docker run -d -p 8081:80 --name=traceroute --restart=always -v traecroute_logs:/app/logs michele73/traceroute:1.2.3 The image repository is here: https://hub.docker.com/r/michele73/traceroute diff --git a/TraceRoute/Services/ReverseLookupService.cs b/TraceRoute/Services/ReverseLookupService.cs index 9ae187b..5cd2bf9 100644 --- a/TraceRoute/Services/ReverseLookupService.cs +++ b/TraceRoute/Services/ReverseLookupService.cs @@ -35,7 +35,7 @@ public async Task GetHostName(string ipAddress) _logger.LogDebug("Lookup bash result: {0}", lookupResult); var splits = lookupResult.Split(" ", StringSplitOptions.RemoveEmptyEntries).ToList(); - if (splits.Count > 0 && !lookupResult.Contains("not found:")) + if (splits.Count > 0 && !lookupResult.Contains("not found:") && !lookupResult.Contains("has no PTR record")) { result = splits.Last(); result = result.Replace("\n", ""); diff --git a/UnitTests/Services/IpApiClientTests.cs b/UnitTests/Services/IpApiClientTests.cs index 3730345..07c4d32 100644 --- a/UnitTests/Services/IpApiClientTests.cs +++ b/UnitTests/Services/IpApiClientTests.cs @@ -34,12 +34,12 @@ public async Task GetKnownIP() Assert.AreEqual("Milan", result.city); Assert.AreEqual("Italy", result.country); Assert.AreEqual("Lombardy", result.regionName); + Assert.AreEqual("Europe", result.continent); Assert.IsNotNull(result.lat); Assert.IsNotNull(result.lon); Assert.IsNotNull(result.isp); Assert.IsNotNull(result.zip); - Assert.IsNull(result.continent); - Assert.IsNull(result.district); + Assert.IsNotNull(result.district); } [TestMethod]