summaryrefslogtreecommitdiffstats
path: root/test/TestManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* clang-format: Update to match docs repoGunnar Mills2018-10-081-69/+60
| | | | | | | | | Update the .clang-format file and run clang-format-6.0. This .clang-format matches the example one in https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting Change-Id: Ic2c462525eb27b8295c2b298871e04268d93faf2 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Spelling fixesGunnar Mills2017-10-251-2/+2
| | | | | Change-Id: Ia840360c00cc8d7baaafd797ae2411bc5cc03ed3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Use host state object to check if host is onLei YU2017-10-161-10/+10
| | | | | | | | | The code was using pgood to determine if host is on or off. Now we have host state object, which is a more appropriate way to check host on/off. So change pgood related code to use host state object. Change-Id: I553c1a40922ca2e8bc6904688c55e85971bd4720 Signed-off-by: Lei YU <mine260309@gmail.com>
* Use new settings APILei YU2017-10-161-11/+11
| | | | | | | | The new time manager code was using the old settings daemon. Now it uses the new settings API. Change-Id: Id551d97c28a6cfbb81c87118b26292b1b5574e93 Signed-off-by: Lei YU <mine260309@gmail.com>
* Use time mode owner enums in dbus interfaceLei YU2017-10-161-29/+55
| | | | | | | | | | | Dbus interface defines time mode owners in xyz::openbmc_project::Time. Use the enums from the interface instead of repo defined enums and use the generated code to do convertions between strings and enums. Update unit tests accordingly. Change-Id: Ic304aa3b4137375d208bb1702e0f64df512fc5a0 Signed-off-by: Lei YU <mine260309@gmail.com>
* Change default time mode/owner to MANUAL/BOTHLei YU2017-10-161-2/+4
| | | | | | | | | | OPAL gets error on setting host time because the default time mode/owner is NTP/BMC, which disallows host to set its time. As discussed and requested by OPAL, change the default time mode/owner to MANUAL/BOTH. Change-Id: Ide55f970b66f3025f67ad2ef093a74a3c8f8b8ea Signed-off-by: Lei YU <mine260309@gmail.com>
* Implement mode/owner and string conversionsLei YU2017-10-161-36/+4
| | | | | | | | | | Move Manager::convertToMode() to utils::strToMode(); Move Manager::convertToOwner() to utils::strToOwner(); Add utils::modeToStr() and utils::ownerToStr(); Adjust and add unit tests. Change-Id: Ied35d0e732c477017e1b2db1a3464b0425b12387 Signed-off-by: Lei YU <mine260309@gmail.com>
* Use gmock on property_change_listenerLei YU2017-10-161-9/+81
| | | | | | | | | | | | | 1. Mock property_change_listener; 2. Make unit test link against gmock 3. Update TestManager to use mocked property change listener. 4. Fix an issue found by the updated test case, that when the properties are changed during host is on, and changed back to the same as before, when host becomes off, the properties shall remain the same and listeners shall not be notified. Change-Id: I815b59cb23edfcac910c2a8c26ea5a71e872d92f Signed-off-by: Lei YU <mine260309@gmail.com>
* Invoke SetNTP and UpdateUseNtpField in time managerLei YU2017-10-161-0/+3
| | | | | | | | | | | 1. When time mode is changed, invoke systemd timedate1's SetNTP method to update NTP settings; 2. When settings use_dhcp_ntp property is changed, invoke NetworkManager's UpdateUseNtpField method to update its setting; 3. Move the common code of getProperty() into utils.hpp Change-Id: I981e0e9de9c0430282b3364c38c282312bb2be89 Signed-off-by: Lei YU <mine260309@gmail.com>
* Save properties to persistent storage when host is onLei YU2017-10-161-0/+63
| | | | | | | | | | | | 1. When host is on, set properties as requested properties instead of notify listeners; 2. When host becomes off, and requested properties are not empty, notify the listners and reset the requested properties. Add unit tests. Change-Id: I9359c801c698df0c6e5eab43e12427bb5a6da611 Signed-off-by: Lei YU <mine260309@gmail.com>
* Add time Manager to handle property changes callbackLei YU2017-10-151-0/+76
1. Implement time::Manager who registers property change signal for time mode and owner; 2. Add PropertyChangeListner interface to handle the callback; 3. Make EpochBase to implement the interface. Change-Id: I185580ae37353e1ed82a47e4905fb22e269ac09d Signed-off-by: Lei YU <mine260309@gmail.com>
OpenPOWER on IntegriCloud