Add state sensor configuration to the sensor_pdr.json

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I239d482f95a66be711952e628ef0b0f27f78bdd7
diff --git a/libpldmresponder/examples/pdr/sensor_pdr.json b/libpldmresponder/examples/pdr/sensor_pdr.json
new file mode 100644
index 0000000..5b53580
--- /dev/null
+++ b/libpldmresponder/examples/pdr/sensor_pdr.json
@@ -0,0 +1,64 @@
+# This JSON is tied with BMC's PDRs. Each entry is used to identify a group of
+# composite sensors.
+{
+  "sensorPDRs": [
+    {
+      # StateSensorPDR
+      # Each sensor in each group of composite sensors has a separate entry and the
+      # supported event states, up to eight.
+      # The "dbus" section contains information about the corresponding D-Bus
+      # property for the sensor and "property_values" are the D-Bus property values
+      # for each corresponding entry in the "states".
+      "pdrType": 4,
+      "entries": [
+        {
+          "type": 5,
+          "instance": 0,
+          "container": 0,
+          "sensors": [
+            {
+              "set": {
+                "id": 1,
+                "size": 1,
+                "states": [
+                  0,
+                  5
+                ]
+              },
+              "dbus": {
+                "path": "/foo/bar",
+                "interface": "xyz.openbmc_project.Foo.Bar",
+                "property_name": "propertyName",
+                "property_type": "string",
+                "property_values": [
+                  "xyz.openbmc_project.Foo.Bar.V0",
+                  "xyz.openbmc_project.Foo.Bar.V5"
+                ]
+              }
+            },
+            {
+              "set": {
+                "id": 2,
+                "size": 1,
+                "states": [
+                  2,
+                  3
+                ]
+              },
+              "dbus": {
+                "path": "/foo/bar",
+                "interface": "xyz.openbmc_project.Foo.Bar",
+                "property_name": "propertyName",
+                "property_type": "string",
+                "property_values": [
+                  "xyz.openbmc_project.Foo.Bar.V2",
+                  "xyz.openbmc_project.Foo.Bar.V3"
+                ]
+              }
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file
diff --git a/test/pdr_jsons/state_sensor/good/sensor_pdr.json b/test/pdr_jsons/state_sensor/good/sensor_pdr.json
new file mode 100644
index 0000000..5e1141a
--- /dev/null
+++ b/test/pdr_jsons/state_sensor/good/sensor_pdr.json
@@ -0,0 +1,36 @@
+{
+  "sensorPDRs": [
+    {
+      "pdrType": 4,
+      "entries": [
+        {
+          "type": 5,
+          "instance": 0,
+          "container": 0,
+          "sensors": [
+            {
+              "set": {
+                "id": 1,
+                "size": 1,
+                "states": [
+                  0,
+                  5
+                ]
+              },
+              "dbus": {
+                "path": "/foo/bar",
+                "interface": "xyz.openbmc_project.Foo.Bar",
+                "property_name": "propertyName",
+                "property_type": "string",
+                "property_values": [
+                  "xyz.openbmc_project.Foo.Bar.V0",
+                  "xyz.openbmc_project.Foo.Bar.V5"
+                ]
+              }
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file
diff --git a/test/pdr_jsons/state_sensor/malformed/sensor_pdr.json b/test/pdr_jsons/state_sensor/malformed/sensor_pdr.json
new file mode 100644
index 0000000..6d5a941
--- /dev/null
+++ b/test/pdr_jsons/state_sensor/malformed/sensor_pdr.json
@@ -0,0 +1,44 @@
+# This JSON is tied with BMC's PDRs. Each entry is used to identify a group of
+# composite sensors.
+{
+  "sensorPDRs": [
+    {
+      # StateSensorPDR
+      # Each sensor in each group of composite sensors has a separate entry and the
+      # supported event states, up to eight.
+      # The "dbus" section contains information about the corresponding D-Bus
+      # property for the sensor and "property_values" are the D-Bus property values
+      # for each corresponding entry in the "states".
+      "pdrType": 4
+      "entries": [
+        {
+          "type": 5,
+          "instance": 0,
+          "container": 0,
+          "sensors": [
+            {
+              "set": {
+                "id": 1,
+                "size": 1,
+                "states": [
+                  0,
+                  5
+                ]
+              },
+              "dbus": {
+                "path": "/foo/bar",
+                "interface": "xyz.openbmc_project.Foo.Bar",
+                "property_name": "propertyName",
+                "property_type": "string",
+                "property_values": [
+                  "xyz.openbmc_project.Foo.Bar.V0",
+                  "xyz.openbmc_project.Foo.Bar.V5"
+                ]
+              }
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file