| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Installs into bin instead of sbin per guidelines.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ife0be5530266404f75b30baf1ed52bfead513679
|
|
|
|
|
|
|
|
| |
Use the defaults in the pkg check where the default error message is
sufficient to identify which package is missing.
Change-Id: I16bdbf34b753bdf91dfa4dac824ffd626fd190f7
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
| |
Patch adds exception processing for CallDBusMethod::op function.
It prevents phosphor-dbus-monitor crashes, when calling service
doesn't exist.
Change-Id: Iac9be4c14a52fa9c12eb08dfec1f4dfd68e8cdfb
Signed-off-by: Alexander Soldatov <a.soldatov@yadro.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
DeferrableCallback operator() saves the context in
self instance. When the timer expires, it calls
operator() for the ConditionalCallback with the
context saved in DeferrableCallback instance.
Resolves openbmc/phosphor-dbus-monitor#1
Change-Id: I8d235b0747005c403829f8262d0290548b0a9910
Signed-off-by: Alexander Soldatov <a.soldatov@yadro.com>
|
|
|
|
|
|
|
|
| |
This change removes the one off sd-event wrapper from the project and
uses the openbmc wide sdeventplus library.
Change-Id: I8e042f875d06082e15606c7191a8073974f93990
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
| |
The mapper changed the association interface name it
hosts to 'xyz.openbmc_project.Association' from
'org.openbmc.Association'.
Change-Id: Ida42ce2152deaafba0e4881a5ee864ecef0d8ce4
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This is just a refactor from the mapbox specific .get() interface to the
common std::variant ::get<>() interface.
Tested:
Built and run through unit tests.
Change-Id: Ic0737f632e80c9dd5b73717ec33d31f245f107db
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
| |
[src/event.hpp:95]: (performance) Function parameter 'eventName' should be
passed by const reference.
[src/event.hpp:95]: (performance) Function parameter 'eventMessage' should be
passed by const reference.
Change-Id: I128100102c8ddb24bb847c2ed94acb1fa8871eb0
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
Update configure.ac to choose the c++17 standard
Change-Id: I864d373572d413b0985eee0d6c958b6c982290ef
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
| |
Code shouldn't use MESSAGE in journal metadata as MESSAGE is
already taken by the journal message field.
Change-Id: I6b1e9033b2028e4fff67cbbeb1824f260657c247
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Added the header inclusion order to the .clang-format file generated
these changes.
Change-Id: I4f51a20f469de431ee6a5ba78e3f4da39c980fab
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
| |
The bump to use clang-format-6.0 now reports these issues.
Change-Id: I174c882727eaa9adf472599443a2f8ef637e2f0a
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
| |
dbus-monitor is notified for any new error entry
created. dbus-monitor parses the error entry and
constructs ErrorNotification object and sends
SNMP trap.
Change-Id: I25916b087c5513916c90266278ccafc5db3c41a0
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ignore exceptions from sdbusplus for objects that are queried
as part of a property watch but are expected to be missing
when the BMC starts up.
Tested: The phosphor-dbus-monitor app does not core dump
with the latest sdbusplus changes.
Change-Id: I0f6a850f0e426478bd1ccacb910a44079b9c8a54
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Handle exceptions from the sdbusplus method call API.
A number of method calls are made at application startup. First the
mapper is queried and then host services directly to obtain initial
values for the property cache.
In either case a missing object is sometimes expected and tolerated
(in a logical sense) without issue. Eat the new exceptions in these
scenarios and avoid a program crash.
Change-Id: Id79d28b2da997f3c545b86c21932e271e3df8bb3
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
A alias for string called 'Property' was added with 70aafbb58, making
the Property type in propertygentest ambiguous and unable to build.
Remove the ambiguity.
callbacktest does not pass. Mark as expected to fail until resolved.
Tested: propertygentest compiles again, test suite runs to completion
Change-Id: I7df516e378dd7b8de94474ab90ce55c0ac8708a4
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calling code is already handling any missing method
call response data appropriately, and many times
the failed call is expected.
For example, any time there is a dbus monitor rule
that watches a property, it will try to read that
property right away on startup to cache the value
if possible. It's possible that some D-Bus objects
may not exist at that moment in time, and the code
already expects that.
Tested: No more 'Failed to parse method response'
journal entries.
Change-Id: Iaa84020a34a96395abf7a3460c96ec0dc255fa23
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tested: Verified that the phosphor-dbus-monitor does
not core dump with the latest sdbusplus changes to
support sdbusplus exceptions. Instead it logs the
"Failed to parse method response" error msg in the journal.
Resolves openbmc/openbmc#3213
Change-Id: I11347725364b5a43df6c0c1c377d65ce361a419c
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Verify the watches created for the object path being watched
for 'interfaces added' signal.
Resolves openbmc/openbmc#3003
Change-Id: I88a3adbbe91fcbe5bdf606d2f460d4d0c6d9c1a2
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added support for watch and callback on 'interface added'
signal for the specified object paths.
Added mako scripts for events to auto create callback
and watch objects for the specified object path groups.
Clients specify object paths to watch and callbacks to
invoke in the config.yaml file
Change-Id: I3fa2ea1520649120b927c0cb83a16e5cace2f24e
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clients specify the object paths to watch in the config yaml.
Example yaml file and parser changes are pushed in separate
patch
Callbacks are invoked based on the watch type created i.e
interfaceadded/interfaceremoved
Change-Id: Icb7b9bf4c072f8b8df33747c813a1f07b61de637
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added callback support for SNMP events.
Parse the callback message and raise SNMP trap
Clients specify the object paths to watch and callbacks
to invoke in the config yaml.
Change-Id: I105652f65e4e1c5354c934c88e4d59866540f71c
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recently changes has been done in phosphor-logging commit
method causing the unit test failure with error message
"Error in mapper call". Earlier commit method
used to return error but the same has been modified to throw
exception now.
Fixed to return from the callback method if context is
start
Change-Id: I606c638bd2d0bc2003af0b284586e53809bbca21
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
|
|
|
|
|
| |
Change-Id: I7a053eed057175f0531387e8cef1dc3fd9558dba
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
|
|
|
|
|
|
|
|
| |
Persist event D-bus objects using cereal
Resolves openbmc/openbmc#2319
Change-Id: Ifa15d944fe1d1026761f65eeb647dcbdf6afdba0
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
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: I78f191f26da14203dc21c97d4fc4a31f95ffc95f
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
| |
Fix up errors and enable clang-format during CI builds.
Change-Id: I4176b81f8b85a287af9354165e09ff66aeb9fb29
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
| |
Add constants for use with std::get.
Tested: Run unit tests
Change-Id: Ic09c13feeda69d61c98f63d227cae8f08d1bf50e
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This callback class will create an error log with
exactly 1 metadata field, which takes a string. This
metadata field will be filled in with the property paths,
names, and values of the properties that passed the
condition checks that caused the callback to be called
in the first place.
Tested: Ran with YAML rules that used this callback and
checked that everything worked as specified.
Change-Id: Ib37206c63385939c583a09e7ba979d6e016691f6
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
std::function is not found with a GCC 7.3 runtime.
Change-Id: I4e5289794d405c42ab6291c211289d1ab175b197
Tested: Built repository with GCC 7.3
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The CountCondition class checks each property in its
index against some condition. Save the result of each
of those checks in the 2nd tuple element of the storage
entry for that property so that other code may access it.
Tested: Build and run unit tests
Change-Id: Ie99f02062c28d003e588a43bf042ecd2834ad9b2
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This array was originally just an array of objects of
type 'any'. This commit changes it to be an array of
tuples of type <any, any> to add an extra field for
use by anything that needs it.
For example, the storage is currently used to store
property values, and a future change to the CountCondition
class will now also store the result of the comparisons done
between the property values and another value specified in
the rule YAML. Then, a callback will be able to see the
result of whether each property passed the check.
Tested: Build and run unit tests
Change-Id: I58f32c9f4068b15a02b1ff7f28871161cafebddb
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a count condition is a oneshot, it will only
trigger the callback the first time the condition
is true. The condition needs to evaluate to false
at least once to rearm the callback.
A use case for this would be when a group of properties
is being watched for a subset of them hit a certain value.
Even though every properties changed signal for every property
in the group would check the condition, only the first time
the condition is true would the callback be issued.
This behavior is specified with a 'oneshot: true' entry in
the YAML. If not present, it defaults to false which is
the original behavior.
Tested: Verify this does indeed do what is advertised by
modifying condition rules to consistently pass
and checking behavior.
Change-Id: Ie185621e86c605234bf329a5f38317267dbb6fb6
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Delete the oldest event of the same type
if a particular type of event reaches threshold.
Resolves openbmc/openbmc#2254
Change-Id: I2692193a027e82032f1d336515691de913bbb726
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Implement the logging event interface.
Create the dbus event object based on the event type.
Change-Id: Idfa9e5c43f170d904fd25f22d73e0509b1785fc9
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
On handling of property change event, If callback is
of type event then event manager would be asked to create
the event dbus objects.
Change-Id: I7f1d365d7f44a1cca54516e9ef555bb132d6b063
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When event call back is called,There could be two context
1) As part of actual D-bus signal
2) During startup of dbus-monitor
if event call back is called with context as startup then
don't take any action.
Corrected the index value to fetch the property name.
Change-Id: Ifaae33dc78841c8f771fe3788e75f79d9de6ec12
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the notion of a callback context. This enables callbacks
to have logic around the conditions they were invoked in.
There are two context on which call back can be invoked
1) Startup: during startup all the call backs will be called
2) Signal: As part of condition match on the watched properties.
Callback would behave differently based on the context.
eg: eventCallback
1) Startup: Don't take any action.
2) Signal: Create the Dbus Object for the event.
Change-Id: If455558798ac3e44bbd8a93de0ce1b09d2e308ae
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Change-Id: I16cbfa2a3ed646f3ca0aeee0e71b3ada39062941
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
| |
Change-Id: I9f21e6378f74bf9dd7d413557a80b47ec9c9f829
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
| |
Change-Id: Ie80bff38947a79cc686eaf9db9c80453d28a4fb6
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
| |
The callout to resolve is specified in the YAML.
Change-Id: If613fae1959c6a54279b2a50c7d858f3e7d831b9
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|