summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Include missing header fileRatan Gupta2018-02-201-0/+2
| | | | | | | | we are using the std algo's in this file but missed to include the c++ algorithm header file. Change-Id: Ib88f810a048dba18526b7c7cf42d87ba095a27be Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Change the access mode of the function getBusRatan Gupta2018-02-201-6/+6
| | | | | | | | | | | | | | GetBus function provides the same instance of the bus application in the process. Now there is a need where we need the same bus instance at multiple places. Remove the friend loop, now it is not needed as we have changed the scope of getBus. Change-Id: I7e8cda45f3835b1d93be36f317741bc4ae6951a2 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Adding the section for event call back.Ratan Gupta2018-02-201-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | eg:- - name: example event callback description: > 'Callbacks are actions PDM should take when instructed to do so. Some callback types refer to a group of paths and group of properties in a similar fashion as the property watch directive. The event callback creates the event D-Bus object with the given name and the event message. eg /xyz/openbmc_project/events/test/<id>' class: callback callback: event paths: example path group properties: example property group eventName: test eventMessage: "Test configuration changed." When fully implemented, event callbacks will create DBus objects for preconfigured DBus events. Change-Id: I73d46a9bc630763cc1a74877803a638f3a8d1e1f Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Initial support for event callbacksRatan Gupta2018-02-206-1/+143
| | | | | | | | | Add parser support for template rendering of events. Also defines the EventBase and Event classes. EventBase is parent of Event. Change-Id: I6b07b415acf510a8437529095bd489c0af73ddf5 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Fix pep8 errors in pdmgen.pyMatt Spinler2017-11-141-0/+2
| | | | | Change-Id: I16cbfa2a3ed646f3ca0aeee0e71b3ada39062941 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add resolve callouts test to YAMLMatt Spinler2017-11-141-0/+7
| | | | | Change-Id: I9f21e6378f74bf9dd7d413557a80b47ec9c9f829 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add resolve callout exampleMatt Spinler2017-11-141-0/+16
| | | | | Change-Id: Ie80bff38947a79cc686eaf9db9c80453d28a4fb6 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add resolve callout rule support to YAML parserMatt Spinler2017-11-144-1/+20
| | | | | | | The callout to resolve is specified in the YAML. Change-Id: If613fae1959c6a54279b2a50c7d858f3e7d831b9 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Set Resolved property on elog entryMatt Spinler2017-11-141-1/+39
| | | | | | | | Fill in the function that sets the Resolved property on an error log entry. Change-Id: I78b57c413a7047508b7fc95e0cf27e1ae6e871cf Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Find the error logs that have a certain calloutMatt Spinler2017-11-141-1/+51
| | | | | | | | | In order to find the error logs that have a specific callout, the code needs to look in the 'endpoints' property of the '<callout>/fault' D-Bus object. Change-Id: Idb9c06a6d815195ed47fb6ec914ba8f89539cb85 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add getBusName() utility function to SDBusPlusMatt Spinler2017-11-143-5/+28
| | | | | | | | Add a function to SDBusPlus to get the D-Bus bus name for an object path and interface. Change-Id: I7d7a533c7430fcf42e1e0f6a21a2453e6c8197ea Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add ResolveCallout classMatt Spinler2017-11-144-2/+105
| | | | | | | | | | | | | | | This class is a type of callback, and when triggered will resolve all error log entries that have the specified callout. It does this by setting the Resolved property on the log entry. It can be used to do things like resolve all errors against a particular part when that part is replaced, which would be done by specifying this class as a callback on a watch on the Present property for the part in the inventory. Change-Id: I50557938c9e15a91744ee2a16d67eaa7f367ef04 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Spelling fixesGunnar Mills2017-10-257-13/+13
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: I83c844373ea41d762367085cb16b01d31676e33d Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add more elog testsGunnar Mills2017-08-213-4/+34
| | | | | | | Add tests to callbackgroupgentest/test.yaml Change-Id: I0b9d4799dd3ed3a4876115594aacbd80caa3f9d0 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add elog to example.yamlGunnar Mills2017-08-211-0/+22
| | | | | Change-Id: I97f73dd310cae4b2d67122bc51414e2a5397f0b3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add tests for elogGunnar Mills2017-08-212-1/+55
| | | | | Change-Id: I58a6ac714cfa80462ab53d4487dc727e40038b06 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add support for metadataGunnar Mills2017-08-213-9/+66
| | | | | | | | Added support for metadata in elog.hpp, elog mako file, and pdmgen. This metadata will be added with the error log. Change-Id: Iaf0fe24d71f6bdd02b51df208b2c1d66c68319d3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add support for elog callbackGunnar Mills2017-08-216-0/+32
| | | | | | | | | | | Added support for "callback: elog" in PDM. templates/elog.mako.cpp is used to generate the Elog call. templates/errors.mako.hpp is used to generate the errors.hpp used by generated.hpp to include any error.hpp files like "xyz/openbmc_project/Common/error.hpp" Change-Id: Id0ae3aca4282095f58a8939b70e398bec706d7f5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create new Elog classGunnar Mills2017-08-214-0/+106
| | | | | | | | Created new Elog callback, which will create an error log. This is just the base, more to come. Change-Id: I50c12c8bff0942b5cb027e38d0cc8691e8a241b4 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Grammar fixes in example.yamlGunnar Mills2017-08-141-6/+6
| | | | | Change-Id: Ia9ae40f1bd590945e2fee662e4437b92c8bd9b09 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add phosphor-msl-verifyBrad Bishop2017-08-037-2/+367
| | | | | | | | | | phosphor-msl-verify is a oneshot application for basic minimum ship level (MSL) verification. https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Control/README.msl.md Change-Id: Ifa036bb0a45255af7c7773bd910e83c64842d868 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Remove dead codeBrad Bishop2017-06-2810-767/+0
| | | | | | | Remove a number of unused files. Change-Id: If7e40d2be7eb3f5d84538a3c86f911df268a1f34 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Remove use of std::crefBrad Bishop2017-06-191-6/+6
| | | | | | | Prefer implicit conversion for readability. Change-Id: I64d04b926edea0531a5414a416c04b36ae3d5e2a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Attach sdevent mainloop to dbusBrad Bishop2017-06-193-10/+28
| | | | | | | | Switch from sd_bus process to sd_event run so that sd event handlers are invoked. Change-Id: If7c1f046f30cc845c6e9fcc72eb99c5bdfb36052 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* expose watch callbacksBrad Bishop2017-06-193-8/+28
| | | | | | | | | | | | Allow watch class users to explicitly invoke the watch callback. Since watches and callbacks share a common pool of state all watches must complete their initialization prior to invoking their callback methods. Change-Id: I62ebad64da88a145f3d5006b07c01381b0eb6728 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Invoke callbacks under make checkBrad Bishop2017-06-193-0/+28
| | | | | | | | | Add a simple test that invokes all the callbacks. There are no assertions but there is some value in ensuring the application will at least run without crashing. Change-Id: I117bff261202ae7e642094a659a954328351eac1 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Fix bool and string templates/renderingBrad Bishop2017-06-195-8/+452
| | | | | | | | Fix a number of bugs related to rendering and instantiation of string and bool templates. Change-Id: Ic75842b4016f4d96bf5850f9c4ad778d82e075ed Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pdmgen: Require uppercase meta keysBrad Bishop2017-06-1914-72/+84
| | | | | | | | | journald ignores lowercase metadata keys so require them to be uppercase. Abort the config file parse when lowercase keys are found. Change-Id: Icffffdc6680b4d305329c3395f8e2fda6210964f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* build: Correct out of tree build bugsBrad Bishop2017-06-193-8/+8
| | | | | Change-Id: Id6e14414c6f15c11d1476039e3781d719f693d21 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add deferrable callbacksBrad Bishop2017-06-195-6/+111
| | | | | | | | | | | Deferrable callbacks delay callback invocation until a pre configured length of time has elapsed. One example scenario where deferrable callbacks help is to avoid oscillation when testing a condition and making callbacks frequently. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I180c99b57ec1c9bde4da76d947a026f809341c8a
* Add SDEvent delegateBrad Bishop2017-06-192-0/+83
| | | | | | | | Add an sd-event interface abstraction to facilitate mocking and unit test. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I5880617565fc6eab54335adc30033d4b132568f8
* Add sdevent C++ wrappersBrad Bishop2017-06-193-0/+392
| | | | | | | | | | | Add C++ wrappers around select sd-event APIs, for a more C++ like programming API. Includes support for core sd_event and timer related sd_event_source APIs. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I10ac5406c9f8831b4efb294d3aef36026469d4a5
* Start watches at application startupBrad Bishop2017-06-191-0/+5
| | | | | Change-Id: Id4157b9f40c80c5bb7d54d10f74ba7ecdeb199e5 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Method supportBrad Bishop2017-06-197-1/+264
| | | | | | | | | Add support for a method callback. The method callback enables arbitrary DBus method calls. A sample use case could be starting a systemd unit via the sytemd DBus API. Change-Id: If25131d11497c82f862ae1f47da066c5fd8b2e2e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pdmgen: Add support for rendering argument listsBrad Bishop2017-06-191-0/+93
| | | | | | | | | | | | Add core support for rendering argument lists. Add a number of decorators like: -literal: Render a literal value. -cast: Render a C++ cast. -fixbool: Work around yaml boolean capitalization. -quote: Quote a string literal. Change-Id: I4364d9f7a8cb7bb932d347d34bfabb88e694020a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Link watches to callbacksBrad Bishop2017-06-195-6/+43
| | | | | | | | Callbacks must ultimately be triggered when a property is updated by a watch. Add that support. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I20130a11c19ddcf2c4ae45800f2068b31950bcd6
* Add testcase for conditionsBrad Bishop2017-06-195-0/+188
| | | | | Change-Id: I94059c0be78d5b97e7e0e11c78d4a164a98a483e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add conditional callbacksBrad Bishop2017-06-198-0/+312
| | | | | | | Enable conditional application of callbacks. Change-Id: I9d765e5f585aac40994b65da3b51ea891beae9bf Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add testcase for callback groupsBrad Bishop2017-06-195-0/+151
| | | | | Change-Id: Icbdc8612d73bed065227d9edfde1426206886652 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add callback groupsBrad Bishop2017-06-196-0/+139
| | | | | | | | Allow named collections of callbacks to be defined and used anywhere callbacks are used. Change-Id: I3224aa06b2250e9a055bc70d20c186caecd033af Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add testcase for callbacksBrad Bishop2017-06-196-0/+168
| | | | | Change-Id: Iff1ddb9c18b5384d05a4d2dbfba95ade8cc1783c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add support for callbacksBrad Bishop2017-06-199-11/+273
| | | | | | | | | Callbacks are the response in the PDM 'trigger->response' model. Add general support for implementing callbacks and implement a log to systemd journal using that framework. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I8bead5368ee5472a02b47e8bba9e9df3a1f346bc
* Add printf format utilityBrad Bishop2017-06-192-0/+98
| | | | | | | | Add a template for obtaining a format string at build for a built-in C++ type. Change-Id: I8e5d26d4481b3ddafb5ffddbb058a1c75b3a2257 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add testcases for property watchesBrad Bishop2017-06-198-0/+1113
| | | | | Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I9e9266901414c71a34d9686f2a45bc4764602d53
* Add property watchesBrad Bishop2017-06-199-1/+654
| | | | | | | | | Property watches cache DBus property values given an externally supplied index of property names and paths, in an externally supplied storage location. Change-Id: I155081da88c3ab0e4f6a13b012fc9719203b1888 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add sdbusplus delegateBrad Bishop2017-06-041-0/+86
| | | | | | | | Add a DBus interface abstraction to facilitate mocking and unit test. Change-Id: I914cba7500d79bc4d3022cb12e4c02adf6a78c19 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add testcases for property and property groupsBrad Bishop2017-06-046-0/+266
| | | | | Change-Id: I4b30d0729a704d6833c840ea08daeee961a5730b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add property and property group supportBrad Bishop2017-06-043-0/+143
| | | | | | | | | Add support for defining groups of DBus properties. Groups are a list of property/interface/metadata tuples. Metadata can be used to give a property context when required. Change-Id: I5fc27f4d815b53332a2ddea2d270fde8e355dcbc Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add testcases for path and path group supportBrad Bishop2017-06-046-0/+257
| | | | | Change-Id: I296de0e0cb30e0e25f6677a06bd04fe15c2fd015 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add path and path group supportBrad Bishop2017-06-043-0/+134
| | | | | | | | | Add support for defining groups of object paths. Groups are a list of path/metadata tuples. Metadata can be used to give a path context when required. Change-Id: I355ebf76b40f2ffc8d783e94e888b930cde8ee9c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud