blob: c1f40939395e49960c246306a9ed8d6ea020e5e9 [file] [log] [blame]
Patrick Ventured2037c62019-03-15 10:29:47 -07001#include "errors.hpp"
Patrick Venturef085d912019-03-15 08:50:00 -07002#include "handler.hpp"
3
4#include <string>
5#include <tuple>
6
7#include <gtest/gtest.h>
8
9namespace google
10{
11namespace ipmi
12{
13
14TEST(HandlerTest, EthCheckValidHappy)
15{
16 // The code returns compiled-in information, and therefore cannot really
17 // fail.
18 Handler h;
19 std::tuple<std::uint8_t, std::string> result = h.getEthDetails();
20 EXPECT_EQ(1, std::get<0>(result));
21 EXPECT_STREQ("eth0", std::get<1>(result).c_str());
22}
23
Patrick Ventured2037c62019-03-15 10:29:47 -070024TEST(HandlerTest, CableCheckIllegalPath)
25{
26 Handler h;
27 EXPECT_THROW(h.getRxPackets("eth0/../../"), IpmiException);
28}
29
Patrick Venturef085d912019-03-15 08:50:00 -070030// TODO: Add checks for other functions of handler.
31
32} // namespace ipmi
33} // namespace google