Remove TimeOwner Feature

The TimeOwner feature is confusing from feedback from the community and
hence removing the feature.
Remove the TimeOwner feature in the phosphor-time-manager repo and
needed settings objects.

Tested: Manually set the date time on the web and successfully update
        the date time of BMC (eg: 2020/01/01 08:07:50).
        busctrl get-property xyz.openbmc_project.Time.Manager
                /xyz/openbmc_project/time/bmc
                xyz.openbmc_project.Time.EpochTime Elapsed
        t 1577837156385836

Refer: https://lists.ozlabs.org/pipermail/openbmc/2020-April/021409.html

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Id47eb0a03e0e94eeff29d2b77dccefb89cded7b8
diff --git a/test/TestBmcEpoch.cpp b/test/TestBmcEpoch.cpp
index eb116e5..db43854 100644
--- a/test/TestBmcEpoch.cpp
+++ b/test/TestBmcEpoch.cpp
@@ -1,12 +1,10 @@
 #include "config.h"
 
 #include "bmc_epoch.hpp"
-#include "mocked_bmc_time_change_listener.hpp"
 #include "types.hpp"
 
 #include <memory>
 #include <sdbusplus/bus.hpp>
-#include <xyz/openbmc_project/Time/error.hpp>
 
 #include <gtest/gtest.h>
 
@@ -15,16 +13,13 @@
 namespace time
 {
 
-using ::testing::_;
 using namespace std::chrono;
-using NotAllowed = sdbusplus::xyz::openbmc_project::Time::Error::NotAllowed;
 
 class TestBmcEpoch : public testing::Test
 {
   public:
     sdbusplus::bus::bus bus;
     sd_event* event;
-    MockBmcTimeChangeListener listener;
     std::unique_ptr<BmcEpoch> bmcEpoch;
 
     TestBmcEpoch() : bus(sdbusplus::bus::new_default())
@@ -33,7 +28,6 @@
         sd_event_default(&event);
         bus.attach_event(event, SD_EVENT_PRIORITY_NORMAL);
         bmcEpoch = std::make_unique<BmcEpoch>(bus, OBJPATH_BMC);
-        bmcEpoch->setBmcTimeChangeListener(&listener);
     }
 
     ~TestBmcEpoch()
@@ -47,14 +41,6 @@
     {
         return bmcEpoch->timeMode;
     }
-    Owner getTimeOwner()
-    {
-        return bmcEpoch->timeOwner;
-    }
-    void setTimeOwner(Owner owner)
-    {
-        bmcEpoch->timeOwner = owner;
-    }
     void setTimeMode(Mode mode)
     {
         bmcEpoch->timeMode = mode;
@@ -67,9 +53,8 @@
 
 TEST_F(TestBmcEpoch, empty)
 {
-    // Default mode/owner is MANUAL/BOTH
+    // Default mode is MANUAL
     EXPECT_EQ(Mode::Manual, getTimeMode());
-    EXPECT_EQ(Owner::Both, getTimeOwner());
 }
 
 TEST_F(TestBmcEpoch, getElapsed)
@@ -80,18 +65,6 @@
     EXPECT_GE(t2, t1);
 }
 
-TEST_F(TestBmcEpoch, setElapsedNotAllowed)
-{
-    auto epochNow =
-        duration_cast<microseconds>(system_clock::now().time_since_epoch())
-            .count();
-
-    // In Host owner, setting time is not allowed
-    setTimeMode(Mode::Manual);
-    setTimeOwner(Owner::Host);
-    EXPECT_THROW(bmcEpoch->elapsed(epochNow), NotAllowed);
-}
-
 TEST_F(TestBmcEpoch, setElapsedOK)
 {
     // TODO: setting time will call sd-bus functions and it will fail on host
@@ -99,12 +72,5 @@
     // But for now we can not test it
 }
 
-TEST_F(TestBmcEpoch, onTimeChange)
-{
-    // On BMC time change, the listner is expected to be notified
-    EXPECT_CALL(listener, onBmcTimeChanged(_)).Times(1);
-    triggerTimeChange();
-}
-
 } // namespace time
 } // namespace phosphor