Fix pldmtool output to support json format

Change-Id: I92a6af0ca1ee5edf77fda1439435bf3956881b0d
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/data/pldm_variables.py b/data/pldm_variables.py
index 9f40440..6e7f1e6 100755
--- a/data/pldm_variables.py
+++ b/data/pldm_variables.py
@@ -12,6 +12,7 @@
 PLDM_TYPE_BIOS = {'VALUE': '03', 'STRING': 'bios'}
 PLDM_TYPE_FRU = {'VALUE': '04', 'STRING': 'fru'}
 PLDM_TYPE_OEM = {'VALUE': '63', 'STRING': 'oem-ibm'}
+PLDM_SUPPORTED_TYPES = ['0(base)', '2(platform)', '3(bios)', '4(fru)', '63(oem-ibm)']
 
 VERSION_BASE = {'VALUE': ['f1', 'f0', 'f0', '00'], 'STRING': '1.0.0'}
 VERSION_PLATFORM = {'VALUE': ['f1', 'f2', 'f0', '00'], 'STRING': '1.2.0'}
@@ -92,64 +93,106 @@
 #      Only record handle 0, 1, 2 are supported as of now.
 
 RESPONSE_DICT_GETPDR_SETSTATEEFFECTER = {
-    'responsecount': ['29', '30'],
-    'pdrheaderversion': ['1'],
-    'pdrtype': ['State Effecter PDR(11)'],
-    'recordchangenumber': ['0'],
-    'datalength': ['19', '20'],
-    'pldmterminushandle': ['0'],
-    'effecterid': ['1', '2', '3'],
-    'entitytype': ['33', '45', '31'],
-    'entityinstancenumber': ['0'],
-    'containerid': ['0'],
-    'effectersemanticid': ['0'],
-    'effecterinit': ['0'],
-    'effecterdescriptionpdr': ['false'],
-    'compositeeffectercount': ['1'],
-    'statesetid': ['Boot Progress(196)',
-                   'System Power State(260)', 'Software Termination Status(129)'],
-    'possiblestatessize': ['1', '2'],
-    'possiblestates': ['6', '0', '64']}
+    'PDRHeaderVersion': [1],
+    'PDRType': ['State Effecter PDR'],
+    'recordChangeNumber': [0],
+    'PLDMTerminusHandle': [0, 1, 2],
+    'effecterID': [0, 1, 2, 3, 4],
+    'entityType': ['Virtual Machine Manager', 'System chassis (main enclosure)',
+                   'System Firmware', 'Processor Module', '32801(OEM)'],
+    'entityInstanceNumber': [0, 1],
+    'containerID': [0, 1],
+    'effecterSemanticID': [0],
+    'effecterInit': ['noInit'],
+    'effecterDescriptionPDR': [False],
+    'compositeEffecterCount': [1],
+    'stateSetID': ['Boot Progress(196)',
+                   'System Power State(260)', 'Software Termination Status(129)',
+                   'Boot/Restart Cause(192)']}
 
 RESPONSE_DICT_GETPDR_FRURECORDSETIDENTIFIER = {
-    'responsecount': ['20'],
-    'pdrheaderversion': ['1'],
-    'pdrtype': ['FRU Record Set PDR(20)'],
-    'recordchangenumber': ['0'],
-    'datalength': ['10'],
-    'pldmterminushandle': ['0', '2'],
-    'entitytype': ['System Board', 'Chassis front panel board (control panel)',
+    'PDRHeaderVersion': [1],
+    'PDRType': ['FRU Record Set PDR'],
+    'recordChangeNumber': [0],
+    'dataLength': [10],
+    'PLDMTerminusHandle': [0, 2],
+    'entityType': ['System Board', 'Chassis front panel board (control panel)',
                    'Management Controller', 'OEM', 'Power converter',
                    'System (logical)', 'System chassis (main enclosure)',
                    'Chassis front panel board (control panel)',
-                   'Processor Module', 'Memory Module', 'Power Supply'],
-    'containerid': ['0', '1', '2', '3']}
+                   'Processor Module', 'Memory Module', 'Power Supply',
+                   '24576(OEM)'],
+    'containerID': [0, 1, 2, 3]}
 
 RESPONSE_DICT_GETPDR_PDRENTITYASSOCIATION = {
-    'pdrheaderversion': ['1'],
-    'pdrtype': ['Entity Association PDR(15)'],
-    'recordchangenumber': ['0'],
-    'containerid': ['1', '2', '3'],
+    'PDRHeaderVersion': [1],
+    'PDRType': ['Entity Association PDR'],
+    'recordChangeNumber': [0],
+    'containerID': [1, 2, 3],
     'associationtype': ['Physical'],
-    'containerentitytype': ['System Board', 'System (logical)',
-                            'System chassis (main enclosure)']
-}
+    'containerentityType': ['System Board', 'System (logical)',
+                            'System chassis (main enclosure)']}
 
 RESPONSE_DICT_GETPDR_STATESENSORPDR = {
-    'entitytype': ['Communication Channel', 'Connector', 'Processor Module'],
-    'sensorinit': ['noInit'],
-    'sensorauxiliarynamespdr': ['false'],
-    'statesetid': ['Availability(2)', 'Configuration State(15)',
-                   'Operational Running Status(11)']
-}
+    'entityType': ['Communication Channel', 'Connector', 'Processor Module',
+                   '32774(OEM)', '57346(OEM)', '57347(OEM)', '32801(OEM)'],
+    'sensorInit': ['noInit'],
+    'sensorAuxiliaryNamesPDR': [False],
+    'stateSetID': ['Availability(2)', 'Configuration State(15)',
+                   'Operational Running Status(11)', 'Software Termination Status(129)']}
+
+RESPONSE_DICT_GETPDR_TERMINUSLOCATORPDR = {
+    'PDRHeaderVersion': [1],
+    'PDRType': ['Terminus Locator PDR'],
+    'recordChangeNumber': [0],
+    'PLDMTerminusHandle': [1],
+    'validity': ['valid'],
+    'TID': [1, 208],
+    'containerID': [0, 1],
+    'terminusLocatorType': ['MCTP_EID'],
+    'terminusLocatorValueSize': [1]}
+
+RESPONSE_DICT_GETPDR_NUMERICEFFECTERPDR = {
+    'PDRHeaderVersion': [1],
+    'PDRType': ['Numeric Effecter PDR'],
+    'recordChangeNumber': [0],
+    'PLDMTerminusHandle': [0, 1],
+    'entityInstanceNumber': [0, 1],
+    'containerID': [0],
+    'effecterSemanticID': [0],
+    'effecterInit': [0],
+    'effecterAuxiliaryNames': [False],
+    'baseUnit': [0, 72],
+    'unitModifier': [0],
+    'rateUnit': [0],
+    'baseOEMUnitHandle': [0],
+    'auxUnit': [0],
+    'auxUnitModifier': [0],
+    'auxrateUnit': [0],
+    'auxOEMUnitHandle': [0],
+    'resolution': [1, 0],
+    'offset': [0],
+    'accuracy': [0],
+    'plusTolerance': [0],
+    'minusTolerance': [0],
+    'stateTransitionInterval': [0],
+    'TransitionInterval': [0],
+    'minSettable': [0],
+    'rangeFieldSupport': [0],
+    'nominalValue': [0],
+    'normalMax': [0],
+    'normalMin': [0],
+    'ratedMax': [0],
+    'ratedMin': [0]}
 
 PLDM_PDR_TYPES = {
-    'PLDM_STATE_EFFECTER_PDR': 'State Effecter PDR(11)',
-    'PLDM_PDR_FRU_RECORD_SET': 'FRU Record Set PDR(20)',
-    'PLDM_PDR_ENTITY_ASSOCIATION': 'Entity Association PDR(15)',
-    'PLDM_STATE_SENSOR_PDR': 'State Sensor PDR(4)',
-    'PLDM_NUMERIC_EFFECTER_PDR': 'Numeric Effecter PDR(9)',
-    'PLDM_TERMINUS_LOCATOR_PDR': 'Terminus Locator PDR(1)'}
+    'PLDM_STATE_EFFECTER_PDR': 'State Effecter PDR',
+    'PLDM_PDR_FRU_RECORD_SET': 'FRU Record Set PDR',
+    'PLDM_PDR_ENTITY_ASSOCIATION': 'Entity Association PDR',
+    'PLDM_STATE_SENSOR_PDR': 'State Sensor PDR',
+    'PLDM_NUMERIC_EFFECTER_PDR': 'Numeric Effecter PDR',
+    'PLDM_TERMINUS_LOCATOR_PDR': 'Terminus Locator PDR',
+    'PLDM_COMPACT_NUMERIC_SENSOR_PDR': '21'}
 
 RESPONSE_LIST_GETBIOSTABLE_STRTABLE = [
     'Allowed', 'Disabled', 'Enabled', 'IPv4DHCP', 'IPv4Static', 'Not Allowed',
@@ -158,3 +201,14 @@
     'vmi-if-count', 'vmi-if0-ipv4-ipaddr', 'vmi-if0-ipv4-method',
     'vmi-if0-ipv4-prefix-length', 'vmi-if1-ipv4-ipaddr', 'vmi-if1-ipv4-method',
     'vmi-if1-ipv4-prefix-length', 'vmi-ipv4-gateway']
+
+
+RESPONSE_LIST_GETBIOSTABLE_ATTRTABLE = [
+    'pvm-fw-boot-side', 'pvm-inband-code-update', 'pvm-os-boot-side',
+    'pvm-pcie-error-inject', 'pvm-surveillance', 'pvm-system-name', 'vmi-hostname',
+    'vmi-if-count', 'vmi-if0-ipv4-ipaddr', 'vmi-if0-ipv4-method',
+    'vmi-if0-ipv4-prefix-length', 'vmi-if1-ipv4-ipaddr', 'vmi-if1-ipv4-method',
+    'vmi-if1-ipv4-prefix-length', 'vmi-ipv4-gateway']
+
+RESPONSE_LIST_GETBIOSTABLE_ATTRVALTABLE = [
+    'BIOSString', 'BIOSInteger', 'BIOSEnumeration']
diff --git a/lib/pldm_utils.py b/lib/pldm_utils.py
index ea41125..9008d57 100644
--- a/lib/pldm_utils.py
+++ b/lib/pldm_utils.py
@@ -8,9 +8,10 @@
 import var_funcs as vf
 import func_args as fa
 import bmc_ssh_utils as bsu
+import json
 
 
-def pldmtool(option_string, parse_results=1, **bsu_options):
+def pldmtool(option_string, **bsu_options):
     r"""
     Run pldmtool on the BMC with the caller's option string and return the result.
 
@@ -20,15 +21,15 @@
     Rprint Vars  pldm_results
 
     pldm_results:
-      [supported_types]:
-        [raw]:
-          [0]:                                        0
-          [1]:                                        2
-          [2]:                                        3
-        [text]:
-          [0]:                                        base
-          [1]:                                        platform
-          [2]:                                        bios
+      pldmtool base GetPLDMVersion -t 0
+      {
+          "Response": "1.0.0"
+      }
+
+     pldmtool base GetTID
+     {
+         "Response": 1
+     }
 
     Description of argument(s):
     option_string                   A string of options which are to be processed by the pldmtool command.
@@ -42,92 +43,4 @@
     bsu_options = fa.args_to_objects(bsu_options)
 
     stdout, stderr, rc = bsu.bmc_execute_command('pldmtool ' + option_string, **bsu_options)
-
-    if parse_results:
-        result = vf.key_value_outbuf_to_dict(stdout)
-        if 'supported_types' in result:
-            # 'supported types' begins like this:
-            # 0(base) 2(platform) 3(bios)
-            # Parsing it to look like it does in the example above.
-            supported_types = {'raw': [], 'text': []}
-            for entry in result['supported_types'].split(" "):
-                record = entry.split("(")
-                supported_types['raw'].append(record[0])
-                supported_types['text'].append(record[1].rstrip(")"))
-            result['supported_types'] = supported_types
-
-        elif 'supported_commands' in result:
-            commands = result['supported_commands'].split(":")[0].split(" ")
-            return commands
-
-        elif 'yyyy-mm-dd_hh' in result:
-            # Date & Time :
-            # YYYY-MM-DD HH:MM:SS - 2020-02-24 06:44:16
-            return result['yyyy-mm-dd_hh'].split(' - ')[1]
-
-        # Simplfying dict output for GetPDR with type PDREntityAssociation.
-        # Example :
-
-        # pldmtool platform GetPDR -d 10
-        # Entity Association
-        # nextRecordHandle: 0
-        # responseCount: 56
-        # recordHandle: 10
-        # PDRHeaderVersion: 1
-        # PDRType: 15
-        # recordChangeNumber: 0
-        # dataLength: 46
-        # containerID: 1
-        # associationType: Physical
-        # containerEntityType: System Board
-        # containerEntityInstanceNumber: 1
-        # containerEntityContainerID: 0
-        # containedEntityCount: 6
-        # containedEntityType[1]: Chassis front panel board (control panel)
-        # containedEntityInstanceNumber[1]: 1
-        # containedEntityContainerID[1]: 1
-        # containedEntityType[2]: Chassis front panel board (control panel)
-        # containedEntityInstanceNumber[2]: 2
-        # containedEntityContainerID[2]: 1
-        elif 'containerentitycontainerid' in result:
-            dict_data1, dict_data2 = vf.split_dict_on_key('containerentitycontainerid', result)
-            return dict_data1
-
-        elif 'entitytype' in result:
-            # Example :
-            # entityType: 24576(OEM)
-            # Note: OEM type number is dynamic
-            if 'OEM' in result['entitytype']:
-                result['entitytype'] = 'OEM'
-
-        # Collect bios strings from bios string table in to list.
-        # Example output for pldmtool GetBIOSTable --type stringTable
-        # PLDM StringTable:
-        # BIOSStringHandle : BIOSString
-        # 0 : Allowed
-        # 1 : Disabled
-        # 2 : Enabled
-        elif 'pldm_stringtable' in result:
-            result.pop('pldm_stringtable')
-            result.pop('biosstringhandle')
-            bios_string_list = []
-            for data in result:
-                bios_string_list.append(result[data])
-            # Example for bios_string_list:
-            # bios_string_list = ['Allowed', 'Disabled', 'Enabled']
-            return bios_string_list
-
-        # Check if parameter pldm_attributetable/pldm_attributevaluetable present for
-        # pldmtool GetBIOSTable --type AttributeTable/AttributeValueTable.
-        # Note: Output for AttributeTable/AttributeValueTable is huge and verification of
-        #       table content is not available.
-        elif 'pldm_attributetable' in result:
-            result['pldm_attributetable'] = True
-            return result
-        elif 'pldm_attributevaluetable' in result:
-            result['pldm_attributevaluetable'] = True
-            return result
-
-        return result
-
-    return stdout
+    return json.loads(stdout)
diff --git a/pldm/test_pldm_base.robot b/pldm/test_pldm_base.robot
index 0b6bbeb..a23b5b8 100644
--- a/pldm/test_pldm_base.robot
+++ b/pldm/test_pldm_base.robot
@@ -8,15 +8,19 @@
 Test Setup       Printn
 Test Teardown    FFDC On Test Case Fail
 
-
 *** Test Cases ***
-
 Verify Get PLDM Types
     [Documentation]  Verify supported PLDM types.
     [Tags]  Verify_Get_PLDM_Types
 
     ${pldm_output}=  Pldmtool  base GetPLDMTypes
-    Valid List  pldm_output['supported_types']['text']  required_values=${PLDM_SUPPORTED_TYPES}
+    ${count}=  Get Length  ${pldm_output}
+    ${cmd_list}=  Create List
+    FOR  ${i}  IN RANGE  ${count}
+      ${cmd}=  Catenate  ${pldm_output}[${i}][PLDM Type Code](${pldm_output}[${i}][PLDM Type])
+      Append To List  ${cmd_list}  ${cmd}
+    END
+    Valid List  cmd_list  required_values=${PLDM_SUPPORTED_TYPES}
 
 Verify Get PLDM Version For Base
     [Documentation]  Verify supported PLDM version for base type.
@@ -24,8 +28,7 @@
 
     ${pldm_cmd}=  Evaluate  $CMD_GETPLDMVERSION % 'base'
     ${pldm_output}=  Pldmtool  ${pldm_cmd}
-    Valid Value  pldm_output['type_0(base)']  ['${VERSION_BASE['STRING']}']
-
+    Valid Value  pldm_output['Response']  ['${VERSION_BASE['STRING']}']
 
 Verify Get PLDM Version For Platform
     [Documentation]  Verify supported PLDM version for platform type.
@@ -33,7 +36,7 @@
 
     ${pldm_cmd}=  Evaluate  $CMD_GETPLDMVERSION % 'platform'
     ${pldm_output}=  Pldmtool  ${pldm_cmd}
-    Valid Value  pldm_output['type_2(platform)']  ['${VERSION_PLATFORM['STRING']}']
+    Valid Value  pldm_output['Response']  ['${VERSION_PLATFORM['STRING']}']
 
 
 Verify Get PLDM Version For BIOS
@@ -42,7 +45,7 @@
 
     ${pldm_cmd}=  Evaluate  $CMD_GETPLDMVERSION % 'bios'
     ${pldm_output}=  Pldmtool  ${pldm_cmd}
-    Valid Value  pldm_output['type_3(bios)']  ['${VERSION_BIOS['STRING']}']
+    Valid Value  pldm_output['Response']  ['${VERSION_BIOS['STRING']}']
 
 
 Verify Get PLDM Version For FRU
@@ -51,7 +54,7 @@
 
     ${pldm_cmd}=  Evaluate  $CMD_GETPLDMVERSION % 'fru'
     ${pldm_output}=  Pldmtool  ${pldm_cmd}
-    Valid Value  pldm_output['type_4(fru)']  ['${VERSION_FRU['STRING']}']
+    Valid Value  pldm_output['Response']  ['${VERSION_FRU['STRING']}']
 
 
 Verify Get PLDM Version For OEM
@@ -60,7 +63,7 @@
 
     ${pldm_cmd}=  Evaluate  $CMD_GETPLDMVERSION % 'oem-ibm'
     ${pldm_output}=  Pldmtool  ${pldm_cmd}
-    Valid Value  pldm_output['type_63(oem-ibm)']  ['${VERSION_OEM['STRING']}']
+    Valid Value  pldm_output['Response']  ['${VERSION_OEM['STRING']}']
 
 
 Verify GetTID
@@ -68,12 +71,12 @@
     [Tags]  Verify_GetTID
 
     # Example output:
-    # TID : 1
+    # {
+    #     'Response' : 1
+    # }
 
     ${pldm_output}=  Pldmtool  base GetTID
-    Rprint Vars  pldm_output
-
-    Valid Dict  pldm_output  valid_values={'tid': ['1']}
+    Valid Value  pldm_output['Response']  [1]
 
 Verify GetPLDMCommands
     [Documentation]  Verify GetPLDMCommands response message.
@@ -104,5 +107,10 @@
     # Supported Commands : 2(GetTID) 3(GetPLDMVersion) 4(GetPLDMTypes) 5(GetPLDMCommands)
 
     ${pldm_output}=  Pldmtool  base GetPLDMCommands -t ${pldm_type}
-    Rprint Vars  pldm_output
-    Valid List  pldm_output  ${expected_pldm_cmds}
+    ${count}=  Get Length  ${pldm_output}
+    ${cmd_list}=  Create List
+    FOR  ${i}  IN RANGE  ${count}
+      ${cmd}=  Catenate  ${pldm_output}[${i}][PLDM Command Code](${pldm_output}[${i}][PLDM Command])
+      Append To List  ${cmd_list}  ${cmd}
+    END
+    Valid List  cmd_list  required_values=${expected_pldm_cmds}
diff --git a/pldm/test_pldm_bios.robot b/pldm/test_pldm_bios.robot
index 1e3533d..adf6c84 100644
--- a/pldm/test_pldm_bios.robot
+++ b/pldm/test_pldm_bios.robot
@@ -19,26 +19,37 @@
     [Tags]  Verify_GetDateTime
 
     # Example output:
-    # YYYY-MM-DD HH:MM:SS - 09-02-2020 16:51:23
+    # {
+    #     "Response": "2020-11-07 07:10:10"
+    # }
 
     ${pldm_output}=  Pldmtool  bios GetDateTime
-    @{date_time}=  Split String  ${pldm_output}  ${SPACE}
+    @{date_time}=  Split String  ${pldm_output['Response']}  ${SPACE}
     @{time}=  Split String  ${date_time}[1]  :
 
     # verify date & time.
-    ${current_date_time}=  Get Current Date  UTC  exclude_millis=True
-    Should Contain  ${current_date_time}  ${date_time[0]}
-    Should Contain  ${current_date_time}  ${time[0]}
+    ${utc}=  Get Current Date  UTC  exclude_millis=True
+    @{current_dmy}=  Split String  ${utc}  ${SPACE}
+    @{current_time}=  Split String  ${current_dmy[1]}  :
 
+    # Example output:
+    # 2020-11-25 07:34:30
+
+    Should Contain  ${current_dmy[0]}  ${date_time[0]}
+    Should Contain  ${current_time[0]}  ${time[0]}
 
 Verify SetDateTime
     [Documentation]  Verify set date & time for the host.
     [Tags]  Verify_SetDateTime
 
     # Example output:
-    # SetDateTime: SUCCESS
+    # {
+    #     "Response": "SUCCESS"
+    # }
 
     ${current_date_time}=  Get Current Date  UTC  exclude_millis=True
+    # Example output:
+    # 2020-11-25 07:34:30
 
     ${date}=  Add Time To Date  ${current_date_time}  400 days  exclude_millis=True
     ${upgrade_date}=  Evaluate  re.sub(r'-* *:*', "", '${date}')  modules=re
@@ -49,13 +60,11 @@
     # Set date.
     ${cmd_set_date}=  Evaluate  $CMD_SETDATETIME % '${upgrade_date}'
     ${pldm_output}=  Pldmtool  ${cmd_set_date}
-    Valid Value  pldm_output['setdatetime']  ['SUCCESS']
+    Valid Value  pldm_output['Response']  ['SUCCESS']
 
     # Set time.
     ${cmd_set_time}=  Evaluate  $CMD_SETDATETIME % '${upgrade_time}'
     ${pldm_output}=  Pldmtool  ${cmd_set_time}
-    Valid Value  pldm_output['setdatetime']  ['SUCCESS']
-
 
 Verify GetBIOSTable For StringTable
     [Documentation]  Verify GetBIOSTable for table type string table.
@@ -78,7 +87,13 @@
     # [12]:                                           vmi-if-count
 
     ${pldm_output}=  Pldmtool  bios GetBIOSTable --type StringTable
-    Valid List  pldm_output  required_values=${RESPONSE_LIST_GETBIOSTABLE_STRTABLE}
+    @{keys}=  Get Dictionary Keys  ${pldm_output}
+    ${string_list}=  Create List
+    FOR  ${key}  IN  @{keys}
+        Append To List  ${string_list}  ${pldm_output['${key}']}
+    END
+    Log To Console  ${string_list}
+    Valid List  string_list  required_values=${RESPONSE_LIST_GETBIOSTABLE_STRTABLE}
 
 
 Verify GetBIOSTable For AttributeTable
@@ -97,9 +112,14 @@
     # [     defaultstringlength]:                      15
 
     ${pldm_output}=  Pldmtool  bios GetBIOSTable --type AttributeTable
-    Rprint Vars  pldm_output
-    Valid Value  pldm_output['pldm_attributetable']  [True]
-
+    ${count}=  Get Length  ${pldm_output}
+    ${attr_list}=  Create List
+    FOR  ${i}  IN RANGE  ${count}
+        ${data}=  Set Variable  ${pldm_output}[${i}][AttributeNameHandle]
+        ${sub_string}=  Get Substring  ${data}  3  -1
+        Append To List  ${attr_list}  ${sub_string}
+    END
+    Valid List  attr_list  required_values=${RESPONSE_LIST_GETBIOSTABLE_ATTRTABLE}
 
 Verify GetBIOSTable For AttributeValueTable
     [Documentation]  Verify if attribute value table content exist for
@@ -113,9 +133,12 @@
     # [     currentstringlength]:                     15
 
     ${pldm_output}=  Pldmtool  bios GetBIOSTable --type AttributeValueTable
-    Log To Console  ${pldm_output}
-    Rprint Vars  pldm_output
-    Valid Value  pldm_output['pldm_attributevaluetable']  [True]
+    ${count}=  Get Length  ${pldm_output}
+    ${attr_val_list}=  Create List
+    FOR  ${i}  IN RANGE  ${count}
+        Append To List  ${attr_val_list}  ${pldm_output}[${i}][AttributeType]
+    END
+    Valid List  attr_val_list  required_values=${RESPONSE_LIST_GETBIOSTABLE_ATTRVALTABLE}
 
 *** Keywords ***
 
@@ -126,4 +149,4 @@
     ${current_date_time}=  Evaluate  re.sub(r'-* *:*', "", '${result}')  modules=re
     ${cmd_set_date_time}=  Evaluate  $CMD_SETDATETIME % '${current_date_time}'
     ${pldm_output}=  Pldmtool  ${cmd_set_date_time}
-    Valid Value  pldm_output['setdatetime']  ['SUCCESS']
+    Valid Value  pldm_output['Response']  ['SUCCESS']
diff --git a/pldm/test_pldm_fru.robot b/pldm/test_pldm_fru.robot
index ace9db5..0e6d7c6 100644
--- a/pldm/test_pldm_fru.robot
+++ b/pldm/test_pldm_fru.robot
@@ -26,12 +26,12 @@
     ${pldm_output}=  Pldmtool  fru GetFruRecordTableMetadata
     Rprint Vars  pldm_output
 
-    Valid Value  pldm_output['frudatamajorversion']  ['1']
-    Valid Value  pldm_output['frudataminorversion']  ['0']
-    Valid Value  pldm_output['frutablemaximumsize']  ['4294967295']
-    Valid Range  ${pldm_output['frutablelength']}  1
-    Valid Range  ${pldm_output['total_number_of_records_in_table']}  1
-    Valid Range  ${pldm_output['total_number_of_record_set_identifiers_in_table']}  1
+    Valid Value  pldm_output['FRUDATAMajorVersion']  [1]
+    Valid Value  pldm_output['FRUDATAMinorVersion']  [0]
+    Valid Value  pldm_output['FRUTableMaximumSize']  [4294967295]
+    Valid Range  pldm_output['FRUTableLength']  1
+    Valid Range  pldm_output['Total number of records in table']  1
+    Valid Range  pldm_output['Total number of Record Set Identifiers in table']  1
 
 Verify GetFruRecordTable
     [Documentation]  Verify GetFruRecordTable response message.
@@ -56,7 +56,7 @@
     # [     fru_field_value]:                             BMC PLANAR
 
     ${pldm_output}=  Pldmtool  fru GetFruRecordTableMetadata
-    ${fru_rec_id}=  Convert To Integer  ${pldm_output['total_number_of_record_set_identifiers_in_table']}
+    ${fru_rec_id}=  Convert To Integer  ${pldm_output['Total number of Record Set Identifiers in table']}
     FOR   ${i}  IN RANGE  ${fru_rec_id+1}
        ${pldm_output}=  Run Keyword  Pldmtool  fru GetFRURecordByOption -i ${i} -r 0 -f 0
        Run Keyword  Rprint Vars  pldm_output
diff --git a/pldm/test_pldm_oem.robot b/pldm/test_pldm_oem.robot
index 005ed3d..112f8a5 100644
--- a/pldm/test_pldm_oem.robot
+++ b/pldm/test_pldm_oem.robot
@@ -18,6 +18,6 @@
 
     ${pldm_output}=  Pldmtool  oem-ibm GetAlertStatus -i 0
     Rprint Vars  pldm_output
-    Valid Value  pldm_output['rack_entry']  ['0xff000030']
-    Valid Value  pldm_output['pri_cec_node']  ['0x00008030']
+    Valid Value  pldm_output['rack entry']  ['0xff000030']
+    Valid Value  pldm_output['pri cec node']  ['0x00008030']
 
diff --git a/pldm/test_pldm_platform.robot b/pldm/test_pldm_platform.robot
index d549bbd..f9e3a99 100644
--- a/pldm/test_pldm_platform.robot
+++ b/pldm/test_pldm_platform.robot
@@ -26,7 +26,6 @@
        ${record_handle}=  Set Variable  ${next_record_handle}
     END
 
-
 Verify SetStateEffecterStates
     [Documentation]  Verify set state effecter states response message.
     [Tags]  Verify_SetStateEffecterStates
@@ -76,33 +75,31 @@
     ${pldm_output}=  Pldmtool  ${pldm_cmd}
     Rprint Vars  pldm_output
 
-    # Note: Output of GetPDR type 'PLDM_NUMERIC_EFFECTER_PDR' has dynamic content
-    #       hence just checking pdrtype only
-    #       GetPDR type 'PLDM_STATE_SENSOR_PDR' Dev implementation is still in progress
-    #       TODO: Verify output of GetPDR type 'PLDM_STATE_SENSOR_PDR'
+    Run Keyword If  '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_STATE_EFFECTER_PDR']}'
+    ...  Valid Dict  pldm_output  valid_values=${RESPONSE_DICT_GETPDR_SETSTATEEFFECTER}
 
-    Run Keyword If  '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_STATE_EFFECTER_PDR']}'
-    ...  Log To Console  "Found PDR Type - PLDM_STATE_EFFECTER_PDR"
-
-    ...  ELSE IF  '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_PDR_FRU_RECORD_SET']}'
+    ...  ELSE IF  '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_PDR_FRU_RECORD_SET']}'
     ...  Valid Dict  pldm_output  valid_values=${RESPONSE_DICT_GETPDR_FRURECORDSETIDENTIFIER}
 
-    ...  ELSE IF  '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_PDR_ENTITY_ASSOCIATION']}'
-    ...  Valid Dict  pldm_output  valid_values=${RESPONSE_DICT_GETPDR_PDRENTITYASSOCIATION}
+    ...  ELSE IF  '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_PDR_ENTITY_ASSOCIATION']}'
+    ...  Log To Console  "Found PDR Type - PLDM_ENTITY_ASSOCIATION_PDR"
 
-    ...  ELSE IF  '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_STATE_SENSOR_PDR']}'
+    ...  ELSE IF  '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_STATE_SENSOR_PDR']}'
     ...  Valid Dict  pldm_output  valid_values=${RESPONSE_DICT_GETPDR_STATESENSORPDR}
 
-    ...  ELSE IF  '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_NUMERIC_EFFECTER_PDR']}'
-    ...  Log To Console  "Found PDR Type - PLDM_NUMERIC_EFFECTER_PDR"
+    ...  ELSE IF  '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_NUMERIC_EFFECTER_PDR']}'
+    ...  Valid Dict  pldm_output  valid_values=${RESPONSE_DICT_GETPDR_NUMERICEFFECTERPDR}
 
-    ...  ELSE IF  '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_TERMINUS_LOCATOR_PDR']}'
-    ...  Log To Console  "Found PDR Type - PLDM_TERMINUS_LOCATOR_PDR"
+    ...  ELSE IF  '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_TERMINUS_LOCATOR_PDR']}'
+    ...  Valid Dict  pldm_output  valid_values=${RESPONSE_DICT_GETPDR_TERMINUSLOCATORPDR}
+
+    ...  ELSE IF  '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_COMPACT_NUMERIC_SENSOR_PDR']}'
+    ...  Log To Console  "Found PDR Type - PLDM_COMPACT_NUMERIC_SENSOR_PDR'
 
     ...  ELSE  Fail  msg="Unknown PDR Type is received"
 
-    Should be equal as strings  ${pldm_output['recordhandle']}  ${record_handle}
-    [Return]  ${pldm_output['nextrecordhandle']}
+    Should be equal as strings  ${pldm_output['recordHandle']}  ${record_handle}
+    [Return]  ${pldm_output['nextRecordHandle']}
 
 Verify SetStateEffecterStates For Effecter States
     [Documentation]  Verify set state effecter states for given input effecter states.
@@ -117,12 +114,14 @@
     #                      e.g. '1 1'.
 
     # Example output:
-    # [SetStateEffecterStates ]: SUCCESS
+    # {
+    #     "Response": "SUCCESS"
+    # }
 
     ${pldm_cmd}=  Evaluate  $CMD_SETSTATEEFFECTERSTATES % (${effecter_handle}, ${count}, ${effecter_states})
     ${pldm_output}=  Pldmtool  ${pldm_cmd}
     Rprint Vars  pldm_output
-    Valid Value  pldm_output['setstateeffecterstates']  ['SUCCESS']
+    Valid Value  pldm_output['Response']  ['SUCCESS']
 
 Pldmtool Platform Suite Cleanup
     [Documentation]    Reset BMC at suite cleanup.