2014-11-25 16:47:36 +01:00
|
|
|
#include "testutils/FuseCreateAndOpenTest.h"
|
|
|
|
|
|
|
|
using ::testing::_;
|
|
|
|
using ::testing::StrEq;
|
|
|
|
using ::testing::WithParamInterface;
|
|
|
|
using ::testing::Values;
|
|
|
|
using ::testing::Return;
|
|
|
|
|
2014-11-25 18:04:59 +01:00
|
|
|
class FuseCreateAndOpenFlagsTest: public FuseCreateAndOpenTest, public WithParamInterface<mode_t> {
|
2014-11-25 16:47:36 +01:00
|
|
|
};
|
|
|
|
INSTANTIATE_TEST_CASE_P(FuseCreateAndOpenFlagsTest, FuseCreateAndOpenFlagsTest, Values(O_RDWR, O_RDONLY, O_WRONLY));
|
|
|
|
|
|
|
|
//TODO Disabled because it doesn't seem to work. Fuse doesn't seem to pass flags to create(). Why?
|
|
|
|
TEST_P(FuseCreateAndOpenFlagsTest, DISABLED_testFlags) {
|
|
|
|
ReturnDoesntExistOnLstat(FILENAME);
|
|
|
|
EXPECT_CALL(fsimpl, createAndOpenFile(StrEq(FILENAME), OpenFlagsEq(GetParam())))
|
|
|
|
.Times(1).WillOnce(Return(0));
|
|
|
|
//For the syscall to succeed, we also need to give an fstat implementation.
|
|
|
|
ReturnIsFileOnFstat(0);
|
|
|
|
|
|
|
|
CreateAndOpenFile(FILENAME, GetParam());
|
|
|
|
}
|