+test_52() {
+ local testfile=$DIR/$tdir/$tfile
+ local tmpfile=$TMP/$tfile
+ local mirror1=$TMP/$tfile.mirror1
+ local mirror2=$TMP/$tfile.mirror2
+
+ $LCTL get_param mdc.*.import | grep -q client_encryption ||
+ skip "client encryption not supported"
+
+ mount.lustre --help |& grep -q "test_dummy_encryption:" ||
+ skip "need dummy encryption support"
+
+ [[ $OSTCOUNT -lt 2 ]] && skip_env "needs >= 2 OSTs"
+
+ stack_trap cleanup_for_enc_tests EXIT
+ setup_for_enc_tests
+
+ dd if=/dev/urandom of=$tmpfile bs=5000 count=1 conv=fsync
+
+ $LFS mirror create -N -i0 -N -i1 $testfile ||
+ error "could not create mirror"
+
+ dd if=$tmpfile of=$testfile bs=5000 count=1 conv=fsync ||
+ error "could not write to $testfile"
+
+ $LFS mirror resync $testfile ||
+ error "could not resync mirror"
+
+ $LFS mirror verify -v $testfile ||
+ error "verify mirror failed"
+
+ $LFS mirror read -N 1 -o $mirror1 $testfile ||
+ error "could not read from mirror 1"
+
+ cmp -bl $tmpfile $mirror1 ||
+ error "mirror 1 is corrupted"
+
+ $LFS mirror read -N 2 -o $mirror2 $testfile ||
+ error "could not read from mirror 2"
+
+ cmp -bl $tmpfile $mirror2 ||
+ error "mirror 2 is corrupted"
+
+ tr '\0' '2' < /dev/zero |
+ dd of=$tmpfile bs=9000 count=1 conv=fsync
+
+ $LFS mirror write -N 1 -i $tmpfile $testfile ||
+ error "could not write to mirror 1"
+
+ $LFS mirror verify -v $testfile &&
+ error "mirrors should be different"
+
+ rm -f $tmpfile $mirror1 $mirror2
+}
+run_test 52 "Mirrored encrypted file"
+