blob: 81c2d452b4617e9c4d0638886ad9702307614219 [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
Patrick Venturefdc65b22018-08-07 14:37:58 -070016 FlashUpdate updater(name, "");
Patrick Venture8ec019f2018-08-07 11:22:33 -070017 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}