Patrick Venture | 8ec019f | 2018-08-07 11:22:33 -0700 | [diff] [blame^] | 1 | #include "flash-ipmi.hpp" |
| 2 | |
| 3 | #include <cstdio> |
| 4 | #include <gtest/gtest.h> |
| 5 | #include <string> |
| 6 | |
| 7 | #define THIRTYTWO_MIB 33554432 |
| 8 | |
| 9 | TEST(FlashIpmiStartTest, VerifiesFieldsAndAction) |
| 10 | { |
| 11 | // The interface does not currently support failure injection, so let's |
| 12 | // simply verify it does what we think it should. |
| 13 | |
| 14 | std::string name = std::tmpnam(nullptr); |
| 15 | |
| 16 | FlashUpdate updater(name); |
| 17 | updater.start(THIRTYTWO_MIB); |
| 18 | |
| 19 | auto file = std::fopen(name.c_str(), "r"); |
| 20 | EXPECT_TRUE(file); |
| 21 | std::fclose(file); |
| 22 | (void)std::remove(name.c_str()); |
| 23 | } |