eden/fs/inodes/test/OverlayTest.cpp
// In memory timestamps should be same before and after a remount.
// (inmemory timestamps should be written to overlay on
// on unmount and should be read back from the overlay on remount)
In memory timestamps should be same before and after a remount.
(inmemory timestamps should be written to overlay on
on unmount and should be read back from the overlay on remount)
In memory timestamps should be same before and after a remount . ( inmemory timestamps should be written to overlay on on unmount and should be read back from the overlay on remount )
TEST_F(OverlayTest, testTimeStampsInOverlayOnMountAndUnmount) {
  InodeTimestamps beforeRemountFile;
  InodeTimestamps beforeRemountDir;
  mount_.overwriteFile("dir/a.txt", "contents changed\n");
  {
    auto inodeFile = mount_.getFileInode("dir/a.txt");
    EXPECT_FILE_INODE(inodeFile, "contents changed\n", 0644);
    beforeRemountFile = inodeFile->getMetadata().timestamps;
  }
  {
    mount_.remount();
    auto inodeRemount = mount_.getFileInode("dir/a.txt");
    auto afterRemount = inodeRemount->getMetadata().timestamps;
    expectTimeStampsEqual(beforeRemountFile, afterRemount);
  }
  {
    auto inodeDir = mount_.getTreeInode("dir");
    beforeRemountDir = inodeDir->getMetadata().timestamps;
  }
  {
    mount_.remount();
    auto inodeRemount = mount_.getTreeInode("dir");
    auto afterRemount = inodeRemount->getMetadata().timestamps;
    expectTimeStampsEqual(beforeRemountDir, afterRemount);
  }
}
TEST_F ( OverlayTest , testTimeStampsInOverlayOnMountAndUnmount ) { InodeTimestamps beforeRemountFile ; InodeTimestamps beforeRemountDir ; mount_ . overwriteFile ( " " , " \n " ) ; { auto inodeFile = mount_ . getFileInode ( " " ) ; EXPECT_FILE_INODE ( inodeFile , " \n " , 0644 ) ; beforeRemountFile = inodeFile -> getMetadata ( ) . timestamps ; } { mount_ . remount ( ) ; auto inodeRemount = mount_ . getFileInode ( " " ) ; auto afterRemount = inodeRemount -> getMetadata ( ) . timestamps ; expectTimeStampsEqual ( beforeRemountFile , afterRemount ) ; } { auto inodeDir = mount_ . getTreeInode ( " " ) ; beforeRemountDir = inodeDir -> getMetadata ( ) . timestamps ; } { mount_ . remount ( ) ; auto inodeRemount = mount_ . getTreeInode ( " " ) ; auto afterRemount = inodeRemount -> getMetadata ( ) . timestamps ; expectTimeStampsEqual ( beforeRemountDir , afterRemount ) ; } }
In memory timestamps should be same before and after a remount.
In memory timestamps should be same before and after a remount .
// Materialize file and directory // test timestamp behavior in overlay on remount. // We do not want to keep references to inode in order to remount. // Check for materialized files. // Check for materialized directory