Lines Matching +full:- +full:_

32 using ::testing::_;
88 // request D-Bus server name. in SetUp()
89 conn->request_name("xyz.openbmc_project.eStoraged.test"); in SetUp()
132 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)).Times(1); in TEST_F()
134 EXPECT_CALL(*mockCryptIface, cryptKeyslotAddByVolumeKey(_, _, _, _, _, _)) in TEST_F()
137 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).Times(1); in TEST_F()
139 EXPECT_CALL(*mockCryptIface, cryptActivateByPassphrase(_, _, _, _, _, _)) in TEST_F()
142 EXPECT_CALL(*mockFsIface, runMkfs(StrEq(esObject->getCryptDevicePath()))) in TEST_F()
145 EXPECT_CALL(*mockFsIface, directoryExists(path(esObject->getMountPoint()))) in TEST_F()
148 EXPECT_CALL(*mockFsIface, createDirectory(path(esObject->getMountPoint()))) in TEST_F()
152 doMount(StrEq(esObject->getCryptDevicePath()), in TEST_F()
153 StrEq(esObject->getMountPoint()), _, _, _)) in TEST_F()
156 EXPECT_CALL(*mockFsIface, doUnmount(StrEq(esObject->getMountPoint()))) in TEST_F()
159 EXPECT_CALL(*mockFsIface, removeDirectory(path(esObject->getMountPoint()))) in TEST_F()
162 EXPECT_CALL(*mockCryptIface, cryptDeactivate(_, _)) in TEST_F()
166 esObject->formatLuks(password, Volume::FilesystemType::ext4); in TEST_F()
167 EXPECT_FALSE(esObject->isLocked()); in TEST_F()
169 esObject->lock(); in TEST_F()
170 EXPECT_TRUE(esObject->isLocked()); in TEST_F()
179 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)).Times(1); in TEST_F()
181 EXPECT_CALL(*mockCryptIface, cryptKeyslotAddByVolumeKey(_, _, _, _, _, _)) in TEST_F()
184 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).Times(1); in TEST_F()
186 EXPECT_CALL(*mockCryptIface, cryptActivateByPassphrase(_, _, _, _, _, _)) in TEST_F()
189 EXPECT_CALL(*mockFsIface, runMkfs(StrEq(esObject->getCryptDevicePath()))) in TEST_F()
192 EXPECT_CALL(*mockFsIface, directoryExists(path(esObject->getMountPoint()))) in TEST_F()
195 EXPECT_CALL(*mockFsIface, createDirectory(path(esObject->getMountPoint()))) in TEST_F()
199 doMount(StrEq(esObject->getCryptDevicePath()), in TEST_F()
200 StrEq(esObject->getMountPoint()), _, _, _)) in TEST_F()
203 EXPECT_CALL(*mockFsIface, doUnmount(StrEq(esObject->getMountPoint()))) in TEST_F()
206 EXPECT_CALL(*mockFsIface, removeDirectory(path(esObject->getMountPoint()))) in TEST_F()
209 EXPECT_CALL(*mockCryptIface, cryptDeactivate(_, _)) in TEST_F()
213 esObject->formatLuks(password, Volume::FilesystemType::ext4); in TEST_F()
214 EXPECT_FALSE(esObject->isLocked()); in TEST_F()
216 esObject->lock(); in TEST_F()
217 EXPECT_TRUE(esObject->isLocked()); in TEST_F()
226 EXPECT_THROW(esObject->formatLuks(password, Volume::FilesystemType::ext4), in TEST_F()
228 EXPECT_TRUE(esObject->isLocked()); in TEST_F()
239 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)) in TEST_F()
240 .WillOnce(Return(-1)); in TEST_F()
242 EXPECT_THROW(esObject->formatLuks(password, Volume::FilesystemType::ext4), in TEST_F()
244 EXPECT_TRUE(esObject->isLocked()); in TEST_F()
250 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)).Times(1); in TEST_F()
252 EXPECT_CALL(*mockCryptIface, cryptKeyslotAddByVolumeKey(_, _, _, _, _, _)) in TEST_F()
253 .WillOnce(Return(-1)); in TEST_F()
255 EXPECT_THROW(esObject->formatLuks(password, Volume::FilesystemType::ext4), in TEST_F()
257 EXPECT_TRUE(esObject->isLocked()); in TEST_F()
263 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)).Times(1); in TEST_F()
265 EXPECT_CALL(*mockCryptIface, cryptKeyslotAddByVolumeKey(_, _, _, _, _, _)) in TEST_F()
268 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).WillOnce(Return(-1)); in TEST_F()
270 EXPECT_THROW(esObject->formatLuks(password, Volume::FilesystemType::ext4), in TEST_F()
272 EXPECT_TRUE(esObject->isLocked()); in TEST_F()
278 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)).Times(1); in TEST_F()
280 EXPECT_CALL(*mockCryptIface, cryptKeyslotAddByVolumeKey(_, _, _, _, _, _)) in TEST_F()
283 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).Times(1); in TEST_F()
285 EXPECT_CALL(*mockCryptIface, cryptActivateByPassphrase(_, _, _, _, _, _)) in TEST_F()
286 .WillOnce(Return(-1)); in TEST_F()
288 EXPECT_THROW(esObject->formatLuks(password, Volume::FilesystemType::ext4), in TEST_F()
290 EXPECT_TRUE(esObject->isLocked()); in TEST_F()
296 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)).Times(1); in TEST_F()
298 EXPECT_CALL(*mockCryptIface, cryptKeyslotAddByVolumeKey(_, _, _, _, _, _)) in TEST_F()
301 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).Times(1); in TEST_F()
303 EXPECT_CALL(*mockCryptIface, cryptActivateByPassphrase(_, _, _, _, _, _)) in TEST_F()
306 EXPECT_CALL(*mockFsIface, runMkfs(StrEq(esObject->getCryptDevicePath()))) in TEST_F()
307 .WillOnce(Return(-1)); in TEST_F()
309 EXPECT_THROW(esObject->formatLuks(password, Volume::FilesystemType::ext4), in TEST_F()
311 EXPECT_FALSE(esObject->isLocked()); in TEST_F()
319 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)).Times(1); in TEST_F()
321 EXPECT_CALL(*mockCryptIface, cryptKeyslotAddByVolumeKey(_, _, _, _, _, _)) in TEST_F()
324 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).Times(1); in TEST_F()
326 EXPECT_CALL(*mockCryptIface, cryptActivateByPassphrase(_, _, _, _, _, _)) in TEST_F()
329 EXPECT_CALL(*mockFsIface, runMkfs(StrEq(esObject->getCryptDevicePath()))) in TEST_F()
332 EXPECT_CALL(*mockFsIface, directoryExists(path(esObject->getMountPoint()))) in TEST_F()
335 EXPECT_CALL(*mockFsIface, createDirectory(path(esObject->getMountPoint()))) in TEST_F()
338 EXPECT_THROW(esObject->formatLuks(password, Volume::FilesystemType::ext4), in TEST_F()
340 EXPECT_FALSE(esObject->isLocked()); in TEST_F()
348 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)).Times(1); in TEST_F()
350 EXPECT_CALL(*mockCryptIface, cryptKeyslotAddByVolumeKey(_, _, _, _, _, _)) in TEST_F()
353 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).Times(1); in TEST_F()
355 EXPECT_CALL(*mockCryptIface, cryptActivateByPassphrase(_, _, _, _, _, _)) in TEST_F()
358 EXPECT_CALL(*mockFsIface, runMkfs(StrEq(esObject->getCryptDevicePath()))) in TEST_F()
361 EXPECT_CALL(*mockFsIface, directoryExists(path(esObject->getMountPoint()))) in TEST_F()
364 EXPECT_CALL(*mockFsIface, createDirectory(path(esObject->getMountPoint()))) in TEST_F()
368 doMount(StrEq(esObject->getCryptDevicePath()), in TEST_F()
369 StrEq(esObject->getMountPoint()), _, _, _)) in TEST_F()
370 .WillOnce(Return(-1)); in TEST_F()
372 EXPECT_CALL(*mockFsIface, removeDirectory(path(esObject->getMountPoint()))) in TEST_F()
375 EXPECT_THROW(esObject->formatLuks(password, Volume::FilesystemType::ext4), in TEST_F()
377 EXPECT_FALSE(esObject->isLocked()); in TEST_F()
385 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)).Times(1); in TEST_F()
387 EXPECT_CALL(*mockCryptIface, cryptKeyslotAddByVolumeKey(_, _, _, _, _, _)) in TEST_F()
390 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).Times(1); in TEST_F()
392 EXPECT_CALL(*mockCryptIface, cryptActivateByPassphrase(_, _, _, _, _, _)) in TEST_F()
395 EXPECT_CALL(*mockFsIface, runMkfs(StrEq(esObject->getCryptDevicePath()))) in TEST_F()
398 EXPECT_CALL(*mockFsIface, directoryExists(path(esObject->getMountPoint()))) in TEST_F()
401 EXPECT_CALL(*mockFsIface, createDirectory(path(esObject->getMountPoint()))) in TEST_F()
405 doMount(StrEq(esObject->getCryptDevicePath()), in TEST_F()
406 StrEq(esObject->getMountPoint()), _, _, _)) in TEST_F()
409 EXPECT_CALL(*mockFsIface, doUnmount(StrEq(esObject->getMountPoint()))) in TEST_F()
410 .WillOnce(Return(-1)); in TEST_F()
412 esObject->formatLuks(password, Volume::FilesystemType::ext4); in TEST_F()
413 EXPECT_FALSE(esObject->isLocked()); in TEST_F()
415 EXPECT_THROW(esObject->lock(), InternalFailure); in TEST_F()
416 EXPECT_FALSE(esObject->isLocked()); in TEST_F()
424 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)).Times(1); in TEST_F()
426 EXPECT_CALL(*mockCryptIface, cryptKeyslotAddByVolumeKey(_, _, _, _, _, _)) in TEST_F()
429 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).Times(1); in TEST_F()
431 EXPECT_CALL(*mockCryptIface, cryptActivateByPassphrase(_, _, _, _, _, _)) in TEST_F()
434 EXPECT_CALL(*mockFsIface, runMkfs(StrEq(esObject->getCryptDevicePath()))) in TEST_F()
437 EXPECT_CALL(*mockFsIface, directoryExists(path(esObject->getMountPoint()))) in TEST_F()
440 EXPECT_CALL(*mockFsIface, createDirectory(path(esObject->getMountPoint()))) in TEST_F()
444 doMount(StrEq(esObject->getCryptDevicePath()), in TEST_F()
445 StrEq(esObject->getMountPoint()), _, _, _)) in TEST_F()
448 EXPECT_CALL(*mockFsIface, doUnmount(StrEq(esObject->getMountPoint()))) in TEST_F()
451 EXPECT_CALL(*mockFsIface, removeDirectory(path(esObject->getMountPoint()))) in TEST_F()
454 esObject->formatLuks(password, Volume::FilesystemType::ext4); in TEST_F()
455 EXPECT_FALSE(esObject->isLocked()); in TEST_F()
458 EXPECT_THROW(esObject->lock(), InternalFailure); in TEST_F()
459 EXPECT_FALSE(esObject->isLocked()); in TEST_F()
467 EXPECT_CALL(*mockCryptIface, cryptFormat(_, _, _, _, _, _, _, _)).Times(1); in TEST_F()
469 EXPECT_CALL(*mockCryptIface, cryptKeyslotAddByVolumeKey(_, _, _, _, _, _)) in TEST_F()
472 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).Times(1); in TEST_F()
474 EXPECT_CALL(*mockCryptIface, cryptActivateByPassphrase(_, _, _, _, _, _)) in TEST_F()
477 EXPECT_CALL(*mockFsIface, runMkfs(StrEq(esObject->getCryptDevicePath()))) in TEST_F()
480 EXPECT_CALL(*mockFsIface, directoryExists(path(esObject->getMountPoint()))) in TEST_F()
483 EXPECT_CALL(*mockFsIface, createDirectory(path(esObject->getMountPoint()))) in TEST_F()
487 doMount(StrEq(esObject->getCryptDevicePath()), in TEST_F()
488 StrEq(esObject->getMountPoint()), _, _, _)) in TEST_F()
491 EXPECT_CALL(*mockFsIface, doUnmount(StrEq(esObject->getMountPoint()))) in TEST_F()
494 EXPECT_CALL(*mockFsIface, removeDirectory(path(esObject->getMountPoint()))) in TEST_F()
497 EXPECT_CALL(*mockCryptIface, cryptDeactivate(_, _)).WillOnce(Return(-1)); in TEST_F()
500 esObject->formatLuks(password, Volume::FilesystemType::ext4); in TEST_F()
501 EXPECT_FALSE(esObject->isLocked()); in TEST_F()
503 EXPECT_THROW(esObject->lock(), InternalFailure); in TEST_F()
504 EXPECT_FALSE(esObject->isLocked()); in TEST_F()
516 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).Times(1); in TEST_F()
520 _, _, _, reinterpret_cast<const char*>(password.data()), in TEST_F()
526 /* Change the password for the LUKS-encrypted device. */ in TEST_F()
527 esObject->changePassword(password, newPassword); in TEST_F()
537 EXPECT_CALL(*mockCryptIface, cryptLoad(_, _, _)).Times(1); in TEST_F()
541 _, _, _, reinterpret_cast<const char*>(password.data()), in TEST_F()
545 .WillOnce(Return(-1)); in TEST_F()
547 EXPECT_THROW(esObject->changePassword(password, newPassword), in TEST_F()