Symlinks update atime correctly. Also added a test case for this.
This commit is contained in:
parent
69f4c7976e
commit
5a5037c992
@ -44,8 +44,9 @@ fspp::Dir::EntryType CrySymlink::getType() const {
|
|||||||
return fspp::Dir::EntryType::SYMLINK;
|
return fspp::Dir::EntryType::SYMLINK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bf::path CrySymlink::target() const {
|
bf::path CrySymlink::target() {
|
||||||
device()->callFsActionCallbacks();
|
device()->callFsActionCallbacks();
|
||||||
|
parent()->updateAccessTimestampForChild(key());
|
||||||
auto blob = LoadBlob();
|
auto blob = LoadBlob();
|
||||||
return blob->target();
|
return blob->target();
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ public:
|
|||||||
CrySymlink(CryDevice *device, cpputils::unique_ref<parallelaccessfsblobstore::DirBlobRef> parent, const blockstore::Key &key);
|
CrySymlink(CryDevice *device, cpputils::unique_ref<parallelaccessfsblobstore::DirBlobRef> parent, const blockstore::Key &key);
|
||||||
~CrySymlink();
|
~CrySymlink();
|
||||||
|
|
||||||
boost::filesystem::path target() const override;
|
boost::filesystem::path target() override;
|
||||||
|
|
||||||
fspp::Dir::EntryType getType() const override;
|
fspp::Dir::EntryType getType() const override;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ class Symlink: public virtual Node {
|
|||||||
public:
|
public:
|
||||||
virtual ~Symlink() {}
|
virtual ~Symlink() {}
|
||||||
|
|
||||||
virtual boost::filesystem::path target() const = 0;
|
virtual boost::filesystem::path target() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "FsppOpenFileTest.h"
|
#include "FsppOpenFileTest.h"
|
||||||
#include "FsppDeviceTest_Timestamps.h"
|
#include "FsppDeviceTest_Timestamps.h"
|
||||||
#include "FsppNodeTest_Timestamps.h"
|
#include "FsppNodeTest_Timestamps.h"
|
||||||
|
#include "FsppSymlinkTest_Timestamps.h"
|
||||||
#include "FsppFileTest_Timestamps.h"
|
#include "FsppFileTest_Timestamps.h"
|
||||||
#include "FsppOpenFileTest_Timestamps.h"
|
#include "FsppOpenFileTest_Timestamps.h"
|
||||||
|
|
||||||
@ -22,6 +23,7 @@
|
|||||||
INSTANTIATE_TYPED_TEST_CASE_P(FS_NAME, FsppFileTest, FIXTURE); \
|
INSTANTIATE_TYPED_TEST_CASE_P(FS_NAME, FsppFileTest, FIXTURE); \
|
||||||
INSTANTIATE_TYPED_TEST_CASE_P(FS_NAME, FsppFileTest_Timestamps, FIXTURE); \
|
INSTANTIATE_TYPED_TEST_CASE_P(FS_NAME, FsppFileTest_Timestamps, FIXTURE); \
|
||||||
INSTANTIATE_TYPED_TEST_CASE_P(FS_NAME, FsppSymlinkTest, FIXTURE); \
|
INSTANTIATE_TYPED_TEST_CASE_P(FS_NAME, FsppSymlinkTest, FIXTURE); \
|
||||||
|
INSTANTIATE_TYPED_TEST_CASE_P(FS_NAME, FsppSymlinkTest_Timestamps, FIXTURE); \
|
||||||
INSTANTIATE_NODE_TEST_CASE( FS_NAME, FsppNodeTest_Rename, FIXTURE); \
|
INSTANTIATE_NODE_TEST_CASE( FS_NAME, FsppNodeTest_Rename, FIXTURE); \
|
||||||
INSTANTIATE_NODE_TEST_CASE( FS_NAME, FsppNodeTest_Stat, FIXTURE); \
|
INSTANTIATE_NODE_TEST_CASE( FS_NAME, FsppNodeTest_Stat, FIXTURE); \
|
||||||
INSTANTIATE_NODE_TEST_CASE( FS_NAME, FsppNodeTest_Timestamps, FIXTURE); \
|
INSTANTIATE_NODE_TEST_CASE( FS_NAME, FsppNodeTest_Timestamps, FIXTURE); \
|
||||||
|
25
src/fspp/fstest/FsppSymlinkTest_Timestamps.h
Normal file
25
src/fspp/fstest/FsppSymlinkTest_Timestamps.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#pragma once
|
||||||
|
#ifndef MESSMER_FSPP_FSTEST_FSPPSYMLINKTEST_TIMESTAMPS_H_
|
||||||
|
#define MESSMER_FSPP_FSTEST_FSPPSYMLINKTEST_TIMESTAMPS_H_
|
||||||
|
|
||||||
|
#include "testutils/TimestampTestUtils.h"
|
||||||
|
|
||||||
|
template<class ConcreteFileSystemTestFixture>
|
||||||
|
class FsppSymlinkTest_Timestamps: public FileSystemTest<ConcreteFileSystemTestFixture>, public TimestampTestUtils<fspp::Node> {
|
||||||
|
public:
|
||||||
|
};
|
||||||
|
TYPED_TEST_CASE_P(FsppSymlinkTest_Timestamps);
|
||||||
|
|
||||||
|
TYPED_TEST_P(FsppSymlinkTest_Timestamps, target) {
|
||||||
|
auto symlink = this->CreateSymlink("/mysymlink");
|
||||||
|
auto operation = [&symlink] () {
|
||||||
|
symlink->target();
|
||||||
|
};
|
||||||
|
this->EXPECT_OPERATION_UPDATES_TIMESTAMPS_AS(*symlink, operation, {this->ExpectUpdatesAccessTimestamp, this->ExpectDoesntUpdateModificationTimestamp, this->ExpectDoesntUpdateMetadataTimestamp});
|
||||||
|
}
|
||||||
|
|
||||||
|
REGISTER_TYPED_TEST_CASE_P(FsppSymlinkTest_Timestamps,
|
||||||
|
target
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user