blob: d0c9911741b7d355bda8f2f8cc2c3158afd820fe [file] [log] [blame]
Patrick Venture2e12a432018-12-13 18:05:11 -08001#include "internal_sys_mock.hpp"
Patrick Ventureecfd3002018-12-14 13:57:28 -08002#include "ipmi_errors.hpp"
Patrick Venture2e12a432018-12-13 18:05:11 -08003#include "ipmi_handler.hpp"
4
5namespace host_tool
6{
7
8using ::testing::_;
9using ::testing::Return;
10
11TEST(IpmiHandlerTest, OpenAllFails)
12{
13 /* Open against all device files fail. */
14 internal::InternalSysMock sysMock;
15 IpmiHandler ipmi(&sysMock);
16
17 EXPECT_CALL(sysMock, open(_, _)).WillRepeatedly(Return(-1));
Patrick Ventureecfd3002018-12-14 13:57:28 -080018 EXPECT_THROW(ipmi.open(), IpmiException);
Patrick Venture2e12a432018-12-13 18:05:11 -080019}
20
21} // namespace host_tool