Esempio n. 1
0
        /// <summary>
        ///     Creates REST channel and registers loggers.
        /// </summary>
        private void Initialize(Uri cmUrl, NetworkCredential credential, IEnumerable <ILogger> loggers)
        {
            // create REST channel
            var factory = new CmRestChannelFactory <IChassisManager>(cmUrl.ToString());

            factory.Timeout = 1000 * CmConstants.RequestTimeoutSeconds;
            if (credential != null)
            {
                factory.Credential = credential;
            }
            this.channel = factory.CreateChannel();

            // if no loggers specifid, use default
            if (loggers == null)
            {
                loggers = new Collection <ILogger>
                {
                    new TxtFileLogger(TestLogName.Instance),
                    new ConsoleLogger()
                };
            }
            // register loggers
            foreach (ILogger log in loggers)
            {
                Log.Loggers.Add(log);
            }
        }
 internal LogCommands(IChassisManager channel, Dictionary<int, IChassisManager> TestChannelContexts, Dictionary<string, string> TestEnvironment)
     : base(channel, TestChannelContexts, TestEnvironment)
 {
     defaultCMName = new Uri(TestEnvironmentSetting["CMURL"]).Host;
     defaultAdminUserName = "******";
     defaultAdminPassword = TestEnvironmentSetting["DefaultPassword"];
 }
 internal LogCommands(IChassisManager channel, Dictionary <int, IChassisManager> TestChannelContexts, Dictionary <string, string> TestEnvironment) :
     base(channel, TestChannelContexts, TestEnvironment)
 {
     defaultCMName        = new Uri(TestEnvironmentSetting["CMURL"]).Host;
     defaultAdminUserName = "******";
     defaultAdminPassword = TestEnvironmentSetting["DefaultPassword"];
 }
 internal PsuFirmwareCommands(IChassisManager channel, Dictionary<int, IChassisManager> TestChannelContexts, Dictionary<string, string> TestEnvironment)
     : base(channel, TestChannelContexts, TestEnvironment)
 {
     lesPsusInChassis = ConfigurationManager.AppSettings["LesOrNonLesPsus"].ToString();
     priLesFwFilePath = ConfigurationManager.AppSettings["PriLesFwFilePath"].ToString();
     priNonLesFwFilePath = ConfigurationManager.AppSettings["PriNonLesFwFilePath"].ToString();
     secLesFwFilePath = ConfigurationManager.AppSettings["SecLesFwFilePath"].ToString();
     secNonLesFwFilePath = ConfigurationManager.AppSettings["SecNonLesFwFilePath"].ToString();
 }
Esempio n. 5
0
        internal CommandBase(IChassisManager channel, Dictionary<int, IChassisManager> listTestChannelContexts, Dictionary<string, string> listCMEnvironmentSetting)
        {
            this.Channel = channel;
            this.TestChannelContext = channel;
            this.ListTestChannelContexts = listTestChannelContexts;
            this.TestEnvironmentSetting = listCMEnvironmentSetting;

            this.defaultCMName = new Uri(this.TestEnvironmentSetting["CMURL"]).Host;
            this.defaultAdminUserName = "******";
            this.defaultAdminPassword = this.TestEnvironmentSetting["DefaultPassword"];
        }
        internal BladeCommands(IChassisManager channel, Dictionary<int, IChassisManager> testChannelContexts)
            : base(channel, testChannelContexts)
        {
            string skuDefFileDir = Path.Combine(Directory.GetCurrentDirectory(), "TestData");
            this.skuDefinitionFile = Path.Combine(skuDefFileDir, "BladeHealthSample.xml");

            if (!File.Exists(this.skuDefinitionFile))
            {
                throw new ApplicationException(string.Format("BladeHealthSample.xml file is NOT found under the path:{0}", skuDefFileDir));
            }
        }
Esempio n. 7
0
        internal CommandBase(IChassisManager channel, Dictionary <int, IChassisManager> listTestChannelContexts, Dictionary <string, string> listCMEnvironmentSetting)
        {
            this.Channel                 = channel;
            this.TestChannelContext      = channel;
            this.ListTestChannelContexts = listTestChannelContexts;
            this.TestEnvironmentSetting  = listCMEnvironmentSetting;

            this.defaultCMName        = new Uri(this.TestEnvironmentSetting["CMURL"]).Host;
            this.defaultAdminUserName = "******";
            this.defaultAdminPassword = this.TestEnvironmentSetting["DefaultPassword"];
        }
        internal UserManagementCommands(IChassisManager channel, Dictionary<int, IChassisManager> testChannelContexts,
            Dictionary<string, string> testEnvironment)
            : base(channel, testChannelContexts, testEnvironment)
        {
            this.defaultCmName = new Uri(this.TestEnvironmentSetting["CMURL"]).Host;
            this.defaultAdminPassword = this.TestEnvironmentSetting["DefaultPassword"];

            this.labDomainTestUser = this.TestEnvironmentSetting["LabDomainTestUser"];
            this.labDomainName = this.TestEnvironmentSetting["LabDomainName"];

            this.defaultAdminUserName = "******";
        }
        public CM_FunctionalTests()
        {
            WebHttpBinding bd = new WebHttpBinding();
            bd.SendTimeout = TimeSpan.FromMinutes(2);

            if (this.DefaultCMUrl.ToLower().Contains("https"))
            {
                ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(ValidateServerCertificate);
                bd.Security.Mode = WebHttpSecurityMode.Transport;
                bd.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
                this.ServiceChannel = new ChannelFactory<IChassisManager>(bd, this.DefaultCMUrl);
            }
            else
            {
                bd.Security.Mode = WebHttpSecurityMode.TransportCredentialOnly;
                bd.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
                this.ServiceChannel = new ChannelFactory<IChassisManager>(bd, this.DefaultCMUrl);
            }

            this.ServiceChannel.Endpoint.Behaviors.Add(new WebHttpBehavior());
            this.Channel = this.ServiceChannel.CreateChannel();
        }
Esempio n. 10
0
 internal NvdimmCommands(IChassisManager channel)
     : base(channel)
 {
 }
 internal NextBootCommands(IChassisManager channel, Dictionary <int, IChassisManager> testChannelContexts) :
     base(channel, testChannelContexts)
 {
 }
 internal NextBootCommands(IChassisManager channel) :
     base(channel)
 {
 }
 internal ChassisCommands(IChassisManager channel)
     : base(channel)
 {
 }
 internal BladeMezzCommands(IChassisManager channel, Dictionary<int, IChassisManager> TestChannelContexts)
     : base(channel, TestChannelContexts)
 {
     this.currentApi = null;
 }
Esempio n. 15
0
 internal AcSocketPowerCommands(IChassisManager channel) : base(channel)
 {
 }
Esempio n. 16
0
 internal AcSocketPowerCommands(IChassisManager channel, Dictionary <int, IChassisManager> testChannelContexts) : base(channel, testChannelContexts)
 {
 }
 internal UserManagementCommands(IChassisManager channel)
     : base(channel)
 {
 }
Esempio n. 18
0
 internal CommandBase(IChassisManager channel, Dictionary <int, IChassisManager> listTestChannelContexts)
 {
     this.Channel                 = channel;
     this.TestChannelContext      = channel;
     this.ListTestChannelContexts = listTestChannelContexts;
 }
Esempio n. 19
0
 internal CommandBase(IChassisManager channel)
 {
     this.Channel            = channel;
     this.TestChannelContext = channel;
 }
Esempio n. 20
0
 internal NvdimmCommands(IChassisManager channel) :
     base(channel)
 {
 }
Esempio n. 21
0
 internal PowerCommands(IChassisManager channel, Dictionary<int, IChassisManager> testChannelContexts,
     Dictionary<string, string> testEnvironment)
     : base(channel, testChannelContexts, testEnvironment)
 {
 }
 internal SerialConsoleCommands(IChassisManager channel, Dictionary<int, IChassisManager> testChannelContexts)
     : base(channel, testChannelContexts)
 {
 }
 internal AcSocketPowerCommands(IChassisManager channel)
     : base(channel)
 {
 }
Esempio n. 24
0
        /// <summary>
        ///     Creates REST channel and registers loggers.
        /// </summary>
        private void Initialize(Uri cmUrl, NetworkCredential credential, IEnumerable<ILogger> loggers)
        {
            // create REST channel
            var factory = new CmRestChannelFactory<IChassisManager>(cmUrl.ToString());
            factory.Timeout = 1000 * CmConstants.RequestTimeoutSeconds;
            if (credential != null)
            {
                factory.Credential = credential;
            }
            this.channel = factory.CreateChannel();

            // if no loggers specifid, use default
            if (loggers == null)
            {
                loggers = new Collection<ILogger>
                {
                    new TxtFileLogger(TestLogName.Instance),
                    new ConsoleLogger()
                };
            }
            // register loggers
            foreach (ILogger log in loggers)
            {
                Log.Loggers.Add(log);
            }
        }
        public CM_FunctionalTests(string cMUrl, string uName, string uPassword)
        {
            WebHttpBinding bd = new WebHttpBinding();
            bd.SendTimeout = TimeSpan.FromMinutes(2);

            if (cMUrl.ToLower().Contains("https"))
            {
                ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(ValidateServerCertificate);
                bd.Security.Mode = WebHttpSecurityMode.Transport;
                bd.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
                this.ServiceChannel = new ChannelFactory<IChassisManager>(bd, cMUrl);
            }
            else
            {
                bd.Security.Mode = WebHttpSecurityMode.TransportCredentialOnly;
                bd.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
                this.ServiceChannel = new ChannelFactory<IChassisManager>(bd, cMUrl);
            }

            this.ServiceChannel.Endpoint.Behaviors.Add(new WebHttpBehavior());

            // Check if user credentials are specified, if not use default
            if (!string.IsNullOrEmpty(uName))
            {
                // Set user credentials specified
                this.ServiceChannel.Credentials.Windows.ClientCredential =
                    new System.Net.NetworkCredential(uName, uPassword);
            }
            this.Channel = this.ServiceChannel.CreateChannel();
        }
Esempio n. 26
0
 internal CommandBase(IChassisManager channel, Dictionary<int, IChassisManager> listTestChannelContexts)
 {
     this.Channel = channel;
     this.TestChannelContext = channel;
     this.ListTestChannelContexts = listTestChannelContexts;
 }
Esempio n. 27
0
 internal NextBootCommands(IChassisManager channel)
     : base(channel)
 {
 }
 internal SerialConsoleCommands(IChassisManager channel)
     : base(channel)
 {
 }
 internal AcSocketPowerCommands(IChassisManager channel, Dictionary<int, IChassisManager> testChannelContexts)
     : base(channel, testChannelContexts)
 {
 }
Esempio n. 30
0
 internal NextBootCommands(IChassisManager channel, Dictionary<int, IChassisManager> testChannelContexts)
     : base(channel, testChannelContexts)
 {
 }
Esempio n. 31
0
 internal CommandBase(IChassisManager channel)
 {
     this.Channel = channel;
     this.TestChannelContext = channel;
 }
 internal AssetManagementCommands(IChassisManager channel, Dictionary<int, IChassisManager> TestChannelContexts)
     : base(channel, TestChannelContexts)
 {
 }
 internal AssetManagementCommands(IChassisManager channel, Dictionary<int, IChassisManager> TestChannelContexts, Dictionary<string, string> TestEnvironment)
     : base(channel, TestChannelContexts, TestEnvironment)
 {
 }
 internal LogCommands(IChassisManager channel, Dictionary <int, IChassisManager> TestChannelContexts) :
     base(channel, TestChannelContexts)
 {
 }