set -e
-# bug number:
-ALWAYS_EXCEPT="3c 4b 4c 10 $REPLAY_VBR_EXCEPT"
+# bug number: 16356
+ALWAYS_EXCEPT="2 3c 4b 4c 10 $REPLAY_VBR_EXCEPT"
SAVE_PWD=$PWD
PTLDEBUG=${PTLDEBUG:--1}
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
-[ -n "$CLIENTS" ] || { skip "Need two or more clients" && exit 0; }
+[ -n "$CLIENTS" ] || { skip_env "Need two or more clients" && exit 0; }
[ $CLIENTCOUNT -ge 2 ] || \
- { skip "Need two or more clients, have $CLIENTCOUNT" && exit 0; }
+ { skip_env "Need two or more remote clients, have $CLIENTCOUNT" && exit 0; }
remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
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
run_test 0a "VBR: open and close do not change versions"
test_0b() {
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
replay_barrier mds
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
- do_node $CLIENT1 df $MOUNT && error "$CLIENT1 not evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
if ! do_node $CLIENT1 $CHECKSTAT -a $DIR/$tdir/$tfile; then
error "open succeeded unexpectedly"
fi
run_test 0b "VBR: open (O_CREAT) checks version of parent"
test_0c() {
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $DIR/$tdir/$tfile
rmultiop_start $CLIENT1 $DIR/$tdir/$tfile o_c
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
+ client_up $CLIENT1 || error "$CLIENT1 evicted"
- do_node $CLIENT1 df $MOUNT || error "$CLIENT1 evicted"
rmultiop_stop $CLIENT1 || error "close failed"
zconf_mount $CLIENT2 $MOUNT
}
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"
test_0e() {
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
replay_barrier mds
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
- do_node $CLIENT1 df $MOUNT && error "$CLIENT1 not evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
if ! do_node $CLIENT1 $CHECKSTAT -a $DIR/$tdir/$tfile; then
error "create succeeded unexpectedly"
fi
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"
test_0g() {
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
do_node $CLIENT1 mcreate $DIR/$tdir/$tfile
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
- do_node $CLIENT1 df $MOUNT && error "$CLIENT1 not evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
if do_node $CLIENT1 $CHECKSTAT -a $DIR/$tdir/$tfile; then
error "unlink succeeded unexpectedly"
fi
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"
test_0j() {
local file=$DIR/$tfile
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
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 df $MOUNT && error "$CLIENT1 not evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
if ! do_node $CLIENT1 $CHECKSTAT -u \\\#$UID $file; then
error "setattr of UID succeeded unexpectedly"
fi
test_0k() {
local file=$DIR/$tfile
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
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 df $MOUNT && error "$CLIENT1 not evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
if ! do_node $CLIENT1 $CHECKSTAT -g \\\#$UID $file; then
error "setattr of GID succeeded unexpectedly"
fi
test_0m() {
local file=$DIR/$tfile
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
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 df $MOUNT && error "$CLIENT1 not evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
if ! do_node $CLIENT1 $CHECKSTAT -p 0644 $file; then
error "setattr of permission succeeded unexpectedly"
fi
local file=$DIR/$tfile
local rc
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $file
replay_barrier mds
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
- do_node $CLIENT1 df $MOUNT && error "$CLIENT1 not evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
checkattr $CLIENT1 i $file
rc=$?
do_node $CLIENT1 chattr -i $file
local post
local ad_orig
- ad_orig=$(do_facet mds "$LCTL get_param mds.${mds_svc}.atime_diff")
- do_facet mds "$LCTL set_param mds.${mds_svc}.atime_diff=0"
+ ad_orig=$(do_facet mds "$LCTL get_param *.${mds_svc}.atime_diff")
+ do_facet mds "$LCTL set_param *.${mds_svc}.atime_diff=0"
do_node $CLIENT1 mcreate $file
pre=$(get_version $CLIENT1 $file)
do_node $CLIENT1 touch $file
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"
local mtime_post
local mtime
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
- do_facet mds "$LCTL set_param mds.${mds_svc}.atime_diff=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.atime_diff=0"
do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $file
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
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
- do_node $CLIENT1 df $MOUNT || error "$CLIENT1 evicted"
+ client_up $CLIENT1 || error "$CLIENT1 evicted"
if (($mtime_pre >= $mtime_post)); then
error "time not changed: pre $mtime_pre, post $mtime_post"
fi
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"
test_0t() {
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
do_node $CLIENT1 mcreate $DIR/$tfile
do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
- do_node $CLIENT1 df $MOUNT && error "$CLIENT1 not evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
if ! do_node $CLIENT1 $CHECKSTAT -a $DIR/$tdir/$tfile; then
error "link should fail"
fi
run_test 0t "VBR: link checks version of target parent"
test_0u() {
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $DIR/$tfile
do_node $CLIENT1 mkdir -p $DIR/$tdir
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
- do_node $CLIENT1 df $MOUNT && error "$CLIENT1 not evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
if ! do_node $CLIENT1 $CHECKSTAT -a $DIR/$tdir/$tfile; then
error "link should fail"
fi
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"
test_0x() {
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
do_node $CLIENT1 mcreate $DIR/$tfile
do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
- do_node $CLIENT1 df $MOUNT && error "$CLIENT1 not evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
if do_node $CLIENT1 $CHECKSTAT -a $DIR/$tfile; then
error "rename should fail"
fi
run_test 0x "VBR: rename checks version of source parent"
test_0y() {
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
do_node $CLIENT1 mcreate $DIR/$tfile
do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
zconf_umount $CLIENT2 $MOUNT
facet_failover mds
- do_node $CLIENT1 df $MOUNT && error "$CLIENT1 not evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
if do_node $CLIENT1 $CHECKSTAT -a $DIR/$tfile; then
error "rename should fail"
fi
facet_failover mds
# recovery shouldn't fail due to missing client 2
- do_node $CLIENT1 df $DIR || return 1
+ client_up $CLIENT1 || return 1
# All 50 files should have been replayed
do_node $CLIENT1 unlinkmany $DIR/$tfile- 25 || return 2
facet_failover mds
# recovery shouldn't fail due to missing client 2
- do_node $CLIENT1 df $DIR || return 1
+ client_up $CLIENT1 || return 1
# All 50 files should have been replayed
do_node $CLIENT1 unlinkmany $DIR/$tfile- 25 || return 2
local pre
local post
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0"
zconf_mount $CLIENT1 $MOUNT
zconf_mount $CLIENT2 $MOUNT2
zconf_mount $CLIENT2 $MOUNT1
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 $CLIENT1 df $MOUNT && error "$CLIENT1:$MOUNT not evicted"
- do_node $CLIENT2 df $MOUNT1 || error "$CLIENT2:$MOUNT1 evicted"
+ client_evicted $CLIENT1 || error "$CLIENT1:$MOUNT not evicted"
+ client_up $CLIENT2 || error "$CLIENT2:$MOUNT1 evicted"
#
# Check the MDT epoch. $post must be the first transaction
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
zconf_mount_clients $CLIENT2 $DIR
#make sure the time will change
- do_facet mds "$LCTL set_param mds.${mds_svc}.atime_diff=0" || return
+ do_facet mds "$LCTL set_param *.${mds_svc}.atime_diff=0" || return
do_node $CLIENT1 touch $DIR/$tfile
do_node $CLIENT2 $CHECKSTAT $DIR/$tfile
sleep 1
facet_failover mds
# recovery shouldn't fail due to missing client 2
- do_node $CLIENT1 df $DIR || return 1
+ client_up $CLIENT1 || return 1
do_node $CLIENT1 $CHECKSTAT $DIR/$tfile && return 2
zconf_mount $CLIENT2 $DIR || error "mount $CLIENT2 $DIR fail"
zconf_mount_clients $CLIENT2 $DIR
#make sure the time will change
- do_facet mds "$LCTL set_param mds.${mds_svc}.atime_diff=0" || return
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=0" || return
+ do_facet mds "$LCTL set_param *.${mds_svc}.atime_diff=0" || return
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=0" || return
do_node $CLIENT1 touch $DIR/$tfile
do_node $CLIENT2 $CHECKSTAT $DIR/$tfile
sleep 1
facet_failover mds
# recovery should fail due to missing client 2
- do_node $CLIENT1 df $DIR && return 1
+ client_evicted $CLIENT1 || return 1
do_node $CLIENT1 $CHECKSTAT -p 0755 $DIR/$tfile && return 2
zconf_mount $CLIENT2 $DIR || error "mount $CLIENT2 $DIR fail"
[ "$FAILURE_MODE" = HARD ] || \
{ skip "The HARD failure is needed" && return 0; }
- [ $RUNAS_ID -eq $UID ] && skip "RUNAS_ID = UID = $UID -- skipping" && return
+ [ $RUNAS_ID -eq $UID ] && skip_env "RUNAS_ID = UID = $UID -- skipping" && return
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
# check that permission changes are synced
- do_facet mds "$LCTL set_param mds.${mds_svc}.sync_permission=1"
+ do_facet mds "$LCTL set_param *.${mds_svc}.sync_permission=1"
do_node $CLIENT1 mkdir -p $DIR/d3c/sub || error
#chown -R $RUNAS_ID $MOUNT1/d3
facet_failover mds
# recovery shouldn't fail due to missing client 2
- do_node $CLIENT1 df $DIR || return 1
- sleep 1
+ client_up $CLIENT1 || return 1
zconf_mount $CLIENT2 $DIR || error "mount $CLIENT2 $DIR fail"
do_node $CLIENT1 $RUNAS cat $DIR/d3c/sub/$tfile && return 6
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
remote_server $CLIENT2 || \
- { skip "Client $CLIENT2 is on the server node" && return 0; }
+ { skip_env "Client $CLIENT2 is on the server node" && return 0; }
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
vbr_deactivate_client $CLIENT2
facet_failover mds
- do_node $CLIENT1 df $DIR || return 1
+ client_up $CLIENT1 || return 1
# All 50 files should have been replayed
do_node $CLIENT1 unlinkmany $DIR/$tfile- 25 || return 2
do_node $CLIENT1 unlinkmany $DIR/$tfile-3- 25 || return 3
vbr_activate_client $CLIENT2
- do_node $CLIENT2 df $DIR || return 4
+ client_up $CLIENT2 || return 4
# All 25 files from client2 should have been replayed
do_node $CLIENT2 unlinkmany $DIR/$tdir/$tfile-2- 25 || return 5
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
remote_server $CLIENT2 || \
- { skip "Client $CLIENT2 is on the server node" && return 0; }
+ { skip_env "Client $CLIENT2 is on the server node" && return 0; }
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
vbr_deactivate_client $CLIENT2
facet_failover mds
- do_node $CLIENT1 df $DIR || return 1
+ client_up $CLIENT1 || return 1
# create another set of files
do_node $CLIENT1 createmany -o $DIR/$tfile-3- 25
vbr_activate_client $CLIENT2
- do_node $CLIENT2 df $DIR || return 2
+ client_up $CLIENT2 || return 2
# All files from should have been replayed
do_node $CLIENT1 unlinkmany $DIR/$tfile- 25 || return 3
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
remote_server $CLIENT2 || \
- { skip "Client $CLIENT2 is on the server node" && return 0; }
+ { skip_env "Client $CLIENT2 is on the server node" && return 0; }
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
vbr_deactivate_client $CLIENT2
facet_failover mds
- do_node $CLIENT1 df $DIR || return 1
+ client_up $CLIENT1 || return 1
# create another set of files
do_node $CLIENT1 createmany -m $DIR/$tfile-3- 25
vbr_activate_client $CLIENT2
- do_node $CLIENT2 df $DIR || return 2
+ client_up $CLIENT2 || return 2
# All files from should have been replayed
do_node $CLIENT1 unlinkmany $DIR/$tfile- 25 || return 3
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
remote_server $CLIENT2 || \
- { skip "Client $CLIENT2 is on the server node" && return 0; }
+ { skip_env "Client $CLIENT2 is on the server node" && return 0; }
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
vbr_deactivate_client $CLIENT2
facet_failover mds
- do_node $CLIENT1 df $DIR && return 1
+ client_evicted $CLIENT1 || return 1
vbr_activate_client $CLIENT2
- do_node $CLIENT2 df $DIR || return 2
+ client_up $CLIENT2 || return 2
# First 25 files should have been replayed
do_node $CLIENT1 unlinkmany $DIR/$tfile- 25 || return 3
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
remote_server $CLIENT2 || \
- { skip "Client $CLIENT2 is on the server node" && return 0; }
+ { skip_env "Client $CLIENT2 is on the server node" && return 0; }
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
vbr_deactivate_client $CLIENT2
facet_failover mds
- do_node $CLIENT1 df $DIR || return 1
+ client_up $CLIENT1 || return 1
do_node $CLIENT1 $CHECKSTAT $DIR/$tfile-2-0 && error "$tfile-2-0 exists"
# create another set of files
do_node $CLIENT1 createmany -o $DIR/$tfile-3- 25
vbr_activate_client $CLIENT2
- do_node $CLIENT2 df $DIR && return 4
+ client_evicted $CLIENT2 || return 4
# file from client2 should fail
do_node $CLIENT2 $CHECKSTAT $DIR/$tfile-2-0 && error "$tfile-2-0 exists"
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
remote_server $CLIENT2 || \
- { skip "Client $CLIENT2 is on the server node" && return 0; }
+ { skip_env "Client $CLIENT2 is on the server node" && return 0; }
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
do_node $CLIENT2 "sysctl -w lustre.fail_val=5"
#define OBD_FAIL_PTLRPC_REPLAY 0x50e
do_node $CLIENT2 "sysctl -w lustre.fail_loc=0x2000050e"
- do_node $CLIENT2 df $DIR
+ client_up $CLIENT2
# vbr_activate_client $CLIENT2
# need way to know that client stops replays
sleep 5
facet_failover mds
- do_node $CLIENT1 df $DIR || return 1
+ client_up $CLIENT1 || return 1
# All files should have been replayed
do_node $CLIENT1 unlinkmany $DIR/$tfile- 25 || return 2
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
remote_server $CLIENT2 || \
- { skip "Client $CLIENT2 is on the server node" && return 0; }
+ { skip_env "Client $CLIENT2 is on the server node" && return 0; }
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
facet_failover mds
vbr_activate_client $CLIENT2
- do_node $CLIENT2 df $DIR || return 4
+ client_up $CLIENT2 || return 4
facet_failover mds
- do_node $CLIENT1 df $DIR || return 1
+ client_up $CLIENT1 || return 1
# All files should have been replayed
do_node $CLIENT1 unlinkmany $DIR/$tfile- 25 || return 2
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
remote_server $CLIENT2 || \
- { skip "Client $CLIENT2 is on the server node" && return 0; }
+ { skip_env "Client $CLIENT2 is on the server node" && return 0; }
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
vbr_deactivate_client $CLIENT2
facet_failover mds
- do_node $CLIENT1 df $DIR || return 3
+ client_up $CLIENT1 || return 3
#client1 is back and will try to open orphan
vbr_activate_client $CLIENT2
- do_node $CLIENT2 df $DIR || return 4
+ client_up $CLIENT2 || return 4
do_node $CLIENT2 $CHECKSTAT $DIR/$tfile && error "$tfile exists"
zconf_umount_clients $CLIENTS $DIR
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
remote_server $CLIENT2 || \
- { skip "Client $CLIENT2 is on the server node" && return 0; }
+ { skip_env "Client $CLIENT2 is on the server node" && return 0; }
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
vbr_deactivate_client $CLIENT2
facet_failover mds
- do_node $CLIENT1 df $DIR || return 2
+ client_up $CLIENT1 || return 2
#client1 is back and will try to open orphan
vbr_activate_client $CLIENT2
- do_node $CLIENT2 df $DIR || return 3
+ client_up $CLIENT2 || return 3
rmultiop_stop $CLIENT2 || return 1
do_node $CLIENT2 $CHECKSTAT $DIR/$tfile && error "$tfile exists"
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
remote_server $CLIENT2 || \
- { skip "Client $CLIENT2 is on the server node" && return 0; }
+ { skip_env "Client $CLIENT2 is on the server node" && return 0; }
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
vbr_deactivate_client $CLIENT2
facet_failover mds
- do_node $CLIENT1 df $DIR || return 3
+ client_up $CLIENT1 || return 3
#client1 is back and will try to open orphan
vbr_activate_client $CLIENT2
- do_node $CLIENT2 df $DIR || return 4
+ client_up $CLIENT2 || return 4
do_node $CLIENT2 $CHECKSTAT $DIR/$tfile && error "$tfile exists"
zconf_umount_clients $CLIENTS $DIR
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
remote_server $CLIENT2 || \
- { skip "Client $CLIENT2 is on the server node" && return 0; }
+ { skip_env "Client $CLIENT2 is on the server node" && return 0; }
zconf_mount_clients $CLIENT1 $DIR
zconf_mount_clients $CLIENT2 $DIR
vbr_deactivate_client $CLIENT2
facet_failover mds
- do_node $CLIENT1 df $DIR || return 6
+ client_up $CLIENT1 || return 6
#client1 is back and will try to open orphan
vbr_activate_client $CLIENT2
- do_node $CLIENT2 df $DIR || return 8
+ client_up $CLIENT2 || return 8
do_node $CLIENT2 $CHECKSTAT $DIR/$tfile && error "$tfile exists"
zconf_umount_clients $CLIENTS $DIR
zconf_umount $CLIENT1 $DIR
facet_failover mds
- do_node $CLIENT2 df $DIR || return 6
+ client_up $CLIENT2 || return 6
do_node $CLIENT2 rm $DIR/$tfile || error "$tfile doesn't exists"
zconf_umount_clients $CLIENTS $DIR
zconf_umount $CLIENT1 $DIR
facet_failover mds
- do_node $CLIENT2 df $DIR || return 6
+ client_up $CLIENT2 || return 6
do_node $CLIENT2 rm $DIR/$tfile || error "$tfile doesn't exists"
zconf_umount $CLIENT2 $DIR
test_10 () {
delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
- [ -z "$DBENCH_LIB" ] && skip "DBENCH_LIB is not set" && return 0
+ [ -z "$DBENCH_LIB" ] && skip_env "DBENCH_LIB is not set" && return 0
zconf_mount_clients $CLIENTS $DIR
sleep $TIMEOUT
vbr_activate_client $CLIENT2
- do_node $CLIENT2 df $DIR || return 4
+ client_up $CLIENT2 || return 4
for CLIENT in ${CLIENTS//,/ }; do
PID=`cat pid.$CLIENT`
[ "$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