blob: 81c2d452b4617e9c4d0638886ad9702307614219 [file] [log] [blame]
#include "flash-ipmi.hpp"
#include <cstdio>
#include <gtest/gtest.h>
#include <string>
#define THIRTYTWO_MIB 33554432
TEST(FlashIpmiStartTest, VerifiesFieldsAndAction)
{
// The interface does not currently support failure injection, so let's
// simply verify it does what we think it should.
std::string name = std::tmpnam(nullptr);
FlashUpdate updater(name, "");
updater.start(THIRTYTWO_MIB);
auto file = std::fopen(name.c_str(), "r");
EXPECT_TRUE(file);
std::fclose(file);
(void)std::remove(name.c_str());
}