do_facet $SINGLEAGT "[ -f $lpcc_path ]" &&
error "RO-PCC cached file '$lpcc_path' should be removed"
+ # Test pccro attach and detach with readonly client mount
+ umount_client $MOUNT
+ stack_trap "mount_client $MOUNT $MOUNT_OPS" EXIT
+ mount_client $MOUNT "$MOUNT_OPTS,ro" ||
+ error "Mount client with 'ro' should succeed"
+ stack_trap "umount_client $MOUNT" EXIT
+
+ do_facet $SINGLEAGT $LFS pcc attach -i $HSM_ARCHIVE_NUMBER -r $file ||
+ error "RO-PCC attach $file failed"
+ check_lpcc_state $file "readonly"
+
+ do_facet $SINGLEAGT $LFS pcc detach $file ||
+ error "RO-PCC detach $file failed"
+ check_lpcc_state $file "none"
+ do_facet $SINGLEAGT "[ -f $lpcc_path ]" &&
+ error "RO-PCC cached file '$lpcc_path' should be removed"
+
return 0
}
run_test 16 "Test detach with different options"
/* Specify O_FILE_ENC | O_DIRECT flags to allow pcc detach
* on encrypted file without the key.
*/
- fd = open(path, O_RDWR | O_NONBLOCK | O_FILE_ENC | O_DIRECT);
+ fd = open(path, O_RDONLY | O_NONBLOCK | O_FILE_ENC | O_DIRECT);
if (fd < 0) {
rc = -errno;
llapi_error(LLAPI_MSG_ERROR, rc, "cannot open '%s'",