blob: 22223cc7d46ca84c39c972db39d3cedf21dd1d52 [file] [log] [blame]
Jie Yangfbe1b682021-02-19 04:54:55 -08001#include "handler_unittest.hpp"
2
3#include <blobs-ipmid/blobs.hpp>
4
5#include <cstdint>
6
7namespace blobs
8{
9
10class SmbiosBlobHandlerOpenTest : public SmbiosBlobHandlerTest
11{};
12
13TEST_F(SmbiosBlobHandlerOpenTest, OpenWithBadFlagsFails)
14{
15 // SMBIOS blob handler disables read flag
16
17 EXPECT_FALSE(handler.open(session, blobs::OpenFlags::read, expectedBlobId));
18}
19
20TEST_F(SmbiosBlobHandlerOpenTest, OpenEverythingSucceeds)
21{
22 EXPECT_TRUE(handler.open(session, blobs::OpenFlags::write, expectedBlobId));
23}
24
25TEST_F(SmbiosBlobHandlerOpenTest, CannotOpenSameSessionTwice)
26{
27 EXPECT_TRUE(handler.open(session, blobs::OpenFlags::write, expectedBlobId));
28 EXPECT_FALSE(
29 handler.open(session, blobs::OpenFlags::write, expectedBlobId));
30}
31
32} // namespace blobs