private TestResponse ParameterOutOfRangePsuIdGetPsuFirmwareStatus()
        {
            TestCase testCase = new TestCase("ParameterOutOfRangePsuIdGetPsuFirmwareStatus", 22804);

            CmTestLog.Info(string.Format(
                "\n !!!!!!Verifying {0} Returns ParameterOutOfRange for Invalid PsuId. WorkItemId: {1}!!!!!!",
                this.currentApi, testCase.WorkItemId));
            TestResponse response = new TestResponse();

            PsuFirmwareStatus getPsuFwResponse = new PsuFirmwareStatus();
            this.TestChannelContext = this.ListTestChannelContexts[(int)WCSSecurityRole.WcsCmAdmin];

            foreach (int invalidValue in Enum.GetValues(typeof(InvalidPsuId)))
            {
                getPsuFwResponse = this.TestChannelContext.GetPSUFirmwareStatus(invalidValue);
                LogMessage.Message = string.Format(
                        "{0}: Command returns completion code {1} for invalid Psu Id {2}",
                        this.currentApi, getPsuFwResponse.completionCode, invalidValue);

                if (getPsuFwResponse.completionCode != CompletionCode.ParameterOutOfRange)
                    LogMessage.Log(LogMessage.MessageType.Failure, ref response);
                else
                    LogMessage.Log(LogMessage.MessageType.Success, ref response);
            }

            testCase.LogPassOrFail(ref response, currentApi);
            return response;
        }
 public UpdatePsu(int idx)
 {
     psuFwStatus = new PsuFirmwareStatus();
     psuFwUpdateResponse = new ChassisResponse();
     psuFwFilePath = string.Empty;
     primaryImage = false;
     passed = true;
     primaryUpdateSuccessCount = 0;
     secondaryUpdateSuccessCount = 0;
     index = idx;
 }
 public UpdatePsu(int idx, string fwFilePath, bool priImage)
 {
     psuFwStatus = new PsuFirmwareStatus();
     psuFwUpdateResponse = new ChassisResponse();
     psuFwFilePath = fwFilePath;
     primaryImage = priImage;
     passed = true;
     primaryUpdateSuccessCount = 0;
     secondaryUpdateSuccessCount = 0;
     index = idx;
 }
        /// <summary>
        /// command specific implementation 
        /// </summary>
        /// <summary>
        /// command specific implementation 
        /// argVal command class member has all user-entered command argument indicators and parameter values
        /// Currently just prints all argument indicators and argument values
        /// </summary>
        internal override void commandImplementation()
        {
            dynamic psuId = null;
            PsuFirmwareStatus response = new PsuFirmwareStatus();

            try
            {
                this.argVal.TryGetValue('i', out psuId);
                response = WcsCli2CmConnectionManager.channel.GetPSUFirmwareStatus((int)psuId);
            }
            catch (Exception ex)
            {
                SharedFunc.ExceptionOutput(ex);
                return;
            }

            if (ResponseValidation.ValidateResponse(null, response, false))
            {
                Console.WriteLine(WcsCliConstants.commandSuccess);
                Console.WriteLine();
                Console.WriteLine(WcsCliConstants.psuFwStatusHeader);
                Console.WriteLine("Firmware Revision\t: " + response.fwRevision);
                Console.WriteLine("Firmware Update Status\t: " + response.fwUpdateStatus);
                Console.WriteLine("Firmware Update Stage\t: " + response.fwUpdateStage);
                Console.WriteLine("Completion Code\t\t: " + response.completionCode);
                Console.WriteLine();
            }
            else
            {
                Console.WriteLine(response.statusDescription);
            }
        }