internal void InternalValidateClusterThumbprintUpdateTest( string originalThumbprint, string originalSecondaryThumbprint, string updatedThumbprint, string updatedSecondaryThumbprint, ClusterManagementErrorCode?expectedErrorCode = null) { CertificateDescription currentCert = new CertificateDescription() { Thumbprint = originalThumbprint, ThumbprintSecondary = originalSecondaryThumbprint, }; CertificateDescription updatedCert = new CertificateDescription() { Thumbprint = updatedThumbprint, ThumbprintSecondary = updatedSecondaryThumbprint, }; Utility.ValidateExpectedValidationException( delegate { StandaloneSettingsValidator.ValidateClusterCertificateThumbprintAndCnUpdate( StandaloneSettingsValidator.GetUniqueThumbprints(currentCert), StandaloneSettingsValidator.GetUniqueThumbprints(updatedCert), true, true); }, expectedErrorCode); }
internal void InternalValidateClusterCnUpdateTest( string originalCns, string updatedCns, ClusterManagementErrorCode?expectedErrorCode = null) { Utility.ValidateExpectedValidationException( delegate { X509 originalSecurity = new X509() { ClusterCertificateCommonNames = new ServerCertificateCommonNames() { CommonNames = new List <CertificateCommonNameBase>(originalCns.Split(',').ToList().Select(p => new CertificateCommonNameBase() { CertificateCommonName = p })) } }; X509 updatedSecurity = new X509() { ClusterCertificateCommonNames = new ServerCertificateCommonNames() { CommonNames = new List <CertificateCommonNameBase>(updatedCns.Split(',').ToList().Select(p => new CertificateCommonNameBase() { CertificateCommonName = p })) } }; List <string> originalThumbprintsOrCns = StandaloneSettingsValidator.GetClusterCertUniqueThumbprintsOrCommonNames(originalSecurity); List <string> updatedThumbprintsOrCns = StandaloneSettingsValidator.GetClusterCertUniqueThumbprintsOrCommonNames(updatedSecurity); StandaloneSettingsValidator.ValidateClusterCertificateThumbprintAndCnUpdate( originalThumbprintsOrCns, updatedThumbprintsOrCns, false, false); }, expectedErrorCode); }