+test_60() {
+ local testdir=$DIR/$tdir/mytestdir
+ local testfile=$DIR/$tdir/$tfile
+
+ (( $MDS1_VERSION > $(version_code 2.14.53) )) ||
+ skip "Need MDS version at least 2.14.53"
+
+ $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"
+
+ stack_trap cleanup_for_enc_tests EXIT
+ setup_for_enc_tests
+
+ echo a > $DIR/$tdir/file1
+ mkdir $DIR/$tdir/subdir
+ echo b > $DIR/$tdir/subdir/subfile1
+
+ remove_enc_key
+ # unmount client completely
+ umount_client $MOUNT || error "umount $MOUNT failed"
+ if is_mounted $MOUNT2; then
+ umount_client $MOUNT2 || error "umount $MOUNT2 failed"
+ fi
+
+ # remount client with subdirectory mount
+ export FILESET=/$tdir
+ mount_client $MOUNT ${MOUNT_OPTS} || error "remount failed"
+ if [ "$MOUNT_2" ]; then
+ mount_client $MOUNT2 ${MOUNT_OPTS} || error "remount failed"
+ fi
+ export FILESET=""
+
+ ls -Rl $DIR || error "ls -Rl $DIR failed (1)"
+
+ # now, with the key
+ insert_enc_key
+
+ ls -Rl $DIR || error "ls -Rl $DIR failed (2)"
+ cat $DIR/file1 || error "cat $DIR/$tdir/file1 failed"
+ cat $DIR/subdir/subfile1 ||
+ error "cat $DIR/$tdir/subdir/subfile1 failed"
+}
+run_test 60 "Subdirmount of encrypted dir"
+