protected override void TestInitialize() { base.TestInitialize(); this.TestSite.DefaultProtocolDocShortName = "MS-ADOD"; //Initialize PTF Configurations this.TestConfig = new ADODTestConfig(this.TestSite); //Initialze SUT Adapters this.TestSite.Log.Add(LogEntryKind.Debug, "Initialize SUT control adapters."); this.ClientControlAdapter = (IClientControlAdapter)this.TestSite.GetAdapter(typeof(IClientControlAdapter)); this.DCControlAdapter = (IDCControlAdapter)this.TestSite.GetAdapter(typeof(IDCControlAdapter)); // Initialize Message Analyzer Adapter this.TestSite.Log.Add(LogEntryKind.Debug, "Initialize Message Analyzer adapters."); this.MaAdapter = (IMessageAnalyzerAdapter)this.TestSite.GetAdapter(typeof(IMessageAnalyzerAdapter)); this.MaAdapter.Reset(); // Initialize Test Environment this.TestSite.Log.Add(LogEntryKind.TestStep, "[INITIALIZE TEST ENVIRONMENT]"); if (!this.TestConfig.TriggerDisabled) { this.TestSite.Assert.IsTrue(this.InitEnvironment(), "Initialize test case should succeed."); } }
protected override void TestInitialize() { base.TestInitialize(); this.testConfig = new TestConfig(); this.sutController = BaseTestSite.GetAdapter <ISutControlAdapter>(); if (this.testConfig.LocalRealm.KDC[0].IsWindows && this.testConfig.TrustType != TrustType.NoTrust) { //set forest trust authentication as forest-wide authentication this.sutController.setSelectiveAuth(this.testConfig.LocalRealm.RealmName, this.testConfig.LocalRealm.Admin.Username, this.testConfig.LocalRealm.Admin.Password, this.testConfig.TrustedRealm.RealmName, false); } if (this.testConfig.TrustedRealm.KDC[0].IsWindows && this.testConfig.TrustType != TrustType.NoTrust) { //set forest trust authentication as forest-wide authentication this.sutController.setSelectiveAuth(this.testConfig.TrustedRealm.RealmName, this.testConfig.TrustedRealm.Admin.Username, this.testConfig.TrustedRealm.Admin.Password, this.testConfig.LocalRealm.RealmName, false); } // create KKDCP Client Config according to config file if (this.testConfig.UseProxy && proxyClientConfig == null) { X509Certificate2 clientCert = null; if (!string.IsNullOrEmpty(this.testConfig.KKDCPClientCertPath)) { Assert.IsFalse(!string.IsNullOrEmpty(this.testConfig.KKDCPClientCertPassword), "The protected password should be set."); clientCert = new X509Certificate2(); try { clientCert.Import(this.testConfig.KKDCPClientCertPath, this.testConfig.KKDCPClientCertPassword, X509KeyStorageFlags.DefaultKeySet); } catch { BaseTestSite.Log.Add(LogEntryKind.TestError, "Error in importing client certificate."); throw; } } proxyClientConfig = new KKDCPClientConfig() { KKDCPServerURL = this.testConfig.KKDCPServerUrl, TlsClientCertificate = clientCert }; } IClientControlAdapter adapter = BaseTestSite.GetAdapter <IClientControlAdapter>(); adapter.RestoreSupportedEncryptionTypes(); adapter.EnableCompoundIdentity(); }