2015-10-29 19:34:36 +01:00
|
|
|
#include "testutils/CliTest.h"
|
|
|
|
|
|
|
|
using cpputils::TempFile;
|
|
|
|
|
|
|
|
//Tests that cryfs is correctly setup according to the CLI parameters specified
|
|
|
|
using CliTest_Setup = CliTest;
|
|
|
|
|
|
|
|
TEST_F(CliTest_Setup, NoSpecialOptions) {
|
2015-10-30 22:24:18 +01:00
|
|
|
EXPECT_RUN_SUCCESS({basedir.c_str(), mountdir.c_str(), "--cipher", "aes-256-gcm"}, mountdir);
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_Setup, NotexistingLogfileGiven) {
|
|
|
|
TempFile notexisting_logfile(false);
|
2015-10-30 22:24:18 +01:00
|
|
|
EXPECT_RUN_SUCCESS({basedir.c_str(), mountdir.c_str(), "--logfile", notexisting_logfile.path().c_str()}, mountdir);
|
2015-10-29 19:34:36 +01:00
|
|
|
//TODO Expect logfile is used (check logfile content)
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_Setup, ExistingLogfileGiven) {
|
2015-10-30 22:24:18 +01:00
|
|
|
EXPECT_RUN_SUCCESS({basedir.c_str(), mountdir.c_str(), "--logfile", logfile.path().c_str()}, mountdir);
|
2015-10-29 19:34:36 +01:00
|
|
|
//TODO Expect logfile is used (check logfile content)
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_Setup, ConfigfileGiven) {
|
2015-10-30 22:24:18 +01:00
|
|
|
EXPECT_RUN_SUCCESS({basedir.c_str(), "--config", configfile.path().c_str(), mountdir.c_str()}, mountdir);
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_Setup, FuseOptionGiven) {
|
2015-10-30 22:24:18 +01:00
|
|
|
EXPECT_RUN_SUCCESS({basedir.c_str(), mountdir.c_str(), "--", "-f"}, mountdir);
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|