public Prerequisites GetPrerequisites() { Prerequisites pre = new Prerequisites() { Summary = "Summary", Title = "Test", Properties = new Dictionary<string, List<string>>() { {"Property1",new List<string>(){"Value1"}}, {"Property2",new List<string>(){"Value2","Value3"}}, {"Property3",new List<string>(){"Value4","Value5","Value6"}} } }; return pre; }
/// <summary> /// Gets the prerequisites for auto-detection. /// </summary> /// <returns>A instance of Prerequisites class.</returns> public Prerequisites GetPrerequisites() { Prerequisites prerequisites = new Prerequisites(); prerequisites.Title = "Remote Desktop"; prerequisites.Summary = "Please input the below info to detect SUT."; Dictionary<string, List<string>> propertiesDic = new Dictionary<string, List<string>>(); //Retrieve values from *.ptfconfig file string sutName = DetectorUtil.GetPropertyValue("SUTName"); string userNameInTC = DetectorUtil.GetPropertyValue("SUTUserName"); string userPwdInTC = DetectorUtil.GetPropertyValue("SUTUserPassword"); string isWindowsImplementation = DetectorUtil.GetPropertyValue("IsWindowsImplementation"); List<string> sutNames = new List<string>(); List<string> userNamesInTC = new List<string>(); List<string> userPwdsInTC = new List<string>(); List<string> isWindowsImplementationList = new List<string>(); if (string.IsNullOrWhiteSpace(sutName) || string.IsNullOrWhiteSpace(userNameInTC) || string.IsNullOrWhiteSpace(userPwdInTC) || string.IsNullOrWhiteSpace(isWindowsImplementation)) { sutNames.Add("SUT01"); userNamesInTC.Add("administrator"); userPwdsInTC.Add("Password01!"); isWindowsImplementationList.Add("true"); isWindowsImplementationList.Add("false"); } else { sutNames.Add(sutName); userNamesInTC.Add(userNameInTC); userPwdsInTC.Add(userPwdInTC); isWindowsImplementationList.Add(isWindowsImplementation); if (isWindowsImplementation.ToUpper().Equals("TRUE")) { isWindowsImplementationList.Add("false"); } else { isWindowsImplementationList.Add("true"); } } propertiesDic.Add(tcComputerNameTitle, sutNames); propertiesDic.Add(isWindowsImplementationTitle, isWindowsImplementationList); propertiesDic.Add(triggerMethodTitle, new List<string>() { "Powershell", "Managed", "Interactive"}); propertiesDic.Add(userNameInTCTitle, userNamesInTC); propertiesDic.Add(userPwdInTCTitle, userPwdsInTC); propertiesDic.Add(agentPortTitle, new List<string>() {"4488"}); prerequisites.Properties = propertiesDic; return prerequisites; }
/// <summary> /// Get the prerequisites for auto-detection. /// </summary> /// <returns>A instance of Prerequisites class.</returns> public Prerequisites GetPrerequisites() { var prerequisites = new Prerequisites(); prerequisites.Title = "MS-SMBD"; prerequisites.Summary = "Please input the below info to detect SUT.\r\nIf SUT is in WORKGROUP, leave Domain Name blank."; // Properties prerequisites.Properties = new Dictionary <string, List <string> >(); string sutName = DetectorUtil.GetPropertyValue(DeploymentPtfConfigConstant.SUTCOMPUTERNAME); prerequisites.Properties.Add(PropertyDictionaryConstant.SUTNAME, new List <string> { sutName }); string domainName = DetectorUtil.GetPropertyValue(DeploymentPtfConfigConstant.DOMAINNAME); prerequisites.Properties.Add(PropertyDictionaryConstant.DOMAINNAME, new List <string> { domainName }); string sutUserName = DetectorUtil.GetPropertyValue(DeploymentPtfConfigConstant.SUTUSERNAME); prerequisites.Properties.Add(PropertyDictionaryConstant.SUTUSERNAME, new List <string> { sutUserName }); string sutPassword = DetectorUtil.GetPropertyValue(DeploymentPtfConfigConstant.SUTPASSWORD); prerequisites.Properties.Add(PropertyDictionaryConstant.SUTPASSWORD, new List <string> { sutPassword }); prerequisites.Properties.Add(PropertyDictionaryConstant.AUTHENTICATION, new List <string>() { SecurityPackageType.Negotiate.ToString(), SecurityPackageType.Kerberos.ToString(), SecurityPackageType.Ntlm.ToString() }); string shareFolder = DetectorUtil.GetPropertyValue(DeploymentPtfConfigConstant.SHAREFOLDER); prerequisites.Properties.Add(PropertyDictionaryConstant.SHAREFOLDER, new List <string> { shareFolder }); prerequisites.Properties.Add(PropertyDictionaryConstant.ISWINDOWSIMPLEMENTATION, new List <string> { "True", "False" }); string smbdPort = DetectorUtil.GetPropertyValue(PtfConfigConstant.SMBDTCPPORT); prerequisites.Properties.Add(PropertyDictionaryConstant.SMBDPORT, new List <string> { smbdPort }); string connectionTimeout = DetectorUtil.GetPropertyValue(PtfConfigConstant.SMB2CONNECTIONTIMEOUTINSECONDS); prerequisites.Properties.Add(PropertyDictionaryConstant.CONNECTIONTIMEOUT, new List <string> { connectionTimeout }); return(prerequisites); }
/// <summary> /// Get the prerequisites for auto-detection. /// </summary> /// <returns>A instance of Prerequisites class.</returns> public Prerequisites GetPrerequisites() { Prerequisites prerequisites = new Prerequisites(); prerequisites.Title = "FileServer"; prerequisites.Summary = "Please input the below info to detect SUT.\r\nIf SUT is in WORKGROUP, set Domain Name to the same value as the Target SUT field."; Dictionary<string, List<string>> propertiesDic = new Dictionary<string, List<string>>(); #region Set Properties // Retrieve saved value from *.ptfconfig file string SUT = DetectorUtil.GetPropertyValue("Common.SutComputerName"); string domain = DetectorUtil.GetPropertyValue("Common.DomainName"); string user = DetectorUtil.GetPropertyValue("Common.AdminUserName"); string password = DetectorUtil.GetPropertyValue("Common.PasswordForAllUsers"); List<string> domainList = new List<string>(); List<string> SUTList = new List<string>(); List<string> userList = new List<string>(); List<string> passwordList = new List<string>(); if (string.IsNullOrWhiteSpace(SUT) || string.IsNullOrWhiteSpace(domain) || string.IsNullOrWhiteSpace(user) || string.IsNullOrWhiteSpace(password)) { SUTList.Add("node01"); domainList.Add("contoso.com"); userList.Add("administrator"); passwordList.Add("Password01!"); } else { SUTList.Add(SUT); domainList.Add(domain); userList.Add(user); passwordList.Add(password); } propertiesDic.Add(SUTTitle, SUTList); propertiesDic.Add(domainTitle, domainList); propertiesDic.Add(userTitle, userList); propertiesDic.Add(passwordTitle, passwordList); propertiesDic.Add(securityPackageTitle, new List<string>() { "Negotiate", "Kerberos", "Ntlm" }); // Get the real environment DomainName string domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName; if (string.IsNullOrWhiteSpace(domainName)) domainName = SUT; List<string> tempDomainList = propertiesDic[domainTitle]; tempDomainList.Clear(); tempDomainList.Add(domainName); #endregion prerequisites.Properties = propertiesDic; return prerequisites; }
/// <summary> /// Get the prerequisites for auto-detection. /// </summary> /// <returns>A instance of Prerequisites class.</returns> public Prerequisites GetPrerequisites() { hasLocalSmbAP = false; hasLocalWebAP = false; hasTrustSmbAP = false; hasTrustWebAP = false; Prerequisites reqs = new Prerequisites(); reqs.Title = "Pre-Detect Configure"; reqs.Summary = "Please set the following values:"; reqs.Properties = new Dictionary<string, List<string>>(); List<string> TrustType = new List<string>(); TrustType.Add("Forest"); TrustType.Add("Realm"); TrustType.Add("NoTrust"); reqs.Properties.Add("TrustType", TrustType); //KkdcpInfo List<string> IsKkdcpSupported = new List<string>(); IsKkdcpSupported.Add("true"); IsKkdcpSupported.Add("false"); reqs.Properties.Add("Support KKDCP", IsKkdcpSupported); List<string> kkdcpProxyUrl = new List<string>(); kkdcpProxyUrl.Add("https://proxy01.contoso.com/kdcproxy"); reqs.Properties.Add("KKDCP proxy Url", kkdcpProxyUrl); #region local realm reqs.Properties.Add("Local Domain", ServerHelper.ConstructValueListUsingPtfConfig("LocalRealm.RealmName")); reqs.Properties.Add("Local Domain Admin", ServerHelper.ConstructValueListUsingPtfConfig("LocalRealm.Users.Admin.Username")); reqs.Properties.Add("Local Domain Admin Pwd", ServerHelper.ConstructValueListUsingPtfConfig("LocalRealm.Users.Admin.Password")); reqs.Properties.Add("Local DC is LDAP Server", ServerHelper.ConstructValueList("true","false")); reqs.Properties.Add("Local AP Server Name", ServerHelper.ConstructValueListUsingPtfConfig("LocalRealm.FileServer01.FQDN")); reqs.Properties.Add("Local AP is File Server", ServerHelper.ConstructValueList("true", "false")); reqs.Properties.Add("Local AP is HTTP Server", ServerHelper.ConstructValueList("true", "false")); List<string> LocalHttpUri = new List<string>(); LocalHttpUri.Add("Http://ap01.contoso.com"); reqs.Properties.Add("Local HTTP Server Uri", LocalHttpUri); #endregion #region cross realm prequisite List<string> trustDomainName = new List<string>(); trustDomainName.Add("Kerb.com"); reqs.Properties.Add("Trust Domain", trustDomainName); List<string> trustDomainAdminUsername = new List<string>(); trustDomainAdminUsername.Add("Administrator"); reqs.Properties.Add("Trust Domain Admin User", trustDomainAdminUsername); List<string> trustDomainAdminPwd = new List<string>(); trustDomainAdminPwd.Add("Password01#"); reqs.Properties.Add("Trust Domain Admin Pwd", trustDomainAdminPwd); List<string> ForestTrustPwd = new List<string>(); ForestTrustPwd.Add("Password01!"); reqs.Properties.Add("Trust Password", ForestTrustPwd); List<string> IsTrustLdapAPSUT = new List<string>(); IsTrustLdapAPSUT.Add("true"); IsTrustLdapAPSUT.Add("false"); reqs.Properties.Add("Trust DC is LDAP Server", IsTrustLdapAPSUT); reqs.Properties.Add("Trust AP Server Name", ServerHelper.ConstructValueListUsingPtfConfig("TrustedRealm.FileServer01.FQDN")); List<string> IsTrustSmbAPSUT = new List<string>(); IsTrustSmbAPSUT.Add("true"); IsTrustSmbAPSUT.Add("false"); reqs.Properties.Add("Trust AP is File Server", IsTrustSmbAPSUT); List<string> IsTrustHttpAPSUT = new List<string>(); IsTrustHttpAPSUT.Add("true"); IsTrustHttpAPSUT.Add("false"); reqs.Properties.Add("Trust AP is HTTP Server", IsTrustHttpAPSUT); List<string> TrustHttpUri = new List<string>(); TrustHttpUri.Add("http://ap02.kerb.com"); reqs.Properties.Add("Trust Http Server Uri", TrustHttpUri); #endregion return reqs; }
/// <summary> /// Get the prerequisites for auto-detection: Read the configuration values from .ptfconfig file into prerequisites.Properties /// </summary> /// <returns>A instance of Prerequisites class.</returns> public Prerequisites GetPrerequisites() { Prerequisites prerequisites = new Prerequisites(); prerequisites.Title = "Pre-Detect Configure"; prerequisites.Summary = "Please input below info to detect SUT.\r\nIf SUT is ContentServer, leave \"HostedCache Server Name\" as blank."; Dictionary <string, List <string> > propertiesDic = new Dictionary <string, List <string> >(); #region Set Properties //Retrieve saved value from *.ptfconfig file string contentServerName = DetectorUtil.GetPropertyValue("ContentServerComputerName"); string hostedCacheServerName = DetectorUtil.GetPropertyValue("HostedCacheServerComputerName"); string domain = DetectorUtil.GetPropertyValue("DomainName"); string user = DetectorUtil.GetPropertyValue("UserName"); string password = DetectorUtil.GetPropertyValue("UserPassword"); string contentTransport = DetectorUtil.GetPropertyValue("ContentTransport"); string uncSharePath = DetectorUtil.GetPropertyValue("SharedFolderName"); List <string> contentServerList = new List <string>(); List <string> hostedCacheServerList = new List <string>(); List <string> domainList = new List <string>(); List <string> SUTList = new List <string>(); List <string> userList = new List <string>(); List <string> passwordList = new List <string>(); List <string> transportList = new List <string>(); List <string> uncSharePathList = new List <string>(); if (string.IsNullOrWhiteSpace(contentServerName) || string.IsNullOrWhiteSpace(hostedCacheServerName) || string.IsNullOrWhiteSpace(domain) || string.IsNullOrWhiteSpace(user) || string.IsNullOrWhiteSpace(password) || string.IsNullOrWhiteSpace(contentTransport) || string.IsNullOrWhiteSpace(uncSharePath)) { contentServerList.Add("ContentServer"); hostedCacheServerList.Add("HostedCacheServer"); domainList.Add("contoso.com"); userList.Add("administrator"); passwordList.Add("Password01!"); transportList.Add("SMB2"); uncSharePathList.Add("C:\\FileShare"); } else { contentServerList.Add(contentServerName); hostedCacheServerList.Add(hostedCacheServerName); domainList.Add(domain); userList.Add(user); passwordList.Add(password); transportList.Add(contentTransport); uncSharePathList.Add(uncSharePath); } propertiesDic.Add(ContentServerTitle, contentServerList); propertiesDic.Add(HostedCacheServerTitle, hostedCacheServerList); propertiesDic.Add(domainTitle, domainList); propertiesDic.Add(userTitle, userList); propertiesDic.Add(passwordTitle, passwordList); propertiesDic.Add(contentTransportTitle, transportList); propertiesDic.Add(uncSharePathTitle, uncSharePathList); //Get the real environment DomainName string domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName; #endregion prerequisites.Properties = propertiesDic; return(prerequisites); }