add handler logic to handle SysCableCheck
Add handler logic to handler for SysCableCheck such that it splits the
true IPMI processing from the business logic.
Tested: Only ran unit-tests (added new ones).
Change-Id: Ieec35cc8839dcd3cfb864b68ffbd1a45d1326fee
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/handler_unittest.cpp b/test/handler_unittest.cpp
index 05edc0a..c1f4093 100644
--- a/test/handler_unittest.cpp
+++ b/test/handler_unittest.cpp
@@ -1,3 +1,4 @@
+#include "errors.hpp"
#include "handler.hpp"
#include <string>
@@ -20,6 +21,12 @@
EXPECT_STREQ("eth0", std::get<1>(result).c_str());
}
+TEST(HandlerTest, CableCheckIllegalPath)
+{
+ Handler h;
+ EXPECT_THROW(h.getRxPackets("eth0/../../"), IpmiException);
+}
+
// TODO: Add checks for other functions of handler.
} // namespace ipmi