| 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: I2f61cbda4721533610516c0c91da4b3a16d15b52
|
|
|
|
|
|
|
|
| |
Use the defaults in the pkg check where the default error message is
sufficient to identify which package is missing.
Change-Id: I91e5407066976b4d03e8a6b8d105e9bb8aecf5f7
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Systemd timedated from v236 to v239 introduces a behavior change related
to setting time while NTP setting is changed.
This change causes phosphor-time-manager automation test failure.
Add a special note in README to describe the issue, and the test case
will be updated.
Partially resolves openbmc/openbmc#3459
Change-Id: I8ee31e8de95d8b110bf9cbee7973c377a6d4330a
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Starting with sdbusplus 8ca6025, calling bus_new_default multiple times
doesn't seem to work - making calls that generate dbus traffic on one
of the objects results in something like:
sd_bus_call: System.Error.ENOTCONN: Transport endpoint is not connected
This wasn't ideal anyway - move to a single object, shared
application-wide.
Tested: Booted a witherspoon QEMU image and there were no coredumps
Change-Id: I804a1b1438b22f48e45b26d395135e401ca98a06
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
| |
Phosphor-logging is picked up by the configure_ac.
Include it in the Makefile such that it's available
as defined by the pkgconfig.
Change-Id: I173fa376ab3419155267ab08350d7a7ad2e1a0f0
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
| |
We need to conform to the std::variant interface instead of the mapbox
specific one.
Change-Id: I3edbcb2682ddfebfcbca6e75284b11f2e18cfd11
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To enable link time optimization, several configures needs to be
changed:
1. Add -flto in Makefiles
2. Use C++17 to get inline constexpr
3. Use gcc-ar and gcc-ranlib to generate static library, otherwise it
gets link errors.
Tested: Build OK and unit tests passes.
Change-Id: Ic58cbfb631c97f43c82d5669cbf6ac1ebc5e0ab9
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The timeOwner/Mode in Manager class has no init value, and it is
initialized with the cached time owner/mode in file system.
In most of time it is OK because there is cached time owner/mode.
But if the BMC does a factory reset, the cached values are cleaned up,
and in next reboot the timeOwner/Mode will not be initialized at all.
The fix is to give default time owner/mode, so when BMC comes from
factory reset it uses default time settings.
Tested: Verify the timeOwner/Mode have correct init values after factory
reset.
Change-Id: Ib1a8fba4d758f33ed09a7afdc9ed684867fca1c5
|
|
|
|
|
|
|
|
|
|
|
|
| |
sdbusplus now throws SdBusError exception when a sd bus call fails.
When setting NTP via systemd timedatectl service, it may potentially
fail.
So handle this exception.
Also fix a typo in logging, where it should use `=` in meta.
Change-Id: I6c5669b7f06cef47c8d62cb0cbcb0c7fbd2a46e7
Tested: Verify it sets NTP setting OK.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sdbusplus now throws SdBusError exception when a sd bus call fails.
When setting time via systemd timedatectl service, it may fail to set
time due to time settings.
So handle this exception and print the reason.
Tested: Verify this service does not crash but prints the exception in
journal log, when it fails to set time to systemd.
Change-Id: I7d3b2e35e58c3924f95d3664653e68efbae8bd14
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously it reports InsufficientPermission when it is not allowed to
set time.
Now phosphor-dbus-interfaces defines proper errors for such case, so
report NotAllowed error when it is not allowed to set time, and report
Failed error when it failed to set time.
Tested: Get NotAllowed and Failed error with expected metadata from
journal log.
Change-Id: I53610bf27ffc3f62608cea6fd0e66ca859d94675
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
As suggested, when error occurs in getService/getProperty, it means
runtime error, so the code is better to throw std::runtime_error instead
of a sdbusplus exception.
Tested: Build the code correctly.
Change-Id: Iddca72ac1fdd07ed6b731b6509eebbfa9d2579d3
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The test Makefile.am was using -lgmock -lgmock_main directly, which
cause link issues on compiling test.
Fix this by using the flags specified by gtest package.
Tested: Verify the CI passes build.
Change-Id: Id51134d7e2696e18f7439f15f8d899edba51856e
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When it is not allowed to set time depending on the time setting,
previously we only log an error and continue.
Now sdbusplus supports errors on properties, so we can throw exception
on such case.
Tested: Verify in unittest that exception is thrown when it is not
allowed to set time.
Verify in BMC that busctl gets the error message when it is not
allowed to set time.
Change-Id: I4a04d1aa8c081abf0f9fd449118dc1107e12f689
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
| |
Change-Id: Idb13c9ab2e30cb6fb5d9e14da604b6e4c133c8a2
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patchset updates phosphor-time-manager to follow secure coding
guidelines when interacting with the mapper. Specifically, it replaces
uses of std::map with std::vector<std::pair<>>, which should net some
small performance wins. This change also causes time-manager to
properly enumerate each response.
Tested-By:
Built with changeset, and verified via d-feet that
/xyz/openbmc_project/time/host and /xyz/openbmc_project/time/bmc were
present, and verified reading of the "Elapsed" parameter returned the
expected time result.
Change-Id: If4329d533641595cf0b50c4e50e2dda69b299f52
Signed-off-by: Ed Tanous <ed.tanous@intel.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: I049799e380299bd4290e8f31f2f2c0186c460351
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
I found myself looking around for the appropriate curl and
busctl commands to configure the time on OpenBMC. I figured
them out so figured I'd share. This README was very useful
for getting the basics down.
Change-Id: I48105d09f2c7afe065ed76c3e27f73e42d0e7807
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The time tests find an issue that after NTP/BMC is changed to
NTP/Split, setting BMC time will cause host time change.
The root cause is that it fails to set BMC time (which is expected)
but still invokes notifyBmcTimeChange(), which cause host to
re-calculate the offset.
The fix is to not invoke notifyBmcTimeChange() on failure to set BMC
time.
Change-Id: Id13b5fa8ba7def764eab8afad23661f9b0be37ce
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The time tests find an issue that when owner is set to Split, and
then set the BMC time, the host time becomes incorrect.
The root cause is that the diff between host time and steady clock is
not updated when the owner is changed to Split, and thus when BMC
time is changed, the host time is calculated incorrectly.
The fix is to re-calculate the diff between host time and steady clock
in this case.
Resolves openbmc/openbmc#901
Change-Id: Ida22f27c6adba6b1cf8a41274eb5f26b6f1bdab7
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
| |
Change-Id: Ia840360c00cc8d7baaafd797ae2411bc5cc03ed3
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
| |
Change-Id: Iaa1c4bc0680c5b0a0cf512e0c61f6b8241070551
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
| |
Github flavored markdown requires a blank line between text and table.
Change-Id: I55d6b964b9fb699e7b7a57cbd3b8f7b54a617947
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
Dhcp ntp related functions are now implemented by new network daemon
(phosphor-network-manager), so time manager does not need to handle the
setting anymore.
Remove all the code related to use_dhcp_ntp.
Change-Id: Iea7f60dbe9558193585d3cd553dec15bbfe2aaa4
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
| |
In NTP mode, let timedate1 to set BMC time, for now, it results in
error.
Change-Id: I2d78cdcfe6868642f43198dd932b20b13fd8523d
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Use elog to throw exceptions and update unit tests
Change-Id: I338ded4403b3b559a84da311eda5ee15e712569a
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
| |
1. Add Internal.errors.yaml to define repo specific errors
2. Update configure.ac and Makefile.am to generate code from error yamls
3. Add elog-gen.hpp generated by elog-gen.py
Change-Id: I6858f2c9f3c2100ce106d1effe7ad3f340117fec
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Use objectMapper to find the service name instead of using
hard-coded service name.
Change-Id: If436c65d9a9a4942eaf30ea20bc7b85e3e7694c1
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Change-Id: Ieb667636963722d54dba93850dd0e3396e1e83c1
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Change-Id: I3988740e3666401b4f272f83080edfe7f92513be
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. When setting host epoch, follow below logic:
Mode | Owner | Set Host Time
----- | ----- | -------------
NTP | BMC | Not allowed
NTP | HOST | Not allowed
NTP | SPLIT | OK, and just save offset
NTP | BOTH | Not allowed
MANUAL| BMC | Not allowed
MANUAL| HOST | OK, and set time to BMC
MANUAL| SPLIT | OK, and just save offset
MANUAL| BOTH | OK, and set time to BMC
2. If owner is SPLIT and BMC time is changed, update the offset accordinly;
3. Use timerfd to get notified on BMC time change, and update host time
diff accordingly;
4. Add unit test cases.
Change-Id: I2d60a821f7da9b689c579ae7ab672cc37967322c
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Pgood indicate if host is on, which will be used to handle the time
mode/owner changes.
Change-Id: I7be4f7300aca3d1adc118eb3eb447c1e3734c89f
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When host time is set, the diff between the BmcTime and the value is
saved to persistent storage;
When host time is retrieved, return the BmcTime plus the diff as
host's time.
Add the unit test cases for HostEpoch.
Change-Id: Ia55b93bfcba4f226ceaed8491136ea7afda7bd77
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Getting elapsed returns BMC's time;
Setting elapsed will check the current time mode/owner, and will return
error when mode is NTP or owner is HOST.
Add unit test cases.
Change-Id: Ibf4e90957f3b26b68c4a1b6dc66dc364c66bef10
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
| |
This will ignore all automake output, built binary and
unit-test related files.
Change-Id: I4a6d172838850881f47687d464c5f67269b129a7
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
Add BmcEpoch which inherits EpochBase and will handle times for BMC,
it is partly implemented.
Add unit test cases to test basic functions.
Change-Id: Ia5e4d0f884156d238f3f84df490a2efbce43e89a
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
phosphor-time-manager will be refactored to use sdbusplus interfaces.
This is a initial commit that EpochBase is implemented based on dbus
interface xyz/openbmc_project/Time/EpochTime.interface.yaml.
EpochBase is the base class that wraps EpochTime interface, and is
initialized with time mode and owner from settingsd.
An initial unit test case is added.
Change-Id: Ic944b70f63ec3c0329762cc8874f0f57b09ddce3
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
| |
Change-Id: I0b0a9a70fcd8f1eb0f366bb2daf3d1fe77f3d648
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
|
| |
Add API to retrieve all settings objects of interest to the time
manager.
Change-Id: I3d121c08d0156cf481a3468e6c7ca9b71f53d666
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If NTP is set, SetTime from timedate1 service throws
a standard error. Current code was throwing a custom error
and it was not much helpful. Correct thing is to re-throw
what timedate1 throws.
Also, current code was gating the SetTime request if the
time mode was NTP. This has been removed now and the decision
is left to timedate1 service now on whether to allow setting
the time or not when NTP is enabled.
Change-Id: I2b132bcea57f5181198dfe0c3635666bc8d7c070
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
|