pldm: Add bios configuration in single json file
Currently bios attributes are added in three json configuration
files based on the attribute type(integer, string, enum).
Combining all the attributes in single bios attribute json file
to organize the attributes based on the usage pattern.
Tested:
BMC powered on successfully
Unit tests passed
Change-Id: I42cc7c2394918e48d27dca2041f8ce00509c565a
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/libpldmresponder/test/bios_jsons/bios_attrs.json b/libpldmresponder/test/bios_jsons/bios_attrs.json
new file mode 100644
index 0000000..f02b788
--- /dev/null
+++ b/libpldmresponder/test/bios_jsons/bios_attrs.json
@@ -0,0 +1,151 @@
+{
+ "entries": [
+ {
+ "attribute_type": "enum",
+ "attribute_name": "HMCManagedState",
+ "possible_values": ["On", "Off"],
+ "default_values": ["On"],
+ "readOnly": false,
+ "helpText": "HMCManagedState HelpText",
+ "displayName": "HMCManagedState DisplayName",
+ "dbus": {
+ "object_path": "/xyz/abc/def",
+ "interface": "xyz.openbmc_project.HMCManaged.State",
+ "property_name": "State",
+ "property_type": "string",
+ "property_values": [
+ "xyz.openbmc_project.State.On",
+ "xyz.openbmc_project.State.Off"
+ ]
+ }
+ },
+ {
+ "attribute_type": "enum",
+ "attribute_name": "FWBootSide",
+ "possible_values": ["Perm", "Temp"],
+ "default_values": ["Perm"],
+ "readOnly": false,
+ "helpText": "FWBootSide HelpText",
+ "displayName": "FWBootSide DisplayName",
+ "dbus": {
+ "object_path": "/xyz/abc/def",
+ "interface": "xyz.openbmc.FWBoot.Side",
+ "property_name": "Side",
+ "property_type": "bool",
+ "property_values": [true, false]
+ }
+ },
+ {
+ "attribute_type": "enum",
+ "attribute_name": "InbandCodeUpdate",
+ "possible_values": ["Allowed", "NotAllowed"],
+ "default_values": ["Allowed"],
+ "readOnly": false,
+ "helpText": "InbandCodeUpdate HelpText",
+ "displayName": "InbandCodeUpdate DisplayName",
+ "dbus": {
+ "object_path": "/xyz/abc/def",
+ "interface": "xyz.openbmc.InBandCodeUpdate",
+ "property_name": "Policy",
+ "property_type": "uint8_t",
+ "property_values": [0, 1]
+ }
+ },
+ {
+ "attribute_type": "enum",
+ "attribute_name": "CodeUpdatePolicy",
+ "possible_values": ["Concurrent", "Disruptive"],
+ "default_values": ["Concurrent"],
+ "readOnly": true,
+ "helpText": "CodeUpdatePolicy HelpText",
+ "displayName": "CodeUpdatePolicy DisplayName"
+ },
+ {
+ "attribute_type": "integer",
+ "attribute_name": "VDD_AVSBUS_RAIL",
+ "lower_bound": 0,
+ "upper_bound": 15,
+ "scalar_increment": 1,
+ "default_value": 0,
+ "readOnly": false,
+ "helpText": "VDD_AVSBUS_RAIL HelpText",
+ "displayName": "VDD_AVSBUS_RAIL DisplayName",
+ "dbus": {
+ "object_path": "/xyz/openbmc_project/avsbus",
+ "interface": "xyz.openbmc.AvsBus.Manager",
+ "property_type": "uint8_t",
+ "property_name": "Rail"
+ }
+ },
+ {
+ "attribute_type": "integer",
+ "attribute_name": "SBE_IMAGE_MINIMUM_VALID_ECS",
+ "lower_bound": 1,
+ "upper_bound": 15,
+ "scalar_increment": 1,
+ "default_value": 2,
+ "readOnly": true,
+ "helpText": "SBE_IMAGE_MINIMUM_VALID_ECS HelpText",
+ "displayName": "SBE_IMAGE_MINIMUM_VALID_ECS DisplayName"
+ },
+ {
+ "attribute_type": "integer",
+ "attribute_name": "INTEGER_INVALID_CASE",
+ "lower_bound": 1,
+ "upper_bound": 15,
+ "scalar_increment": 2,
+ "default_value": 3,
+ "readOnly": true,
+ "helpText": "INTEGER_INVALID_CASE HelpText",
+ "displayName": "INTEGER_INVALID_CASE DisplayName"
+ },
+ {
+ "attribute_type": "string",
+ "attribute_name": "str_example1",
+ "string_type": "ASCII",
+ "minimum_string_length": 1,
+ "maximum_string_length": 100,
+ "default_string_length": 3,
+ "default_string": "abc",
+ "readOnly": false,
+ "helpText": "str_example1 HelpText",
+ "displayName": "str_example1 DisplayName",
+ "dbus": {
+ "object_path": "/xyz/abc/def",
+ "interface": "xyz.openbmc_project.str_example1.value",
+ "property_name": "Str_example1",
+ "property_type": "string"
+ }
+ },
+ {
+ "attribute_type": "string",
+ "attribute_name": "str_example2",
+ "string_type": "Hex",
+ "minimum_string_length": 0,
+ "maximum_string_length": 100,
+ "default_string_length": 0,
+ "default_string": "",
+ "readOnly": false,
+ "helpText": "str_example2 HelpText",
+ "displayName": "str_example2 DisplayName",
+ "dbus": {
+ "object_path": "/xyz/abc/def",
+ "interface": "xyz.openbmc_project.str_example2.value",
+ "property_name": "Str_example2",
+ "property_type": "string"
+ }
+ },
+ {
+ "attribute_type": "string",
+ "attribute_name": "str_example3",
+ "string_type": "Unknown",
+ "minimum_string_length": 1,
+ "maximum_string_length": 100,
+ "default_string_length": 2,
+ "default_string": "ef",
+ "readOnly": true,
+ "helpText": "str_example3 HelpText",
+ "displayName": "str_example3 DisplayName"
+ }
+ ]
+}
diff --git a/libpldmresponder/test/bios_jsons/enum_attrs.json b/libpldmresponder/test/bios_jsons/enum_attrs.json
deleted file mode 100644
index ef4f684..0000000
--- a/libpldmresponder/test/bios_jsons/enum_attrs.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "entries": [
- {
- "attribute_name": "HMCManagedState",
- "possible_values": ["On", "Off"],
- "default_values": ["On"],
- "readOnly": false,
- "helpText": "HMCManagedState HelpText",
- "displayName": "HMCManagedState DisplayName",
- "dbus": {
- "object_path": "/xyz/abc/def",
- "interface": "xyz.openbmc_project.HMCManaged.State",
- "property_name": "State",
- "property_type": "string",
- "property_values": [
- "xyz.openbmc_project.State.On",
- "xyz.openbmc_project.State.Off"
- ]
- }
- },
- {
- "attribute_name": "FWBootSide",
- "possible_values": ["Perm", "Temp"],
- "default_values": ["Perm"],
- "readOnly": false,
- "helpText": "FWBootSide HelpText",
- "displayName": "FWBootSide DisplayName",
- "dbus": {
- "object_path": "/xyz/abc/def",
- "interface": "xyz.openbmc.FWBoot.Side",
- "property_name": "Side",
- "property_type": "bool",
- "property_values": [true, false]
- }
- },
- {
- "attribute_name": "InbandCodeUpdate",
- "possible_values": ["Allowed", "NotAllowed"],
- "default_values": ["Allowed"],
- "readOnly": false,
- "helpText": "InbandCodeUpdate HelpText",
- "displayName": "InbandCodeUpdate DisplayName",
- "dbus": {
- "object_path": "/xyz/abc/def",
- "interface": "xyz.openbmc.InBandCodeUpdate",
- "property_name": "Policy",
- "property_type": "uint8_t",
- "property_values": [0, 1]
- }
- },
- {
- "attribute_name": "CodeUpdatePolicy",
- "possible_values": ["Concurrent", "Disruptive"],
- "default_values": ["Concurrent"],
- "readOnly": true,
- "helpText": "CodeUpdatePolicy HelpText",
- "displayName": "CodeUpdatePolicy DisplayName"
- }
- ]
-}
diff --git a/libpldmresponder/test/bios_jsons/integer_attrs.json b/libpldmresponder/test/bios_jsons/integer_attrs.json
deleted file mode 100644
index 4d7cd61..0000000
--- a/libpldmresponder/test/bios_jsons/integer_attrs.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "entries": [
- {
- "attribute_name": "VDD_AVSBUS_RAIL",
- "lower_bound": 0,
- "upper_bound": 15,
- "scalar_increment": 1,
- "default_value": 0,
- "readOnly": false,
- "helpText": "VDD_AVSBUS_RAIL HelpText",
- "displayName": "VDD_AVSBUS_RAIL DisplayName",
- "dbus": {
- "object_path": "/xyz/openbmc_project/avsbus",
- "interface": "xyz.openbmc.AvsBus.Manager",
- "property_type": "uint8_t",
- "property_name": "Rail"
- }
- },
- {
- "attribute_name": "SBE_IMAGE_MINIMUM_VALID_ECS",
- "lower_bound": 1,
- "upper_bound": 15,
- "scalar_increment": 1,
- "default_value": 2,
- "readOnly": true,
- "helpText": "SBE_IMAGE_MINIMUM_VALID_ECS HelpText",
- "displayName": "SBE_IMAGE_MINIMUM_VALID_ECS DisplayName"
- },
- {
- "attribute_name": "INTEGER_INVALID_CASE",
- "lower_bound": 1,
- "upper_bound": 15,
- "scalar_increment": 2,
- "default_value": 3,
- "readOnly": true,
- "helpText": "INTEGER_INVALID_CASE HelpText",
- "displayName": "INTEGER_INVALID_CASE DisplayName"
- }
- ]
-}
diff --git a/libpldmresponder/test/bios_jsons/string_attrs.json b/libpldmresponder/test/bios_jsons/string_attrs.json
deleted file mode 100644
index 5213aaf..0000000
--- a/libpldmresponder/test/bios_jsons/string_attrs.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "entries": [
- {
- "attribute_name": "str_example1",
- "string_type": "ASCII",
- "minimum_string_length": 1,
- "maximum_string_length": 100,
- "default_string_length": 3,
- "default_string": "abc",
- "readOnly": false,
- "helpText": "str_example1 HelpText",
- "displayName": "str_example1 DisplayName",
- "dbus": {
- "object_path": "/xyz/abc/def",
- "interface": "xyz.openbmc_project.str_example1.value",
- "property_name": "Str_example1",
- "property_type": "string"
- }
- },
- {
- "attribute_name": "str_example2",
- "string_type": "Hex",
- "minimum_string_length": 0,
- "maximum_string_length": 100,
- "default_string_length": 0,
- "default_string": "",
- "readOnly": false,
- "helpText": "str_example2 HelpText",
- "displayName": "str_example2 DisplayName",
- "dbus": {
- "object_path": "/xyz/abc/def",
- "interface": "xyz.openbmc_project.str_example2.value",
- "property_name": "Str_example2",
- "property_type": "string"
- }
- },
- {
- "attribute_name": "str_example3",
- "string_type": "Unknown",
- "minimum_string_length": 1,
- "maximum_string_length": 100,
- "default_string_length": 2,
- "default_string": "ef",
- "readOnly": true,
- "helpText": "str_example3 HelpText",
- "displayName": "str_example3 DisplayName"
- }
- ]
-}
diff --git a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
index 16c88f1..6e7c57a 100644
--- a/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
+++ b/libpldmresponder/test/libpldmresponder_bios_config_test.cpp
@@ -33,11 +33,7 @@
char tmpdir[] = "/tmp/BIOSTables.XXXXXX";
tableDir = fs::path(mkdtemp(tmpdir));
- std::vector<fs::path> paths = {
- "./bios_jsons/string_attrs.json",
- "./bios_jsons/integer_attrs.json",
- "./bios_jsons/enum_attrs.json",
- };
+ std::vector<fs::path> paths = {"./bios_jsons/bios_attrs.json"};
for (const auto& path : paths)
{
diff --git a/libpldmresponder/test/system_type1/bios_jsons/bios_attrs.json b/libpldmresponder/test/system_type1/bios_jsons/bios_attrs.json
new file mode 100644
index 0000000..fc70a5f
--- /dev/null
+++ b/libpldmresponder/test/system_type1/bios_jsons/bios_attrs.json
@@ -0,0 +1,151 @@
+{
+ "entries": [
+ {
+ "attribute_type": "enum",
+ "attribute_name": "HMCManagedState",
+ "possible_values": ["On", "Off"],
+ "default_values": ["On"],
+ "readOnly": false,
+ "helpText": "HMCManagedState HelpText",
+ "displayName": "HMCManagedState DisplayName",
+ "dbus": {
+ "object_path": "/xyz/abc/def",
+ "interface": "xyz.openbmc_project.HMCManaged.State",
+ "property_name": "State",
+ "property_type": "string",
+ "property_values": [
+ "xyz.openbmc_project.State.On",
+ "xyz.openbmc_project.State.Off"
+ ]
+ }
+ },
+ {
+ "attribute_type": "enum",
+ "attribute_name": "FWBootSide",
+ "possible_values": ["Perm", "Temp"],
+ "default_values": ["Temp"],
+ "readOnly": false,
+ "helpText": "FWBootSide HelpText",
+ "displayName": "FWBootSide DisplayName",
+ "dbus": {
+ "object_path": "/xyz/abc/def",
+ "interface": "xyz.openbmc.FWBoot.Side",
+ "property_name": "Side",
+ "property_type": "bool",
+ "property_values": [true, false]
+ }
+ },
+ {
+ "attribute_type": "enum",
+ "attribute_name": "InbandCodeUpdate",
+ "possible_values": ["Allowed", "NotAllowed"],
+ "default_values": ["Allowed"],
+ "readOnly": false,
+ "helpText": "InbandCodeUpdate HelpText",
+ "displayName": "InbandCodeUpdate DisplayName",
+ "dbus": {
+ "object_path": "/xyz/abc/def",
+ "interface": "xyz.openbmc.InBandCodeUpdate",
+ "property_name": "Policy",
+ "property_type": "uint8_t",
+ "property_values": [0, 1]
+ }
+ },
+ {
+ "attribute_type": "enum",
+ "attribute_name": "CodeUpdatePolicy",
+ "possible_values": ["Concurrent", "Disruptive"],
+ "default_values": ["Concurrent"],
+ "readOnly": true,
+ "helpText": "CodeUpdatePolicy HelpText",
+ "displayName": "CodeUpdatePolicy DisplayName"
+ },
+ {
+ "attribute_type": "integer",
+ "attribute_name": "VDD_AVSBUS_RAIL",
+ "lower_bound": 0,
+ "upper_bound": 15,
+ "scalar_increment": 1,
+ "default_value": 0,
+ "readOnly": false,
+ "helpText": "VDD_AVSBUS_RAIL HelpText",
+ "displayName": "VDD_AVSBUS_RAIL DisplayName",
+ "dbus": {
+ "object_path": "/xyz/openbmc_project/avsbus",
+ "interface": "xyz.openbmc.AvsBus.Manager",
+ "property_type": "uint8_t",
+ "property_name": "Rail"
+ }
+ },
+ {
+ "attribute_type": "integer",
+ "attribute_name": "SBE_IMAGE_MINIMUM_VALID_ECS",
+ "lower_bound": 1,
+ "upper_bound": 30,
+ "scalar_increment": 1,
+ "default_value": 2,
+ "readOnly": true,
+ "helpText": "SBE_IMAGE_MINIMUM_VALID_ECS HelpText",
+ "displayName": "SBE_IMAGE_MINIMUM_VALID_ECS DisplayName"
+ },
+ {
+ "attribute_type": "integer",
+ "attribute_name": "INTEGER_INVALID_CASE",
+ "lower_bound": 1,
+ "upper_bound": 15,
+ "scalar_increment": 2,
+ "default_value": 3,
+ "readOnly": true,
+ "helpText": "INTEGER_INVALID_CASE HelpText",
+ "displayName": "INTEGER_INVALID_CASE DisplayName"
+ },
+ {
+ "attribute_type": "string",
+ "attribute_name": "str_example1",
+ "string_type": "ASCII",
+ "minimum_string_length": 1,
+ "maximum_string_length": 100,
+ "default_string_length": 3,
+ "default_string": "abc",
+ "readOnly": false,
+ "helpText": "str_example1 HelpText",
+ "displayName": "str_example1 DisplayName",
+ "dbus": {
+ "object_path": "/xyz/abc/def",
+ "interface": "xyz.openbmc_project.str_example1.value",
+ "property_name": "Str_example1",
+ "property_type": "string"
+ }
+ },
+ {
+ "attribute_type": "string",
+ "attribute_name": "str_example2",
+ "string_type": "Hex",
+ "minimum_string_length": 0,
+ "maximum_string_length": 200,
+ "default_string_length": 0,
+ "default_string": "",
+ "readOnly": false,
+ "helpText": "str_example2 HelpText",
+ "displayName": "str_example2 DisplayName",
+ "dbus": {
+ "object_path": "/xyz/abc/def",
+ "interface": "xyz.openbmc_project.str_example2.value",
+ "property_name": "Str_example2",
+ "property_type": "string"
+ }
+ },
+ {
+ "attribute_type": "string",
+ "attribute_name": "str_example3",
+ "string_type": "Unknown",
+ "minimum_string_length": 1,
+ "maximum_string_length": 100,
+ "default_string_length": 2,
+ "default_string": "ef",
+ "readOnly": true,
+ "helpText": "str_example3 HelpText",
+ "displayName": "str_example3 DisplayName"
+ }
+ ]
+}
diff --git a/libpldmresponder/test/system_type1/bios_jsons/enum_attrs.json b/libpldmresponder/test/system_type1/bios_jsons/enum_attrs.json
deleted file mode 100644
index 18c221b..0000000
--- a/libpldmresponder/test/system_type1/bios_jsons/enum_attrs.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "entries": [
- {
- "attribute_name": "HMCManagedState",
- "possible_values": ["On", "Off"],
- "default_values": ["On"],
- "readOnly": false,
- "helpText": "HMCManagedState HelpText",
- "displayName": "HMCManagedState DisplayName",
- "dbus": {
- "object_path": "/xyz/abc/def",
- "interface": "xyz.openbmc_project.HMCManaged.State",
- "property_name": "State",
- "property_type": "string",
- "property_values": [
- "xyz.openbmc_project.State.On",
- "xyz.openbmc_project.State.Off"
- ]
- }
- },
- {
- "attribute_name": "FWBootSide",
- "possible_values": ["Perm", "Temp"],
- "default_values": ["Temp"],
- "readOnly": false,
- "helpText": "FWBootSide HelpText",
- "displayName": "FWBootSide DisplayName",
- "dbus": {
- "object_path": "/xyz/abc/def",
- "interface": "xyz.openbmc.FWBoot.Side",
- "property_name": "Side",
- "property_type": "bool",
- "property_values": [true, false]
- }
- },
- {
- "attribute_name": "InbandCodeUpdate",
- "possible_values": ["Allowed", "NotAllowed"],
- "default_values": ["Allowed"],
- "readOnly": false,
- "helpText": "InbandCodeUpdate HelpText",
- "displayName": "InbandCodeUpdate DisplayName",
- "dbus": {
- "object_path": "/xyz/abc/def",
- "interface": "xyz.openbmc.InBandCodeUpdate",
- "property_name": "Policy",
- "property_type": "uint8_t",
- "property_values": [0, 1]
- }
- },
- {
- "attribute_name": "CodeUpdatePolicy",
- "possible_values": ["Concurrent", "Disruptive"],
- "default_values": ["Concurrent"],
- "readOnly": true,
- "helpText": "CodeUpdatePolicy HelpText",
- "displayName": "CodeUpdatePolicy DisplayName"
- }
- ]
-}
diff --git a/libpldmresponder/test/system_type1/bios_jsons/integer_attrs.json b/libpldmresponder/test/system_type1/bios_jsons/integer_attrs.json
deleted file mode 100644
index b735630..0000000
--- a/libpldmresponder/test/system_type1/bios_jsons/integer_attrs.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "entries": [
- {
- "attribute_name": "VDD_AVSBUS_RAIL",
- "lower_bound": 0,
- "upper_bound": 15,
- "scalar_increment": 1,
- "default_value": 0,
- "readOnly": false,
- "helpText": "VDD_AVSBUS_RAIL HelpText",
- "displayName": "VDD_AVSBUS_RAIL DisplayName",
- "dbus": {
- "object_path": "/xyz/openbmc_project/avsbus",
- "interface": "xyz.openbmc.AvsBus.Manager",
- "property_type": "uint8_t",
- "property_name": "Rail"
- }
- },
- {
- "attribute_name": "SBE_IMAGE_MINIMUM_VALID_ECS",
- "lower_bound": 1,
- "upper_bound": 30,
- "scalar_increment": 1,
- "default_value": 2,
- "readOnly": true,
- "helpText": "SBE_IMAGE_MINIMUM_VALID_ECS HelpText",
- "displayName": "SBE_IMAGE_MINIMUM_VALID_ECS DisplayName"
- },
- {
- "attribute_name": "INTEGER_INVALID_CASE",
- "lower_bound": 1,
- "upper_bound": 15,
- "scalar_increment": 2,
- "default_value": 3,
- "readOnly": true,
- "helpText": "INTEGER_INVALID_CASE HelpText",
- "displayName": "INTEGER_INVALID_CASE DisplayName"
- }
- ]
-}
diff --git a/libpldmresponder/test/system_type1/bios_jsons/string_attrs.json b/libpldmresponder/test/system_type1/bios_jsons/string_attrs.json
deleted file mode 100644
index 7e3b8f4..0000000
--- a/libpldmresponder/test/system_type1/bios_jsons/string_attrs.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "entries": [
- {
- "attribute_name": "str_example1",
- "string_type": "ASCII",
- "minimum_string_length": 1,
- "maximum_string_length": 100,
- "default_string_length": 3,
- "default_string": "abc",
- "readOnly": false,
- "helpText": "str_example1 HelpText",
- "displayName": "str_example1 DisplayName",
- "dbus": {
- "object_path": "/xyz/abc/def",
- "interface": "xyz.openbmc_project.str_example1.value",
- "property_name": "Str_example1",
- "property_type": "string"
- }
- },
- {
- "attribute_name": "str_example2",
- "string_type": "Hex",
- "minimum_string_length": 0,
- "maximum_string_length": 200,
- "default_string_length": 0,
- "default_string": "",
- "readOnly": false,
- "helpText": "str_example2 HelpText",
- "displayName": "str_example2 DisplayName",
- "dbus": {
- "object_path": "/xyz/abc/def",
- "interface": "xyz.openbmc_project.str_example2.value",
- "property_name": "Str_example2",
- "property_type": "string"
- }
- },
- {
- "attribute_name": "str_example3",
- "string_type": "Unknown",
- "minimum_string_length": 1,
- "maximum_string_length": 100,
- "default_string_length": 2,
- "default_string": "ef",
- "readOnly": true,
- "helpText": "str_example3 HelpText",
- "displayName": "str_example3 DisplayName"
- }
- ]
-}