blob: 9516d468958cec34c15c7a5e95af25e853b54bdb [file] [log] [blame]
Patrick Venture123b5c02019-03-05 14:01:00 -08001#include "internal_sys_mock.hpp"
2
3#include <ipmiblob/ipmi_errors.hpp>
4#include <ipmiblob/ipmi_handler.hpp>
5
6namespace host_tool
7{
8
9using ::testing::_;
10using ::testing::Return;
11
12TEST(IpmiHandlerTest, OpenAllFails)
13{
14 /* Open against all device files fail. */
15 internal::InternalSysMock sysMock;
16 IpmiHandler ipmi(&sysMock);
17
18 EXPECT_CALL(sysMock, open(_, _)).WillRepeatedly(Return(-1));
19 EXPECT_THROW(ipmi.open(), IpmiException);
20}
21
22} // namespace host_tool