diff options
| author | Lei YU <mine260309@gmail.com> | 2017-09-01 16:22:40 +0800 |
|---|---|---|
| committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-10-26 01:55:28 +0000 |
| commit | b5259a1e7433e997caf9c90565d8b0012a6e5820 (patch) | |
| tree | 636cf5fb13351799f5712fac7435ffccddbd8be3 /test | |
| parent | 370f06b42bfd1912b3bb64038becdd90292d0f39 (diff) | |
| download | openpower-occ-control-b5259a1e7433e997caf9c90565d8b0012a6e5820.tar.gz openpower-occ-control-b5259a1e7433e997caf9c90565d8b0012a6e5820.zip | |
Add occ_ prefix for i2c occ dbus objects
I2c occ dbus objects path were their i2c addresses, e.g. 3_0050.
This does not indicate it's occ objects, and it does not work with
op-occ-disable/enable services, which searches "occ" key words in object
path.
So add "occ_" prefix for i2c occ dbus objects, e.g. occ_3_0050, to
indicate it's occ objects and work well with op-occ-disable/enable
services.
Change-Id: I21712f2fb7cf6138248f6986b84f99c90c3fa3a2
Signed-off-by: Lei YU <mine260309@gmail.com>
Diffstat (limited to 'test')
| -rw-r--r-- | test/TestI2cOcc.cpp | 6 | ||||
| -rw-r--r-- | test/utest.cpp | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/test/TestI2cOcc.cpp b/test/TestI2cOcc.cpp index 3fb6e6e..c92da5b 100644 --- a/test/TestI2cOcc.cpp +++ b/test/TestI2cOcc.cpp @@ -144,9 +144,13 @@ TEST(TestI2cDbusNames, dbusToI2c) TEST(TestI2cDbusNames, getI2cDeviceName) { - auto path = "/org/open_power/control/4_0050"s; + auto path = "/org/open_power/control/occ_4_0050"s; auto name = getI2cDeviceName(path); EXPECT_EQ(STR_4_0050, name); + + // With invalid occ path, the code shall assert + path = "/org/open_power/control/SomeInvalidPath"s; + EXPECT_DEATH(getI2cDeviceName(path), ""); } } // namespace i2c_occ diff --git a/test/utest.cpp b/test/utest.cpp index 44691c2..9731209 100644 --- a/test/utest.cpp +++ b/test/utest.cpp @@ -11,7 +11,7 @@ class VerifyOccInput : public ::testing::Test bus(sdbusplus::bus::new_default()), rc(sd_event_default(&event)), eventP(event), - occStatus(bus, eventP, "/test/path"), + occStatus(bus, eventP, "/test/path/occ1"), pcap(bus,occStatus) { EXPECT_GE(rc, 0); |

