Fix regex in findSensors

swampd crashs while reading configuration. Root caused that it is
introduced by incorrect finding sensors. For an example, when
it searches 'Fan_1' for inputs, it finds these two sensors:

Fan_1
Pwm_PSU1_Fan_1

where 'Pwm_PSU1_Fan_1' is an unexpected search result, so it causes crash
after printing out this message:

"sensor at dbus path [/xyz/openbmc_project/control/fanpwm/Pwm_PSU1_Fan_1]
has an interface [xyz.openbmc_project.Control.FanPwm] that does not match
the expected interface of xyz.openbmc_project.Sensor.Value"

To fix this issue, this commit modifies regex string in findSensors
function.
Unit test is updated to reflect the new behavior.

Tested:
The crash was not observed.
Updated unit test passed.

Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
Change-Id: I4e45fac3a3242a6f3655d6873fd63ef22fd0c4dd
diff --git a/dbus/dbusutil.cpp b/dbus/dbusutil.cpp
index 4ebe65f..9132a60 100644
--- a/dbus/dbusutil.cpp
+++ b/dbus/dbusutil.cpp
@@ -77,7 +77,7 @@
                  std::vector<std::pair<std::string, std::string>>& matches)
 {
     std::smatch match;
-    std::regex reg(search + '$');
+    std::regex reg('/' + search + '$');
     for (const auto& sensor : sensors)
     {
         if (std::regex_search(sensor.first, match, reg))