PEL: Update check for identifying I2C dev paths
Due to changes in the kernel, I2C device paths changed slightly and so
the code that identifies if a device path passed in for a callout is for
an I2C device needs an update.
An example of a new canonical device path is:
```
/sys/devices/platform/ahb/1e780000.apb/1e780000.apb:bus@1e78a000/1e78a200.i2c/i2c-3/3-006d
```
Tested:
Creating a PEL with CALLOUT_DEVICE_PATH=/sys/bus/i2c/devices/3-006d on
an IBM Everest system generates a proper callout, as shown in this
captured PEL debug UserData section:
```
"I2C: bus: 3 address: 109 dest: /sys-0/node-0/bellavista-0/Power-riser-conn-0/Fansipan-0/power-supply-conn-2/power-supply-0/power-supply-blackbox-0"
```
Change-Id: I4efb9135982f417560172df99dfe36f98e3a9696
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/test/openpower-pels/device_callouts_test.cpp b/test/openpower-pels/device_callouts_test.cpp
index ec8e182..97076df 100644
--- a/test/openpower-pels/device_callouts_test.cpp
+++ b/test/openpower-pels/device_callouts_test.cpp
@@ -322,7 +322,7 @@
{
EXPECT_EQ(util::getCalloutType(
"/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/"
- "1e78a340.i2c-bus/i2c-14/14-0072"),
+ "1e78a340.i2c/i2c-14/14-0072"),
util::CalloutType::i2c);
}
@@ -361,7 +361,7 @@
{
EXPECT_EQ(util::getI2CSearchKeys(
"/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/"
- "1e78a340.i2c-bus/i2c-10/10-0022"),
+ "1e78a340.i2c/i2c-10/10-0022"),
(std::tuple{10, 0x22}));
EXPECT_EQ(util::getI2CSearchKeys(
@@ -480,7 +480,7 @@
{
auto callouts = getCallouts(
"/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/"
- "1e78a340.i2c-bus/i2c-14/14-0072",
+ "1e78a340.i2c/i2c-14/14-0072",
systemTypes);
std::vector<Callout> expected{
@@ -498,7 +498,7 @@
EXPECT_THROW(
getCallouts(
"/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/"
- "1e78a340.i2c-bus/i2c-14/14-0099",
+ "1e78a340.i2c/i2c-14/14-0099",
systemTypes),
std::invalid_argument);
@@ -506,7 +506,7 @@
EXPECT_THROW(
getCallouts(
"/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/"
- "1e78a340.i2c-bus/i2c-0/0-005a",
+ "1e78a340.i2c/i2c-0/0-005a",
systemTypes),
std::runtime_error);
}