blob: b71d5c72f9575ef29e86af49c063777131796b20 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include "firmware_handler.hpp"
#include "flags.hpp"
#include "image_mock.hpp"
#include "triggerable_mock.hpp"
#include "util.hpp"
#include <vector>
#include <gtest/gtest.h>
namespace ipmi_flash
{
TEST(FirmwareHandlerStatTest, StatOnInactiveBlobIDReturnsTransport)
{
/* Test that the metadata information returned matches expectations for this
* case.
*
* canHandle has already been called at this point, so we don't need to test
* the input for this function.
*/
ImageHandlerMock imageMock;
std::vector<HandlerPack> blobs = {
{hashBlobId, &imageMock},
{"asdf", &imageMock},
};
std::vector<DataHandlerPack> data = {
{FirmwareFlags::UpdateFlags::ipmi, nullptr},
};
auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
blobs, data, std::move(CreateActionMap("asdf")));
blobs::BlobMeta meta;
EXPECT_TRUE(handler->stat("asdf", &meta));
EXPECT_EQ(FirmwareFlags::UpdateFlags::ipmi, meta.blobState);
}
} // namespace ipmi_flash
|