blob: b2875611d67ec839fbd4d648badf6641786441c5 [file] [log] [blame]
Patrick Venture8ec019f2018-08-07 11:22:33 -07001#include "flash-ipmi.hpp"
2
3#include <cstdio>
4#include <gtest/gtest.h>
5#include <string>
6
7#define THIRTYTWO_MIB 33554432
8
9TEST(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}