summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* rsyslogd: don't start without actionsDeepak Kodihalli2019-01-111-4/+17
| | | | | | | | | | | | | Rsyslog is currently used only for remote logging. The daemon would run though (started by systemd) even when remote logging has not been configured. In other words, it would run without any actions. With Yocto 2.6, rsyslogd won't run without any actions. Hence, rsyslogd is now started only on the condition that the remote logging config file is present. Change-Id: Iae11d6912e60765ecb774b663d44b4e3c6f381a3 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* test: add test to force building of sdjournal mockPatrick Venture2018-12-042-1/+24
| | | | | | | | Add test to force building of sdjournal mock. This will ensure it won't break down chain users later. Change-Id: Ida9745595af251df800ec8e98abaa39728c9ba86 Signed-off-by: Patrick Venture <venture@google.com>
* test: use only one main libraryPatrick Venture2018-12-031-1/+1
| | | | | | | Use only gtest_main or gmock_main. Change-Id: Ib6b8347560ff20d5d062baec807b1590050627c3 Signed-off-by: Patrick Venture <venture@google.com>
* add sdjournal interface to inject testsPatrick Venture2018-11-111-2/+5
| | | | | | | | The goal of the tests is not to test phosphor-logging, but rather allow code to call through phosphor-logging/log<> during a test. Change-Id: Id8c84ded473decc7f9f0be268116083093f86e54 Signed-off-by: Patrick Venture <venture@google.com>
* minor cleanup, std namespacingPatrick Venture2018-11-011-1/+2
| | | | | | | Added std namespace to places where there is a cpp version. Change-Id: I60a05a7c9cdcd79cfffc3c4968005fcbe34acf81 Signed-off-by: Patrick Venture <venture@google.com>
* add .clang-formatPatrick Venture2018-10-269-148/+120
| | | | | Change-Id: I2c36b7886a25d0b235693b0776019d29608e1d52 Signed-off-by: Patrick Venture <venture@google.com>
* log_manager: Don't fail on missing synced fileAdriana Kobylak2018-09-051-0/+3
| | | | | | | | | | | | | | | | | | | | | The journald synced file is created during a journal sync, so if it's missing, the log manager should still perform the sync operation so that the synced file gets created. This is the behavior of journalctl which this function is copying, just this logic wasn't transferred in the original commit. Reference: https://github.com/systemd/systemd/blob/60118b21c6b4b29376615921c5edc1b05cde306f/src/journal/journalctl.c#L1999 Disabled the unit test cases that call commit since they now fail. Opened issue openbmc/phosphor-logging#11 for debug. Closes openbmc/phosphor-logging#10 Tested: With the synced file missing, verified that a commit operation created the file and there were no error messages about failing to open the synced file. Change-Id: Ia720741b99552d51d13cdc6b4e08dbbab58bca77 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* phosphor-rsyslog-conf: add unit testsDeepak Kodihalli2018-08-312-1/+68
| | | | | | | Add tests pertaining to remote logging config file. Change-Id: Idaeac09b5abe91af30dc0eb32664e8af556ecda2 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* phosphor-rsyslog-conf: add unit testsDeepak Kodihalli2018-08-314-1/+128
| | | | | | | Add tests related to setting remote server IP address and port. Change-Id: I35ac539a8316d34245ee6b1abcb9f48c1ebe5095 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Add unit tests for the phosphor-logging serverNagaraju Goruganti2018-08-084-12/+150
| | | | | | | -Add unit tests for error wrapping Change-Id: Ib15620d84de8ab5abdc85b8f88dd7c05f83fd6f3 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Add the BMC code version to error logsMatt Spinler2018-05-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Add the xyz.openbmc_project.Software.Version interface to the elog entries. This allows a user to know what BMC code level was running when the error was created. The level is persisted along with the other elog fields. If this code is flashed on a system that was running older code, and there were existing error logs, the version property will be left empty in the restored log entries. Older code is still able to restore logs created by this code as the version property is at the end of the serialized data and so is just ignored by Cereal. Resolves openbmc/openbmc#3133 Tested: Check that new error logs have the code level, and that restarting phosphor-log-manager preserves that property on the existing logs. Various incantations of running the older code with logs created by this code, and running this code with logs created by older code. Change-Id: I682aa3bf97c8352ce6dda05dfdf55d33173de891 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add implementation for delete all error log entries in one shotNagaraju Goruganti2017-09-131-1/+1
| | | | | | | Resolves openbmc/openbmc#1561. Change-Id: Iac5aaee1bdf9b87ccce9bf8801468ac5a8f9be6c Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* serialization: add testsDeepak Kodihalli2017-06-264-9/+176
| | | | | | | Resolves openbmc/openbmc#1684. Change-Id: Ia554147001e51b05fe8692ae0b39e3efaf481130 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Removes header files from base dir of phosphor-loggingSaqib Khan2017-02-241-1/+1
| | | | | | | | | | | Note: The header files have been moved to the phosphor-logging dir and all other repositories must include the header files from there. Resolves openbmc/openbmc#938 Change-Id: I0faf0545a42c571da93fe4f3731ee7c939e3aff8 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Add in test case which validates elog client interfaceAndrew Geissler2016-10-313-46/+19
| | | | | Change-Id: I5c5f7a550a8f272251893ff616408c41d32281f9 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Error / Event Log FrameworkAdriana Kobylak2016-10-311-0/+46
Framework to create an error log entry based on information from the journal log. 1. elog.yaml - User defined reason codes for error scenarios that include description, priority level, and desired metadata fields. 2. elog_parser.py - Parser for the yaml file 3. elog-gen.hpp - Auto-generated file based created by the parser that includes the error log structures. Including for now for ref. 4. elog.hpp - Error log template to create (log a journal log entry with the predefined error log information). Usage: elog<RC>(NAME(value), prev_entry<NAME>()...) where RC - Reason code, NAME - metadata name being logged to a journal entry, prev_entry - A Metadata entry that has previously being logged to a journal entry. Example: log<level::DEBUG>( msg("Info trace to log filename"), entry(file_not_found::file_name::str, my_filename)); elog<file_not_found>(file_not_found::errnum(2), file_not_found::file_path("/tmp/"), prev_entry<file_not_found::file_name>()); Change-Id: Ic51cee80b58e341c071c366c5e2146fd6694012c Signed-off-by: Adriana Kobylak <anoo@us.ibm.com> Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
OpenPOWER on IntegriCloud