Patrick Venture | 2e12a43 | 2018-12-13 18:05:11 -0800 | [diff] [blame] | 1 | #include "internal_sys_mock.hpp" |
Patrick Venture | ecfd300 | 2018-12-14 13:57:28 -0800 | [diff] [blame] | 2 | #include "ipmi_errors.hpp" |
Patrick Venture | 2e12a43 | 2018-12-13 18:05:11 -0800 | [diff] [blame] | 3 | #include "ipmi_handler.hpp" |
| 4 | |
| 5 | namespace host_tool |
| 6 | { |
| 7 | |
| 8 | using ::testing::_; |
| 9 | using ::testing::Return; |
| 10 | |
| 11 | TEST(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 Venture | ecfd300 | 2018-12-14 13:57:28 -0800 | [diff] [blame] | 18 | EXPECT_THROW(ipmi.open(), IpmiException); |
Patrick Venture | 2e12a43 | 2018-12-13 18:05:11 -0800 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | } // namespace host_tool |