1 #include "handler_unittest.hpp"
2 
3 #include <blobs-ipmid/blobs.hpp>
4 
5 #include <cstdint>
6 
7 namespace blobs
8 {
9 
10 class SmbiosBlobHandlerOpenTest : public SmbiosBlobHandlerTest
11 {};
12 
TEST_F(SmbiosBlobHandlerOpenTest,OpenWithBadFlagsFails)13 TEST_F(SmbiosBlobHandlerOpenTest, OpenWithBadFlagsFails)
14 {
15     // SMBIOS blob handler disables read flag
16 
17     EXPECT_FALSE(handler.open(session, blobs::OpenFlags::read, expectedBlobId));
18 }
19 
TEST_F(SmbiosBlobHandlerOpenTest,OpenEverythingSucceeds)20 TEST_F(SmbiosBlobHandlerOpenTest, OpenEverythingSucceeds)
21 {
22     EXPECT_TRUE(handler.open(session, blobs::OpenFlags::write, expectedBlobId));
23 }
24 
TEST_F(SmbiosBlobHandlerOpenTest,CannotOpenSameSessionTwice)25 TEST_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
33