Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 1 | /** |
| 2 | * The goal of these tests is to verify the behavior of all blob commands given |
| 3 | * the current state is verificationPending. This state is achieved as a |
| 4 | * transition out of uploadInProgress. |
| 5 | */ |
| 6 | #include "firmware_handler.hpp" |
| 7 | #include "firmware_unittest.hpp" |
Patrick Venture | 01a3327 | 2019-05-23 19:48:22 -0700 | [diff] [blame] | 8 | #include "status.hpp" |
Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 9 | #include "util.hpp" |
| 10 | |
Patrick Venture | 930c7b7 | 2019-05-24 11:11:08 -0700 | [diff] [blame] | 11 | #include <algorithm> |
Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 12 | #include <cstdint> |
| 13 | #include <string> |
| 14 | #include <vector> |
| 15 | |
| 16 | #include <gtest/gtest.h> |
| 17 | |
| 18 | namespace ipmi_flash |
| 19 | { |
| 20 | namespace |
| 21 | { |
| 22 | |
Patrick Venture | 2567ebc | 2019-05-24 10:02:53 -0700 | [diff] [blame] | 23 | using ::testing::IsEmpty; |
Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 24 | using ::testing::Return; |
Patrick Venture | efba42d | 2019-05-24 10:48:16 -0700 | [diff] [blame] | 25 | using ::testing::UnorderedElementsAreArray; |
Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 26 | |
| 27 | /* |
| 28 | * There are the following calls (parameters may vary): |
| 29 | * canHandleBlob(blob) |
| 30 | * getBlobIds |
| 31 | * deleteBlob(blob) |
| 32 | * stat(blob) |
| 33 | * stat(session) |
| 34 | * open(blob) |
| 35 | * close(session) |
| 36 | * writemeta(session) |
| 37 | * write(session) |
| 38 | * read(session) |
| 39 | * commit(session) |
| 40 | * |
| 41 | * Testing canHandleBlob is uninteresting in this state. Getting the BlobIDs |
| 42 | * will inform what canHandleBlob will return. |
| 43 | */ |
| 44 | |
| 45 | class FirmwareHandlerVerificationPendingTest : public IpmiOnlyFirmwareStaticTest |
Patrick Venture | 9b37b09 | 2020-05-28 20:58:57 -0700 | [diff] [blame^] | 46 | {}; |
Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 47 | |
| 48 | /* |
| 49 | * getBlobIds |
Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 50 | */ |
Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 51 | TEST_F(FirmwareHandlerVerificationPendingTest, VerifyBlobIdAvailableInState) |
| 52 | { |
| 53 | /* Only in the verificationPending state (and later), should the |
Patrick Venture | 0f82ce4 | 2019-05-28 14:06:04 -0700 | [diff] [blame] | 54 | * verifyBlobId be present. |
| 55 | */ |
Patrick Venture | 930c7b7 | 2019-05-24 11:11:08 -0700 | [diff] [blame] | 56 | EXPECT_FALSE(handler->canHandleBlob(verifyBlobId)); |
| 57 | |
Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 58 | getToVerificationPending(staticLayoutBlobId); |
Patrick Venture | 930c7b7 | 2019-05-24 11:11:08 -0700 | [diff] [blame] | 59 | |
Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 60 | EXPECT_TRUE(handler->canHandleBlob(verifyBlobId)); |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 61 | EXPECT_TRUE(handler->canHandleBlob(activeImageBlobId)); |
Patrick Venture | 0f82ce4 | 2019-05-28 14:06:04 -0700 | [diff] [blame] | 62 | EXPECT_FALSE(handler->canHandleBlob(updateBlobId)); |
Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 63 | } |
| 64 | |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 65 | /* |
Patrick Venture | 2ca6652 | 2019-06-17 11:58:38 -0700 | [diff] [blame] | 66 | * delete(blob) |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 67 | */ |
Patrick Venture | 2ca6652 | 2019-06-17 11:58:38 -0700 | [diff] [blame] | 68 | TEST_F(FirmwareHandlerVerificationPendingTest, DeleteVerifyPendingAbortsProcess) |
| 69 | { |
| 70 | /* It doesn't matter what blob id is used to delete in the design, so just |
| 71 | * delete the verify blob id |
| 72 | */ |
| 73 | getToVerificationPending(staticLayoutBlobId); |
| 74 | |
| 75 | EXPECT_CALL(*verifyMockPtr, abort()).Times(0); |
| 76 | |
| 77 | ASSERT_TRUE(handler->canHandleBlob(verifyBlobId)); |
| 78 | EXPECT_TRUE(handler->deleteBlob(verifyBlobId)); |
| 79 | |
| 80 | std::vector<std::string> expectedBlobs = {staticLayoutBlobId, hashBlobId}; |
| 81 | EXPECT_THAT(handler->getBlobIds(), |
| 82 | UnorderedElementsAreArray(expectedBlobs)); |
| 83 | expectedState(FirmwareBlobHandler::UpdateState::notYetStarted); |
| 84 | } |
| 85 | |
| 86 | TEST_F(FirmwareHandlerVerificationPendingTest, DeleteActiveImageAbortsProcess) |
| 87 | { |
| 88 | getToVerificationPending(staticLayoutBlobId); |
| 89 | |
| 90 | EXPECT_CALL(*verifyMockPtr, abort()).Times(0); |
| 91 | |
| 92 | ASSERT_TRUE(handler->canHandleBlob(activeImageBlobId)); |
| 93 | EXPECT_TRUE(handler->deleteBlob(activeImageBlobId)); |
| 94 | |
| 95 | std::vector<std::string> expectedBlobs = {staticLayoutBlobId, hashBlobId}; |
| 96 | EXPECT_THAT(handler->getBlobIds(), |
| 97 | UnorderedElementsAreArray(expectedBlobs)); |
| 98 | expectedState(FirmwareBlobHandler::UpdateState::notYetStarted); |
| 99 | } |
| 100 | |
| 101 | TEST_F(FirmwareHandlerVerificationPendingTest, DeleteStaticLayoutAbortsProcess) |
| 102 | { |
| 103 | getToVerificationPending(staticLayoutBlobId); |
| 104 | |
| 105 | EXPECT_CALL(*verifyMockPtr, abort()).Times(0); |
| 106 | |
| 107 | ASSERT_TRUE(handler->canHandleBlob(staticLayoutBlobId)); |
| 108 | EXPECT_TRUE(handler->deleteBlob(staticLayoutBlobId)); |
| 109 | |
| 110 | std::vector<std::string> expectedBlobs = {staticLayoutBlobId, hashBlobId}; |
| 111 | EXPECT_THAT(handler->getBlobIds(), |
| 112 | UnorderedElementsAreArray(expectedBlobs)); |
| 113 | expectedState(FirmwareBlobHandler::UpdateState::notYetStarted); |
| 114 | } |
| 115 | |
| 116 | TEST_F(FirmwareHandlerVerificationPendingTest, DeleteHashAbortsProcess) |
| 117 | { |
| 118 | getToVerificationPending(staticLayoutBlobId); |
| 119 | |
| 120 | EXPECT_CALL(*verifyMockPtr, abort()).Times(0); |
| 121 | |
| 122 | ASSERT_TRUE(handler->canHandleBlob(hashBlobId)); |
| 123 | EXPECT_TRUE(handler->deleteBlob(hashBlobId)); |
| 124 | |
| 125 | std::vector<std::string> expectedBlobs = {staticLayoutBlobId, hashBlobId}; |
| 126 | EXPECT_THAT(handler->getBlobIds(), |
| 127 | UnorderedElementsAreArray(expectedBlobs)); |
| 128 | expectedState(FirmwareBlobHandler::UpdateState::notYetStarted); |
| 129 | } |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 130 | |
| 131 | /* |
| 132 | * stat(blob) |
| 133 | */ |
| 134 | TEST_F(FirmwareHandlerVerificationPendingTest, StatOnActiveImageReturnsFailure) |
| 135 | { |
| 136 | getToVerificationPending(staticLayoutBlobId); |
Patrick Venture | 930c7b7 | 2019-05-24 11:11:08 -0700 | [diff] [blame] | 137 | ASSERT_TRUE(handler->canHandleBlob(activeImageBlobId)); |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 138 | |
| 139 | blobs::BlobMeta meta; |
| 140 | EXPECT_FALSE(handler->stat(activeImageBlobId, &meta)); |
| 141 | } |
| 142 | |
| 143 | TEST_F(FirmwareHandlerVerificationPendingTest, StatOnActiveHashReturnsFailure) |
| 144 | { |
| 145 | getToVerificationPending(hashBlobId); |
Patrick Venture | 930c7b7 | 2019-05-24 11:11:08 -0700 | [diff] [blame] | 146 | ASSERT_TRUE(handler->canHandleBlob(activeHashBlobId)); |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 147 | |
| 148 | blobs::BlobMeta meta; |
| 149 | EXPECT_FALSE(handler->stat(activeHashBlobId, &meta)); |
| 150 | } |
| 151 | |
| 152 | TEST_F(FirmwareHandlerVerificationPendingTest, |
| 153 | StatOnVerificationBlobReturnsFailure) |
| 154 | { |
Patrick Venture | 1999eef | 2019-07-01 11:44:09 -0700 | [diff] [blame] | 155 | getToVerificationPending(staticLayoutBlobId); |
Patrick Venture | 0f82ce4 | 2019-05-28 14:06:04 -0700 | [diff] [blame] | 156 | ASSERT_TRUE(handler->canHandleBlob(verifyBlobId)); |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 157 | |
| 158 | blobs::BlobMeta meta; |
| 159 | EXPECT_FALSE(handler->stat(verifyBlobId, &meta)); |
| 160 | } |
| 161 | |
Patrick Venture | 1999eef | 2019-07-01 11:44:09 -0700 | [diff] [blame] | 162 | TEST_F(FirmwareHandlerVerificationPendingTest, |
| 163 | VerificationBlobNotFoundWithoutStaticDataAsWell) |
| 164 | { |
| 165 | /* If you only ever open the hash blob id, and never the firmware blob id, |
| 166 | * the verify blob isn't added. |
| 167 | */ |
| 168 | getToVerificationPending(hashBlobId); |
| 169 | EXPECT_FALSE(handler->canHandleBlob(verifyBlobId)); |
| 170 | } |
| 171 | |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 172 | TEST_F(FirmwareHandlerVerificationPendingTest, StatOnNormalBlobsReturnsSuccess) |
| 173 | { |
| 174 | getToVerificationPending(staticLayoutBlobId); |
| 175 | |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 176 | std::vector<std::string> testBlobs = {staticLayoutBlobId, hashBlobId}; |
| 177 | for (const auto& blob : testBlobs) |
| 178 | { |
Patrick Venture | 930c7b7 | 2019-05-24 11:11:08 -0700 | [diff] [blame] | 179 | ASSERT_TRUE(handler->canHandleBlob(blob)); |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 180 | blobs::BlobMeta meta = {}; |
| 181 | EXPECT_TRUE(handler->stat(blob, &meta)); |
Benjamin Fair | 1290198 | 2019-11-12 13:55:46 -0800 | [diff] [blame] | 182 | EXPECT_EQ(expectedIdleMeta, meta); |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 183 | } |
| 184 | } |
| 185 | |
| 186 | /* |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 187 | * open(blob) |
| 188 | */ |
Patrick Venture | da8fcd1 | 2019-05-23 18:53:50 -0700 | [diff] [blame] | 189 | TEST_F(FirmwareHandlerVerificationPendingTest, OpenVerifyBlobSucceeds) |
| 190 | { |
| 191 | getToVerificationPending(staticLayoutBlobId); |
| 192 | |
| 193 | /* the session is safe because it was already closed to get to this state. |
| 194 | */ |
| 195 | EXPECT_TRUE(handler->open(session, flags, verifyBlobId)); |
| 196 | } |
| 197 | |
Patrick Venture | 0f82ce4 | 2019-05-28 14:06:04 -0700 | [diff] [blame] | 198 | TEST_F(FirmwareHandlerVerificationPendingTest, OpenActiveBlobsFail) |
Patrick Venture | da8fcd1 | 2019-05-23 18:53:50 -0700 | [diff] [blame] | 199 | { |
| 200 | /* Try opening the active blob Id. This test is equivalent to trying to |
| 201 | * open the active hash blob id, in that neither are ever allowed. |
| 202 | */ |
| 203 | getToVerificationPending(staticLayoutBlobId); |
| 204 | EXPECT_FALSE(handler->open(session, flags, activeImageBlobId)); |
Patrick Venture | 0f82ce4 | 2019-05-28 14:06:04 -0700 | [diff] [blame] | 205 | EXPECT_FALSE(handler->open(session, flags, activeHashBlobId)); |
Patrick Venture | da8fcd1 | 2019-05-23 18:53:50 -0700 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | TEST_F(FirmwareHandlerVerificationPendingTest, |
| 209 | OpenImageBlobTransitionsToUploadInProgress) |
| 210 | { |
| 211 | getToVerificationPending(staticLayoutBlobId); |
Patrick Venture | efba42d | 2019-05-24 10:48:16 -0700 | [diff] [blame] | 212 | |
| 213 | /* Verify the active blob for the image is in the list once to start. |
| 214 | * Note: This is truly tested under the notYetStarted::open() test. |
| 215 | */ |
| 216 | std::vector<std::string> expectedBlobs = {staticLayoutBlobId, hashBlobId, |
| 217 | verifyBlobId, activeImageBlobId}; |
| 218 | |
| 219 | EXPECT_THAT(handler->getBlobIds(), |
| 220 | UnorderedElementsAreArray(expectedBlobs)); |
| 221 | |
Patrick Venture | 6d7735d | 2019-06-21 10:03:19 -0700 | [diff] [blame] | 222 | /* Verifies it isn't triggered again. */ |
| 223 | EXPECT_CALL(*prepareMockPtr, trigger()).Times(0); |
| 224 | |
Patrick Venture | d4e20de | 2019-07-18 12:48:05 -0700 | [diff] [blame] | 225 | EXPECT_CALL(*imageMock2, open(staticLayoutBlobId)).WillOnce(Return(true)); |
Patrick Venture | da8fcd1 | 2019-05-23 18:53:50 -0700 | [diff] [blame] | 226 | EXPECT_TRUE(handler->open(session, flags, staticLayoutBlobId)); |
Patrick Venture | 6fdd02e | 2019-05-28 13:02:04 -0700 | [diff] [blame] | 227 | expectedState(FirmwareBlobHandler::UpdateState::uploadInProgress); |
Patrick Venture | efba42d | 2019-05-24 10:48:16 -0700 | [diff] [blame] | 228 | |
Patrick Venture | 930c7b7 | 2019-05-24 11:11:08 -0700 | [diff] [blame] | 229 | expectedBlobs.erase( |
Patrick Venture | 6fdd02e | 2019-05-28 13:02:04 -0700 | [diff] [blame] | 230 | std::remove(expectedBlobs.begin(), expectedBlobs.end(), verifyBlobId), |
| 231 | expectedBlobs.end()); |
Patrick Venture | 930c7b7 | 2019-05-24 11:11:08 -0700 | [diff] [blame] | 232 | |
| 233 | /* Verify the active blob ID was not added to the list twice and |
| 234 | * verifyBlobId is removed |
| 235 | */ |
Patrick Venture | efba42d | 2019-05-24 10:48:16 -0700 | [diff] [blame] | 236 | EXPECT_THAT(handler->getBlobIds(), |
| 237 | UnorderedElementsAreArray(expectedBlobs)); |
Patrick Venture | da8fcd1 | 2019-05-23 18:53:50 -0700 | [diff] [blame] | 238 | } |
| 239 | |
| 240 | /* |
Patrick Venture | 1e389c9 | 2019-05-23 19:15:05 -0700 | [diff] [blame] | 241 | * close(session) |
| 242 | */ |
| 243 | TEST_F(FirmwareHandlerVerificationPendingTest, |
Patrick Venture | 6fdd02e | 2019-05-28 13:02:04 -0700 | [diff] [blame] | 244 | ClosingVerifyBlobWithoutCommitDoesNotChangeState) |
Patrick Venture | 1e389c9 | 2019-05-23 19:15:05 -0700 | [diff] [blame] | 245 | { |
Patrick Venture | 6fdd02e | 2019-05-28 13:02:04 -0700 | [diff] [blame] | 246 | /* commit() will change the state, closing post-commit is part of |
| 247 | * verificationStarted testing. |
| 248 | */ |
Patrick Venture | 1e389c9 | 2019-05-23 19:15:05 -0700 | [diff] [blame] | 249 | getToVerificationPending(staticLayoutBlobId); |
| 250 | EXPECT_TRUE(handler->open(session, flags, verifyBlobId)); |
Patrick Venture | 6fdd02e | 2019-05-28 13:02:04 -0700 | [diff] [blame] | 251 | expectedState(FirmwareBlobHandler::UpdateState::verificationPending); |
Patrick Venture | 1e389c9 | 2019-05-23 19:15:05 -0700 | [diff] [blame] | 252 | |
| 253 | handler->close(session); |
Patrick Venture | 6fdd02e | 2019-05-28 13:02:04 -0700 | [diff] [blame] | 254 | expectedState(FirmwareBlobHandler::UpdateState::verificationPending); |
Patrick Venture | 1e389c9 | 2019-05-23 19:15:05 -0700 | [diff] [blame] | 255 | } |
| 256 | |
| 257 | /* |
Patrick Venture | 19044e1 | 2019-05-23 19:30:28 -0700 | [diff] [blame] | 258 | * commit(session) |
| 259 | */ |
| 260 | TEST_F(FirmwareHandlerVerificationPendingTest, |
| 261 | CommitOnVerifyBlobTriggersVerificationAndStateTransition) |
| 262 | { |
| 263 | getToVerificationPending(staticLayoutBlobId); |
| 264 | EXPECT_TRUE(handler->open(session, flags, verifyBlobId)); |
Patrick Venture | 1d66fe6 | 2019-06-03 14:57:27 -0700 | [diff] [blame] | 265 | EXPECT_CALL(*verifyMockPtr, trigger()).WillOnce(Return(true)); |
Patrick Venture | 19044e1 | 2019-05-23 19:30:28 -0700 | [diff] [blame] | 266 | |
| 267 | EXPECT_TRUE(handler->commit(session, {})); |
Patrick Venture | 6fdd02e | 2019-05-28 13:02:04 -0700 | [diff] [blame] | 268 | expectedState(FirmwareBlobHandler::UpdateState::verificationStarted); |
Patrick Venture | 19044e1 | 2019-05-23 19:30:28 -0700 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | /* |
Patrick Venture | da8fcd1 | 2019-05-23 18:53:50 -0700 | [diff] [blame] | 272 | * stat(session) - in this state, you can only open(verifyBlobId) without |
| 273 | * changing state. |
| 274 | */ |
Patrick Venture | 01a3327 | 2019-05-23 19:48:22 -0700 | [diff] [blame] | 275 | TEST_F(FirmwareHandlerVerificationPendingTest, StatOnVerifyBlobIdReturnsState) |
| 276 | { |
| 277 | /* If this is called before commit(), it's still verificationPending, so it |
| 278 | * just returns the state is other |
| 279 | */ |
| 280 | getToVerificationPending(staticLayoutBlobId); |
| 281 | EXPECT_TRUE(handler->open(session, flags, verifyBlobId)); |
Patrick Venture | 1d66fe6 | 2019-06-03 14:57:27 -0700 | [diff] [blame] | 282 | EXPECT_CALL(*verifyMockPtr, trigger()).Times(0); |
Patrick Venture | f1f0f65 | 2019-06-03 09:10:19 -0700 | [diff] [blame] | 283 | EXPECT_CALL(*verifyMockPtr, status()).Times(0); |
Patrick Venture | 01a3327 | 2019-05-23 19:48:22 -0700 | [diff] [blame] | 284 | |
| 285 | blobs::BlobMeta meta, expectedMeta = {}; |
| 286 | expectedMeta.size = 0; |
| 287 | expectedMeta.blobState = flags; |
| 288 | expectedMeta.metadata.push_back( |
Patrick Venture | da66fd8 | 2019-06-03 11:11:24 -0700 | [diff] [blame] | 289 | static_cast<std::uint8_t>(ActionStatus::unknown)); |
Patrick Venture | 01a3327 | 2019-05-23 19:48:22 -0700 | [diff] [blame] | 290 | |
| 291 | EXPECT_TRUE(handler->stat(session, &meta)); |
| 292 | EXPECT_EQ(expectedMeta, meta); |
| 293 | } |
| 294 | |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 295 | /* |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 296 | * writemeta(session) |
| 297 | */ |
Patrick Venture | b611a08 | 2019-05-23 20:27:28 -0700 | [diff] [blame] | 298 | TEST_F(FirmwareHandlerVerificationPendingTest, WriteMetaAgainstVerifyFails) |
| 299 | { |
| 300 | /* The verifyBlobId has no data handler, which means write meta fails. */ |
| 301 | getToVerificationPending(staticLayoutBlobId); |
| 302 | |
| 303 | EXPECT_TRUE(handler->open(session, flags, verifyBlobId)); |
| 304 | |
| 305 | std::vector<std::uint8_t> bytes = {0x01, 0x02}; |
| 306 | EXPECT_FALSE(handler->writeMeta(session, 0, bytes)); |
| 307 | } |
| 308 | |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 309 | /* |
| 310 | * write(session) |
| 311 | */ |
Patrick Venture | ab731e9 | 2019-05-24 09:58:00 -0700 | [diff] [blame] | 312 | TEST_F(FirmwareHandlerVerificationPendingTest, WriteAgainstVerifyBlobIdFails) |
| 313 | { |
| 314 | getToVerificationPending(staticLayoutBlobId); |
| 315 | |
| 316 | EXPECT_TRUE(handler->open(session, flags, verifyBlobId)); |
| 317 | |
| 318 | std::vector<std::uint8_t> bytes = {0x01, 0x02}; |
| 319 | EXPECT_FALSE(handler->write(session, 0, bytes)); |
| 320 | } |
| 321 | |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 322 | /* |
| 323 | * read(session) |
| 324 | */ |
Patrick Venture | 2567ebc | 2019-05-24 10:02:53 -0700 | [diff] [blame] | 325 | TEST_F(FirmwareHandlerVerificationPendingTest, |
| 326 | ReadAgainstVerifyBlobIdReturnsEmpty) |
| 327 | { |
| 328 | getToVerificationPending(staticLayoutBlobId); |
| 329 | |
| 330 | EXPECT_TRUE(handler->open(session, flags, verifyBlobId)); |
Patrick Venture | 0f82ce4 | 2019-05-28 14:06:04 -0700 | [diff] [blame] | 331 | EXPECT_THAT(handler->read(session, 0, 1), IsEmpty()); |
Patrick Venture | 2567ebc | 2019-05-24 10:02:53 -0700 | [diff] [blame] | 332 | } |
Patrick Venture | b386b86 | 2019-05-23 18:42:54 -0700 | [diff] [blame] | 333 | |
Patrick Venture | 61d2ed4 | 2019-05-23 18:16:31 -0700 | [diff] [blame] | 334 | } // namespace |
| 335 | } // namespace ipmi_flash |