'Mounts remounted read-only cannot be written to until they are
remounted read-write.'

def test_remount(self):

    blockdevice = self._get_free_blockdevice()
    mountpoint = self._get_directory_for_mount()
    self.manager_under_test.make_filesystem(blockdevice, 'ext4')
    self.manager_under_test.mount(blockdevice, mountpoint)
    first_file = mountpoint.child(str(uuid4()))
    second_file = mountpoint.child(str(uuid4()))
    third_file = mountpoint.child(str(uuid4()))
    first_file.touch()
    self.expectThat(first_file.path, FileExists())
    self.manager_under_test.remount(mountpoint, Permissions.READ_ONLY)
    self.expectThat(first_file.path, FileExists())
    with ExpectedException(OSError):
        second_file.touch()
    self.expectThat(second_file.path, Not(FileExists()))
    self.manager_under_test.remount(mountpoint, Permissions.READ_WRITE)
    self.expectThat(first_file.path, FileExists())
    self.expectThat(second_file.path, Not(FileExists()))
    third_file.touch()
    self.expectThat(third_file.path, FileExists())
