Skip to content

Commit

Permalink
[iOS/tvOS] Skip System.Security.Cryptography.Pkcs PNSE, System.Diagno…
Browse files Browse the repository at this point in the history
…stics.Tracing and System.Runtime.Extensions test (#58210)
  • Loading branch information
mdh1418 authored Aug 27, 2021
1 parent 81d6404 commit b1ae7b9
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ public void Test_EventSourceCreatedEvents_AfterListener()
[Theory]
[InlineData(true)]
[InlineData(false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
public void Test_EventListenerThrows_ExceptionIsNotRethrownToCaller(bool setThrowOnEventWriteErrorsFlag)
{
TestUtilities.CheckNoEventSourcesRunning("Start");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public void GetFolderPath_Unix_PersonalIsHomeAndUserProfile()
Assert.Equal(Environment.GetEnvironmentVariable("HOME"), Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
}
// tvOS effectively doesn't have a HOME
if (!PlatformDetection.IstvOS)
if (!PlatformDetection.IsiOS && !PlatformDetection.IstvOS)
{
Assert.Equal(Environment.GetEnvironmentVariable("HOME"), Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ public static void AddAttributeToIndefiniteLengthContent()
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public static void AddSigner_RSA_EphemeralKey()
{
using (RSA rsa = RSA.Create())
Expand Down Expand Up @@ -435,6 +436,7 @@ public static void AddSigner_DSA_EphemeralKey()
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public static void AddSigner_ECDSA_EphemeralKey()
{
using (ECDsa ecdsa = ECDsa.Create())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ public static void ExportMultiplePrivateKeys()
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public static void CanAddMultipleCertsWithSinglePrivateKey()
{
using (var oneWithKey = new X509Certificate2(TestData.PfxData, TestData.PfxDataPassword, X509KeyStorageFlags.Exportable | Cert.EphemeralIfPossible))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public static void ExportAsPfxVerifyPassword()
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public static void ExportAsPfxWithPrivateKeyVerifyPassword()
{
using (var cert = new X509Certificate2(TestData.PfxData, TestData.PfxDataPassword, X509KeyStorageFlags.Exportable))
Expand All @@ -124,6 +125,7 @@ public static void ExportAsPfxWithPrivateKeyVerifyPassword()
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public static void ExportAsPfxWithPrivateKey()
{
using (X509Certificate2 cert = new X509Certificate2(TestData.PfxData, TestData.PfxDataPassword, X509KeyStorageFlags.Exportable))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public static IEnumerable<object[]> AllSingleCertVariations

[Theory]
[MemberData(nameof(AllSingleCertVariations))]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void OneCertWithOneKey(SingleCertOptions options)
{
bool sameContainer = (options & SingleCertOptions.KeyAndCertInSameContents) != 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public void EmptyPfx_BadPassword()
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void OneCert_NoKeys_EncryptedNullPassword_NoMac()
{
using (X509Certificate2 cert = new X509Certificate2(TestData.MsCertificate))
Expand All @@ -175,6 +176,7 @@ public void OneCert_NoKeys_EncryptedNullPassword_NoMac()
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void OneCert_NoKeys_EncryptedEmptyPassword_NoMac()
{
using (X509Certificate2 cert = new X509Certificate2(TestData.MsCertificate))
Expand All @@ -196,6 +198,7 @@ public void OneCert_NoKeys_EncryptedEmptyPassword_NoMac()
[InlineData(false, true)]
[InlineData(true, false)]
[InlineData(true, true)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void OneCert_EncryptedEmptyPassword_OneKey_EncryptedNullPassword_NoMac(bool encryptKeySafe, bool associateKey)
{
// This test shows that while a null or empty password will result in both
Expand Down Expand Up @@ -237,6 +240,7 @@ public void OneCert_EncryptedEmptyPassword_OneKey_EncryptedNullPassword_NoMac(bo
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void OneCert_MismatchedKey()
{
string pw = nameof(OneCert_MismatchedKey);
Expand Down Expand Up @@ -285,6 +289,7 @@ public void OneCert_MismatchedKey()
[Theory]
[InlineData(false)]
[InlineData(true)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void OneCert_TwoKeys_FirstWins(bool correctKeyFirst)
{
string pw = nameof(OneCert_TwoKeys_FirstWins);
Expand Down Expand Up @@ -356,6 +361,7 @@ public void OneCert_TwoKeys_FirstWins(bool correctKeyFirst)
[Theory]
[InlineData(false)]
[InlineData(true)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void TwoCerts_OneKey(bool certWithKeyFirst)
{
string pw = nameof(TwoCerts_OneKey);
Expand Down Expand Up @@ -400,6 +406,7 @@ public void TwoCerts_OneKey(bool certWithKeyFirst)
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void OneCert_ExtraKeyWithUnknownAlgorithm()
{
string pw = nameof(OneCert_ExtraKeyWithUnknownAlgorithm);
Expand Down Expand Up @@ -445,6 +452,7 @@ public void OneCert_ExtraKeyWithUnknownAlgorithm()
[Theory]
[InlineData(true)]
[InlineData(false)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void OneCert_ExtraKeyBadEncoding(bool badTag)
{
string pw = nameof(OneCert_ExtraKeyBadEncoding);
Expand Down Expand Up @@ -503,6 +511,7 @@ public void OneCert_ExtraKeyBadEncoding(bool badTag)
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void OneCert_NoKey_WithLocalKeyId()
{
string pw = nameof(OneCert_NoKey_WithLocalKeyId);
Expand All @@ -524,6 +533,7 @@ public void OneCert_NoKey_WithLocalKeyId()
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void OneCert_TwentyKeys_NoMatches()
{
string pw = nameof(OneCert_NoKey_WithLocalKeyId);
Expand Down Expand Up @@ -562,6 +572,7 @@ public void OneCert_TwentyKeys_NoMatches()
[Theory]
[InlineData(true)]
[InlineData(false)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void TwoCerts_TwentyKeys_NoMatches(bool msCertFirst)
{
string pw = nameof(OneCert_NoKey_WithLocalKeyId);
Expand Down Expand Up @@ -635,6 +646,7 @@ public void OneCorruptCert()
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void CertAndKey_NoLocalKeyId()
{
string pw = nameof(CertAndKey_NoLocalKeyId);
Expand All @@ -661,6 +673,7 @@ public void CertAndKey_NoLocalKeyId()
[Theory]
[InlineData(false)]
[InlineData(true)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void SameCertTwice_NoKeys(bool addLocalKeyId)
{
string pw = nameof(SameCertTwice_NoKeys);
Expand Down Expand Up @@ -692,6 +705,7 @@ public void SameCertTwice_NoKeys(bool addLocalKeyId)
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void TwoCerts_CrossedKeys()
{
string pw = nameof(TwoCerts_CrossedKeys);
Expand Down Expand Up @@ -766,6 +780,7 @@ public void TwoCerts_CrossedKeys()
[InlineData(false, false)]
[InlineData(true, false)]
[InlineData(true, true)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void CertAndKeyTwice(bool addLocalKeyId, bool crossIdentifiers)
{
string pw = nameof(CertAndKeyTwice);
Expand Down Expand Up @@ -821,6 +836,7 @@ public void CertAndKeyTwice(bool addLocalKeyId, bool crossIdentifiers)
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void CertAndKeyTwice_KeysUntagged()
{
string pw = nameof(CertAndKeyTwice);
Expand Down Expand Up @@ -873,6 +889,7 @@ public void CertAndKeyTwice_KeysUntagged()
[Theory]
[InlineData(false)]
[InlineData(true)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void CertTwice_KeyOnce(bool addLocalKeyId)
{
string pw = nameof(CertTwice_KeyOnce);
Expand Down Expand Up @@ -930,6 +947,7 @@ public void CertTwice_KeyOnce(bool addLocalKeyId)
[Theory]
[InlineData(false)]
[InlineData(true)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void CertTwice_KeyOnce_OtherCertBetter(bool addLocalKeyId)
{
string pw = nameof(CertTwice_KeyOnce);
Expand Down Expand Up @@ -990,6 +1008,7 @@ public void CertTwice_KeyOnce_OtherCertBetter(bool addLocalKeyId)
[InlineData(false, true)]
[InlineData(true, false)]
[InlineData(true, true)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public void TwoCerts_TwoKeys_ManySafeContentsValues(bool invertCertOrder, bool invertKeyOrder)
{
string pw = nameof(TwoCerts_TwoKeys_ManySafeContentsValues);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ private static void VerifyPrivateKey(RSA rsa)

[Theory]
[MemberData(nameof(StorageFlags))]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public static void ExportWithPrivateKey(X509KeyStorageFlags keyStorageFlags)
{
using (var cert = new X509Certificate2(TestData.PfxData, TestData.PfxDataPassword, X509KeyStorageFlags.Exportable | keyStorageFlags))
Expand Down

0 comments on commit b1ae7b9

Please sign in to comment.