#
5f51444d |
| 04-Jan-2024 |
Shawn McCarney <shawnmm@us.ibm.com> |
Move TemporaryFile class to root directory
Source code that is shared across applications is located in the root directory of the phosphor-power repository.
The TemporaryFile class was originally c
Move TemporaryFile class to root directory
Source code that is shared across applications is located in the root directory of the phosphor-power repository.
The TemporaryFile class was originally created for the phosphor-regulators application. However it is general purpose and is now needed by the phosphor-power-sequencer application.
Move the TemporaryFile class to the root directory. Update C++ files that use the TemporaryFile class since it is now in a different namespace. Update affected meson.build files.
Change-Id: I6d18080d2436a5da87b7ab51ac003c503caa36a3 Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
show more ...
|
#
48781aef |
| 10-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: If66f68c96df4baf8dc07abf8729a3cb7657e932d Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
0a2b76bc |
| 06-Dec-2022 |
Shawn McCarney <shawnmm@us.ibm.com> |
regulators: Update test cases for new jsonschema
The validate-regulators-config.py tool validates regulator configuration files. It uses the jsonschema Python package to perform much of the validat
regulators: Update test cases for new jsonschema
The validate-regulators-config.py tool validates regulator configuration files. It uses the jsonschema Python package to perform much of the validation.
The automated test cases for this tool run the tool against various invalid configuration files and verify the resulting error messages.
The latest version of jsonschema changed the error messages that are emitted in some error cases. Update the test cases to expect the new error messages.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: I369f32705c64c19d521c4624188ebbc98522cff2
show more ...
|
#
a2a830b1 |
| 30-Oct-2021 |
Shawn McCarney <shawnmm@us.ibm.com> |
regulators: Allow empty expected VPD value
Modify the compare_vpd action to support specifying an empty string or empty byte vector as the expected keyword value.
The VPD service was modified in a
regulators: Allow empty expected VPD value
Modify the compare_vpd action to support specifying an empty string or empty byte vector as the expected keyword value.
The VPD service was modified in a previous commit to return an empty keyword value if the VPD interface or keyword does not exist on the specified D-Bus object path. Thus, the actual keyword value may be empty.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: If48ab6423c40e5b24d6cff72264dc2efe750c85f
show more ...
|
#
4c88a4c2 |
| 21-Sep-2021 |
Shawn McCarney <shawnmm@us.ibm.com> |
regulators: Make inventory_path required property
Make "inventory_path" a required property of the "chassis" object in the regulators JSON configuration file.
This property is used to create the ch
regulators: Make inventory_path required property
Make "inventory_path" a required property of the "chassis" object in the regulators JSON configuration file.
This property is used to create the chassis <-> sensor associations required by bmcweb for finding regulator sensors.
The property is already documented in the markdown file as being required. However, that requirement was not being enforced in the JSON schema nor in the C++ configuration file parser.
The existing configuration files did not have the property, and requiring it would have caused errors.
Those configuration files have been updated to include the property, so the requirement is now being enforced.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: If9af7969f8b92068e66c750681179db70eae489e
show more ...
|
#
5d4a9c78 |
| 19-Aug-2021 |
Shawn McCarney <shawnmm@us.ibm.com> |
regulators: Add device_id to validation tool
Enhance the configuration file validation tool to verify that any "device_id" properties refer to a valid device ID. This property exists in the new pha
regulators: Add device_id to validation tool
Enhance the configuration file validation tool to verify that any "device_id" properties refer to a valid device ID. This property exists in the new phase_fault_detection object.
Add the following new automated tests * Test where phase_fault_detection object specifies an invalid rule_id * Test where phase_fault_detection object specifies an invalid device_id
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: I242ced0a2d0c4483d0dd7c4d36781a9f588a7e4f
show more ...
|
#
846dde5d |
| 14-Aug-2021 |
Shawn McCarney <shawnmm@us.ibm.com> |
regulators: Add phase fault detection to schema
Add the following new JSON objects to the configuration file schema: * i2c_capture_bytes * log_phase_fault * phase_fault_detection
Add new automated
regulators: Add phase fault detection to schema
Add the following new JSON objects to the configuration file schema: * i2c_capture_bytes * log_phase_fault * phase_fault_detection
Add new automated tests to verify the schema additions.
Also make the following enhancements to the automated schema tests: * Add presence_detection rule to sample JSON * Modify the function called by EXPECT_JSON_INVALID(). Support passing an empty string as the expected first line written to stdout. This value means the stdout line should be ignored. This helps in cases where the output from jsonschema is very long, cryptic, and/or dependent on the jsonschema version. * Added a blank line between TEST functions to improve readability.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: Ie1dac1b9b2edaf055266c8b7868e017a57dda5fc
show more ...
|
#
aacc2aaf |
| 25-May-2021 |
Matt Spinler <spinler@us.ibm.com> |
regulators: Support a string or vector for VPD
Add a 'byte_values' alternative to the 'value' entry in the compare VPD action. This is to support VPD values that are not strings, such as 'HW', a ne
regulators: Support a string or vector for VPD
Add a 'byte_values' alternative to the 'value' entry in the compare VPD action. This is to support VPD values that are not strings, such as 'HW', a new IBM keyword that describes the version of a piece of hardware.
To support this, the VPD class now treats all VPD keyword values as vectors of uint8_ts, including in its data cache. If a compare VPD action in the JSON contains a string value, it will be converted to the vector before the CompareVPDAction class is created.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I3fcabf896f4885feae1b07ee2c3da5929cf8bfa4
show more ...
|
#
ecbeeea7 |
| 29-Apr-2021 |
Shawn McCarney <shawnmm@us.ibm.com> |
regulators: Add inventory_path to JSON chassis obj
Add the property "inventory_path" to the "chassis" object in the JSON configuration file.
This property will be used to create the required D-Bus
regulators: Add inventory_path to JSON chassis obj
Add the property "inventory_path" to the "chassis" object in the JSON configuration file.
This property will be used to create the required D-Bus association between a voltage regulator sensor and the chassis that contains it. This association is required by the Redfish support.
Long term, this new property will be required. That is how it is documented in the updated version of chassis.md.
However, it will be temporarily optional in the JSON schema and the C++ configuration file parser. This temporary measure will be removed once all known JSON configuration files have been updated to specify the new property.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: I45f5e8ec86be7672a33099c94c35328862ffe11b
show more ...
|
#
a76898f1 |
| 13-Oct-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Enhance config file parser
Enhance JSON config file parser to convert relative inventory paths to absolute form.
Tested: Run local CI with -Dlong-tests=enabled to enable tests for valid
regulators: Enhance config file parser
Enhance JSON config file parser to convert relative inventory paths to absolute form.
Tested: Run local CI with -Dlong-tests=enabled to enable tests for validate-regulators-config.py.
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I80237a673f9c5918898db15363847722141388e6
show more ...
|
#
b7552f0c |
| 15-Oct-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Improve config file validator
Improve error checking in config file validator.
Add checking if config file does not exist, config file is not readable, and config file is not a JSON fil
regulators: Improve config file validator
Improve error checking in config file validator.
Add checking if config file does not exist, config file is not readable, and config file is not a JSON file. Add checking if schema file does not exist, schema file is not readable, and schema file is not a JSON file.
Tested: Run local CI with -Dlong-tests=enabled to enable tests for validate-regulators-config.py.
1/7 phosphor-regulators-tests OK 32.49s
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I5a84949e89be004a20a04c00d16b49286cb42f37
show more ...
|
#
0f6ebade |
| 04-Sep-2020 |
Shawn McCarney <shawnmm@us.ibm.com> |
regulators: Remove TmpFile class
The TmpFile class was created in the test directory for managing temporary files used by testcases.
A new TemporaryFile class has replaced it. TemporaryFile has mo
regulators: Remove TmpFile class
The TmpFile class was created in the test directory for managing temporary files used by testcases.
A new TemporaryFile class has replaced it. TemporaryFile has more features and can be used by production (non-test) code as well.
This commit removes the TmpFile class and modifies testcases to use TemporaryFile instead.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: Id06d333416e43d5685c377ee0780b475d20cba8f
show more ...
|
#
525e20c9 |
| 14-Apr-2020 |
Shawn McCarney <shawnmm@us.ibm.com> |
regulators: Add configure support to Chassis class
Implemented the configure() method in the Chassis class. This method configures all the regulator devices within the chassis.
Also made very mino
regulators: Add configure support to Chassis class
Implemented the configure() method in the Chassis class. This method configures all the regulator devices within the chassis.
Also made very minor fixes to two testcases.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: Ib29fdfa36e59f6b79d9467cdc52c3c6fc9c6886d
show more ...
|
#
80c0b049 |
| 27-Mar-2020 |
Shawn McCarney <shawnmm@us.ibm.com> |
regulators: Make TmpFile class common
A TmpFile class was implemented in two different test cases to automatically create and delete temporary files.
Moved the TmpFile class into a standalone file
regulators: Make TmpFile class common
A TmpFile class was implemented in two different test cases to automatically create and delete temporary files.
Moved the TmpFile class into a standalone file so that the code could be common among test cases. Improved the error handling.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: Ifa8ddd3b442bcf8fbf0dc4d0a39dd9fc5f233e3f
show more ...
|
#
3afa711d |
| 18-Mar-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Add test cases for action.
Add test cases for action: * Valid: Comments property not specified * Valid: Comments property specified * Valid: and action type specified * Valid: co
regulators: Add test cases for action.
Add test cases for action: * Valid: Comments property not specified * Valid: Comments property specified * Valid: and action type specified * Valid: compare_presence action type specified * Valid: compare_vpd action type specified * Valid: i2c_compare_bit action type specified * Valid: i2c_compare_byte action type specified * Valid: i2c_compare_bytes action type specified * Valid: i2c_write_bit action type specified * Valid: i2c_write_byte action type specified * Valid: i2c_write_bytes action type specified * Valid: if action type specified * Valid: not action type specified * Valid: or action type specified * Valid: pmbus_read_sensor and pmbus_write_vout_command action type specified * Valid: run_rule action type specified * Valid: set_device action type specified * Invalid: Wrong data type for comments (should be array of string) * Invalid: Wrong data type for action type * Invalid: Empty comments array * Invalid: Comments array has wrong element type (should be string) * Invalid: No action type specified * Invalid: Multiple action types specified * Invalid: Unexpected property specified
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I81dfb50cf46a3091753f43266af8dc01527d621d
show more ...
|
#
20057416 |
| 16-Mar-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Add test cases for entire config file.
Add test cases for entire config file: *Valid: Only required properties specified *Valid: All properties specified *Invalid: Required chassis
regulators: Add test cases for entire config file.
Add test cases for entire config file: *Valid: Only required properties specified *Valid: All properties specified *Invalid: Required chassis property not specified *Invalid: Wrong data type for comments *Invalid: Wrong data type for rules *Invalid: Wrong data type for chassis *Invalid: Empty comments array *Invalid: Empty rules array *Invalid: Empty chassis array *Invalid: Comments array has wrong element type *Invalid: Rules array has wrong element type *Invalid: Chassis array has wrong element type *Invalid: Unexpected property specified
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I0e3e7b58de0318d306d5bdfe0bc5588720e9cf05
show more ...
|
#
78793106 |
| 13-Mar-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Add test cases for check_duplicate_object_id.
Add test cases for check_duplicate_object_id function in validate tool. *Invalid: test duplicate object ID in device and rail. *Invalid:
regulators: Add test cases for check_duplicate_object_id.
Add test cases for check_duplicate_object_id function in validate tool. *Invalid: test duplicate object ID in device and rail. *Invalid: test duplicate object ID in device and rule. *Invalid: test duplicate object ID in rule and rail. Modify test case for comments property with multiple array elements. Add comments property with multiple array elements in test case Configuration.
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I900083ed88617b227af138c880f1a3280d44ad47
show more ...
|
#
358c417a |
| 16-Mar-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Update validator testcases for python3
The validate-regulators-config.py tool uses jsonschema.
When run using python3, the error messages from jsonschema have a slightly different forma
regulators: Update validator testcases for python3
The validate-regulators-config.py tool uses jsonschema.
When run using python3, the error messages from jsonschema have a slightly different format.
Update the validator tool testcases to adapt to the python3 error message format.
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: Ifb5aafcc3194b165fd3a9c6e3ae4388da91c2586
show more ...
|
#
a57e0814 |
| 11-Mar-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Modify file path and timeout for CI.
meson.build: Add validate-regulators-config_tests.cpp in the meson.build for CI. Set timeout to 90 seconds for phosphor-regulators-tests. The default
regulators: Modify file path and timeout for CI.
meson.build: Add validate-regulators-config_tests.cpp in the meson.build for CI. Set timeout to 90 seconds for phosphor-regulators-tests. The default is 30 seconds, and this test can run longer than that under valgrind in CI.
validate-regulators-config_tests.cpp: Modify the file path in validate-regulators-config_tests.cpp for CI. Modify runToolForOutput function to call validate tool once with both standard output and standard error.
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I8ad4727a17bd07b918a28936f097f0c9201a1d31
show more ...
|
#
ed009655 |
| 20-Feb-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Add test cases for command line syntax
Test cases for testing command line syntax of the validation tool. *Valid: -s specified *Valid: --schema-file specified *Valid: -c specified *Valid
regulators: Add test cases for command line syntax
Test cases for testing command line syntax of the validation tool. *Valid: -s specified *Valid: --schema-file specified *Valid: -c specified *Valid: --configuration-file specified *Valid: -h specified *Valid: --help specified *Invalid: -c/--configuration-file not specified *Invalid: -s/--schema-file not specified *Invalid: -s specified more than once *Invalid: -c specified more than once *Invalid: No file name specified after -c *Invalid: No file name specified after -s *Invalid: File specified after -c does not exist *Invalid: File specified after -s does not exist *Invalid: File specified after -s is not right data format *Invalid: File specified after -c is not readable *Invalid: File specified after -s is not readable *Invalid: Unexpected parameter specified
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I922c3b5810e5c9f98b318f0a44ae78e4b0c8525a
show more ...
|
#
dc72b62a |
| 17-Feb-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Add test cases for check_number_of_elements_in_masks
*Invalid: test number of elements in masks not equal to number in values in i2c_compare_bytes. *Invalid: test number of elements in m
regulators: Add test cases for check_number_of_elements_in_masks
*Invalid: test number of elements in masks not equal to number in values in i2c_compare_bytes. *Invalid: test number of elements in masks not equal to number in values in i2c_write_bytes.
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I523782a46c2b52035bfa2b6b4531ce79c37a62f9
show more ...
|
#
21b09bea |
| 17-Feb-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Add test cases for check_rule_id_exists
*Invalid: test rule_id property in configuration specifies a rule ID that does not exist. *Invalid: test rule_id property in presence_detection sp
regulators: Add test cases for check_rule_id_exists
*Invalid: test rule_id property in configuration specifies a rule ID that does not exist. *Invalid: test rule_id property in presence_detection specifies a rule ID that does not exist. *Invalid: test rule_id property in sensor_monitoring specifies a rule ID that does not exist.
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I55e2d81b89b96164b9774e59d9487047943945fa
show more ...
|
#
13b2ad9d |
| 17-Feb-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Add test cases for check_set_device_value_exists
*Invalid: test set_device actions specify a device ID that does not exist.
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I7f
regulators: Add test cases for check_set_device_value_exists
*Invalid: test set_device actions specify a device ID that does not exist.
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I7f279b9ea3177acdc09f37c83cbf82631805de38
show more ...
|
#
f88203a1 |
| 17-Feb-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Add test cases for check_run_rule_value_exists
*Invalid: test run_rule actions specify a rule ID that does not exist.
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: Idec5938e
regulators: Add test cases for check_run_rule_value_exists
*Invalid: test run_rule actions specify a rule ID that does not exist.
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: Idec5938eb1e510d977833eb50721d78d84af37ed
show more ...
|
#
7d3a9f1b |
| 11-Feb-2020 |
Bob King <Bob_King@wistron.com> |
regulators: Fix 'run_rule' and 'set_device' test cases fail.
Fix test case failures for the 'run_rule' and 'set_device' actions. The failures are caused by new logic in the validator that checks for
regulators: Fix 'run_rule' and 'set_device' test cases fail.
Fix test case failures for the 'run_rule' and 'set_device' actions. The failures are caused by new logic in the validator that checks for invalid rule IDs and device IDs.
Signed-off-by: Bob King <Bob_King@wistron.com> Change-Id: I764bd101d0ef635375d13b2921a292799ff1ada9
show more ...
|