do_facet mds $LCTL --device $mds_svc getobjversion $fid
}
+# interop 18 <-> 20
+lustre_version=$(get_lustre_version mds)
+if [[ $lustre_version != 1.8* ]]; then
+ mds20="yes"
+fi
+
test_0a() {
local file=$DIR/$tfile
local pre
do_node $CLIENT1 mkfifo $DIR/$tfile
post=$(get_version $CLIENT1 $DIR)
if (($pre == $post)); then
- error "version not changed: pre $pre, post $post"
+ [ -n "$mds20" ] || error "version not changed: pre $pre, post $post"
fi
}
run_test 0d "VBR: create changes version of parent"
do_node $CLIENT1 rm $DIR/$tfile
post=$(get_version $CLIENT1 $DIR)
if (($pre == $post)); then
- error "version not changed: pre $pre, post $post"
+ [ -n "$mds20" ] || error "version not changed: pre $pre, post $post"
fi
}
run_test 0f "VBR: unlink changes version of parent"
do_node $CLIENT1 mcreate $file
pre=$(get_version $CLIENT1 $file)
- do_node $CLIENT1 chown $RUNAS_ID $file
+ do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $file
post=$(get_version $CLIENT1 $file)
if (($pre == $post)); then
error "version not changed: pre $pre, post $post"
do_node $CLIENT1 mcreate $file
pre=$(get_version $CLIENT1 $file)
- do_node $CLIENT1 chown :$RUNAS_ID $file
+ do_node $CLIENT1 chgrp $RUNAS_GID $file
post=$(get_version $CLIENT1 $file)
if (($pre == $post)); then
error "version not changed: pre $pre, post $post"
do_node $CLIENT1 mcreate $file
replay_barrier mds
- do_node $CLIENT2 chown :$RUNAS_ID $file
- do_node $CLIENT1 chown $RUNAS_ID $file
+ do_node $CLIENT2 chgrp $RUNAS_GID $file
+ do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $file
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
do_node $CLIENT1 mcreate $file
replay_barrier mds
- do_node $CLIENT2 chown $RUNAS_ID $file
- do_node $CLIENT1 chown :$RUNAS_ID $file
+ do_node $CLIENT2 chown $RUNAS_ID:$RUNAS_GID $file
+ do_node $CLIENT1 chgrp $RUNAS_GID $file
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $file
replay_barrier mds
- do_node $CLIENT2 chown :$RUNAS_ID $file
+ do_node $CLIENT2 chgrp $RUNAS_GID $file
do_node $CLIENT1 chmod 666 $file
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
do_node $CLIENT1 mcreate $file
pre=$(get_version $CLIENT1 $file)
- do_node $CLIENT1 truncate $file 1
+ do_node $CLIENT1 $TRUNCATE $file 1
post=$(get_version $CLIENT1 $file)
if (($pre != $post)); then
error "version changed unexpectedly: pre $pre, post $post"
replay_barrier mds
do_node $CLIENT2 chmod 666 $file
- do_node $CLIENT1 truncate $file 1
+ do_node $CLIENT1 $TRUNCATE $file 1
sleep 1
mtime_pre=$(do_node $CLIENT1 stat --format=%Y $file)
do_node $CLIENT1 touch $file
error "version of source not changed: pre $pre, post $post"
fi
if (($tp_pre == $tp_post)); then
- error "version of target parent not changed: pre $tp_pre, post $tp_post"
+ [ -n "$mds20" ] || \
+ error "version of target parent not changed: pre $tp_pre, post $tp_post"
fi
}
run_test 0s "VBR: link changes versions of source and target parent"
sp_post=$(get_version $CLIENT1 $DIR)
tp_post=$(get_version $CLIENT1 $DIR/$tdir)
if (($sp_pre == $sp_post)); then
- error "version of source parent not changed: pre $sp_pre, post $sp_post"
+ [ -n "$mds20" ] || \
+ error "version of source parent not changed: pre $sp_pre, post $sp_post"
fi
if (($tp_pre == $tp_post)); then
- error "version of target parent not changed: pre $tp_pre, post $tp_post"
+ [ -n "$mds20" ] || \
+ error "version of target parent not changed: pre $tp_pre, post $tp_post"
fi
}
run_test 0v "VBR: rename changes versions of source parent and target parent"
do_node $CLIENT1 mv $DIR/$tfile $DIR/$tfile-new
post=$(get_version $CLIENT1 $DIR)
if (($pre == $post)); then
- error "version of parent not changed: pre $pre, post $post"
+ [ -n "$mds20" ] || \
+ error "version of parent not changed: pre $pre, post $post"
fi
}
run_test 0w "VBR: rename within same dir changes version of parent"
replay_barrier mds
do_node $CLIENT1 chmod 666 $DIR/$tfile-a # R
do_node $CLIENT2 chmod 666 $DIR1/$tfile-b # R
- do_node $CLIENT2 chown :$RUNAS_ID $DIR2/$tfile-a # U
- do_node $CLIENT1 chown $RUNAS_ID $DIR/$tfile-a # J
- do_node $CLIENT2 truncate $DIR2/$tfile-b 1 # U
- do_node $CLIENT2 chown :$RUNAS_ID $DIR1/$tfile-b # R
- do_node $CLIENT1 chown $RUNAS_ID $DIR/$tfile-b # R
+ do_node $CLIENT2 chgrp $RUNAS_GID $DIR2/$tfile-a # U
+ do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $DIR/$tfile-a # J
+ do_node $CLIENT2 $TRUNCATE $DIR2/$tfile-b 1 # U
+ do_node $CLIENT2 chgrp $RUNAS_GID $DIR1/$tfile-b # R
+ do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $DIR/$tfile-b # R
zconf_umount $CLIENT2 $MOUNT2
facet_failover mds
do_node $CLIENT2 $CHECKSTAT -p 0666 -u \\\#$UID -g \\\#$UID \
$DIR1/$tfile-a || error "$DIR/$tfile-a: unexpected state"
- do_node $CLIENT2 $CHECKSTAT -p 0666 -u \\\#$RUNAS_ID -g \\\#$RUNAS_ID \
+ do_node $CLIENT2 $CHECKSTAT -p 0666 -u \\\#$RUNAS_ID -g \\\#$RUNAS_GID \
$DIR1/$tfile-b || error "$DIR/$tfile-b: unexpected state"
zconf_umount $CLIENT2 $MOUNT1
[ "$CLIENTS" ] && zconf_mount_clients $CLIENTS $DIR
-equals_msg `basename $0`: test complete, cleaning up
-#SLEEP=$((`date +%s` - $NOW))
-#[ $SLEEP -lt $TIMEOUT ] && sleep $SLEEP
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
-[ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true
+exit_status