Fix error attribute naming for Linux 5.0
There was a slight change to one of the error attributes as part of the
OCC driver upstreaming process. This commit also adds unit tests for the
error attributes. This required some refactoring to support the unit
tests.
Resolves openbmc/openbmc#3505
Signed-off-by: Eddie James <eajames@us.ibm.com>
Change-Id: I665b46e44b18befc8a728f7246bcda82f1f1a71c
diff --git a/occ_status.hpp b/occ_status.hpp
index 9e6c687..859b5b0 100644
--- a/occ_status.hpp
+++ b/occ_status.hpp
@@ -65,9 +65,10 @@
instance(((this->path.back() - '0'))),
device(event,
#ifdef I2C_OCC
- i2c_occ::getI2cDeviceName(path),
+ fs::path(DEV_PATH) / i2c_occ::getI2cDeviceName(path),
#else
- sysfsName + "." + std::to_string(instance + 1),
+ fs::path(DEV_PATH) /
+ fs::path(sysfsName + "." + std::to_string(instance + 1)),
#endif
manager, *this,
std::bind(std::mem_fn(&Status::deviceErrorHandler), this,