From 92999abd001f5fa79fca21604464da948e03d261 Mon Sep 17 00:00:00 2001 From: heng-liu <45407901+heng-liu@users.noreply.github.com> Date: Tue, 16 Jun 2020 11:57:42 -0700 Subject: [PATCH] Disable verification during extraction for Mono, disable a test on Mono (#3451) * disable verification during extraction on mono,disable a mono test on Mac --- .../NuGet.Packaging/PackageArchiveReader.cs | 11 ++++++++++- .../NuGet.CommandLine.Test/NuGetVerifyCommandTest.cs | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/NuGet.Core/NuGet.Packaging/PackageArchiveReader.cs b/src/NuGet.Core/NuGet.Packaging/PackageArchiveReader.cs index 76c4233795d..99a66ce4e2d 100644 --- a/src/NuGet.Core/NuGet.Packaging/PackageArchiveReader.cs +++ b/src/NuGet.Core/NuGet.Packaging/PackageArchiveReader.cs @@ -381,7 +381,16 @@ public override Task GetArchiveHashAsync(HashAlgorithmName hashAlgorithm public override bool CanVerifySignedPackages(SignedPackageVerifierSettings verifierSettings) { #if IS_SIGNING_SUPPORTED - return true; + // Mono support has been deprioritized, so verification on Mono is not enabled, tracking issue: https://github.com/NuGet/Home/issues/9027 + if (RuntimeEnvironmentHelper.IsMono) + { + return false; + } + else + { + return true; + } + #else return false; #endif diff --git a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetVerifyCommandTest.cs b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetVerifyCommandTest.cs index a40b1660dba..41b92e0ee25 100644 --- a/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetVerifyCommandTest.cs +++ b/test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGetVerifyCommandTest.cs @@ -58,7 +58,7 @@ public void VerifyCommand_WrongInput_NotFound() } } - [Fact] + [PlatformFact(Platform.Windows, SkipMono = true)] public void VerifyCommand_WithAuthorSignedPackage_FailsGracefully() { var nugetExe = Util.GetNuGetExePath();