[DRBD-cvs] testing by lars; fail disk/reaatach does work for seconda...

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Mon, 7 Jun 2004 15:58:32 +0200 (CEST)


DRBD CVS committal

Author  : lars
Project : drbd
Module  : testing

Dir     : drbd/testing/CTH


Modified Files:
      Tag: rel-0_7-branch
	CTH_bash.helpers T-003.sh T-005.sh T-006.sh 


Log Message:
fail disk/reaatach does work for secondary disk, too, now
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/testing/CTH/Attic/CTH_bash.helpers,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -3 -r1.1.2.8 -r1.1.2.9
--- CTH_bash.helpers	7 Jun 2004 10:16:39 -0000	1.1.2.8
+++ CTH_bash.helpers	7 Jun 2004 13:58:27 -0000	1.1.2.9
@@ -1,5 +1,5 @@
 #!/bin/bash -nv
-# $Id: CTH_bash.helpers,v 1.1.2.8 2004/06/07 10:16:39 lars Exp $
+# $Id: CTH_bash.helpers,v 1.1.2.9 2004/06/07 13:58:27 lars Exp $
 #
 # define some implicit magic
 # so the definition of the DRBDs will be easier
@@ -332,6 +332,7 @@
 	local rs=$1 i fs cn CN which
 	i=${rs#RS_}
 	which=${!rs}; [[ $which == *CN=* ]] && cn=${which#*CN=} || cn=''
+	which=${which%% *}
 	fs=FS_$i; CN=""
 	eval "${!fs}"
 
@@ -340,8 +341,12 @@
 	[[ $cn == Node_* ]]    || return 103
 
 	bdev_to_env $BDEV
-	on ${!cn}: generic_test_stop MNT=$MNT
-	on ${!cn}: do_umount         MNT=$MNT
+	if [[ $(type -t ${which}_stop) == function ]] ; then
+		on ${!cn}: ${which}_stop     MNT=$MNT
+	else
+		on ${!cn}: generic_test_stop MNT=$MNT
+	fi
+	on ${!cn}: do_umount MNT=$MNT
 	if [[ $BDEV == Drbd_* ]] ; then
 		on ${!cn}: drbdadm_sec       name=$name
 	else
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/testing/CTH/Attic/T-003.sh,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -3 -r1.1.2.1 -r1.1.2.2
--- T-003.sh	3 Jun 2004 11:05:53 -0000	1.1.2.1
+++ T-003.sh	7 Jun 2004 13:58:27 -0000	1.1.2.2
@@ -1,16 +1,16 @@
 #!/usr/bin/env - /bin/bash
-# $Id: T-003.sh,v 1.1.2.1 2004/06/03 11:05:53 lars Exp $
+# $Id: T-003.sh,v 1.1.2.2 2004/06/07 13:58:27 lars Exp $
 
 #
 # Fail Secondary disk, reattach "healed" disk, Relocate Service.
-# does NOT work, pending_cnt gets confused!
+# does work.
 #
 
 Start RS_1 Node_1
 
 echo "FAIL Secondary DISK"
 Fail_Disk Disk_2
-sleep 10
+sleep 30
 
 echo "HEAL Secondary DISK"
 Heal_Disk Disk_2
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/testing/CTH/Attic/T-005.sh,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -3 -r1.1.2.1 -r1.1.2.2
--- T-005.sh	3 Jun 2004 11:05:53 -0000	1.1.2.1
+++ T-005.sh	7 Jun 2004 13:58:27 -0000	1.1.2.2
@@ -1,5 +1,5 @@
 #!/usr/bin/env - /bin/bash
-# $Id: T-005.sh,v 1.1.2.1 2004/06/03 11:05:53 lars Exp $
+# $Id: T-005.sh,v 1.1.2.2 2004/06/07 13:58:27 lars Exp $
 
 #
 # Fail Primary disk, Relocate service, reattach "healed" disk on now secondary
@@ -14,19 +14,20 @@
 
 # start it.
 Start RS_1 Node_1
-sleep 30
+sleeptime=30
+sleep $sleeptime
 
 while true; do
 
 	Fail_Disk Disk_1
-	sleep 30
+	sleep $sleeptime
 
 	Reloc RS_1 Node_2
-	sleep 30
+	sleep $sleeptime
 
 	Heal_Disk Disk_1
 	on $Node_1: drbd_reattach minor=0 name=r0
-	sleep 30
+	sleep $sleeptime
 	# now wait for sync,
 	# I don't want to bail out of the test early
 	# because I fail the only good copy of the data ...
@@ -35,14 +36,14 @@
 	# and reverse
 	
 	Fail_Disk Disk_2
-	sleep 30
+	sleep $sleeptime
 
 	Reloc RS_1 Node_1
-	sleep 30
+	sleep $sleeptime
 
 	Heal_Disk Disk_2
 	on $Node_2: drbd_reattach minor=0 name=r0
-	sleep 30
+	sleep $sleeptime
 	on $Node_2: drbd_wait_sync minor=0
 
 done
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/testing/CTH/Attic/T-006.sh,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -3 -r1.1.2.1 -r1.1.2.2
--- T-006.sh	3 Jun 2004 11:05:53 -0000	1.1.2.1
+++ T-006.sh	7 Jun 2004 13:58:27 -0000	1.1.2.2
@@ -1,11 +1,10 @@
 #!/usr/bin/env - /bin/bash
-# $Id: T-006.sh,v 1.1.2.1 2004/06/03 11:05:53 lars Exp $
+# $Id: T-006.sh,v 1.1.2.2 2004/06/07 13:58:27 lars Exp $
 
 #
 # Fail Secondary disk, reattach "healed" disk, Relocate Service.
 #
-# in a loop. does NOT work.
-# pending_cnt gets confused!
+# in a loop. does work.
 #
 # not exactly "real world" since actually we'd need a "invalidate",
 # because we put in a new and clean disk. 
@@ -15,35 +14,36 @@
 
 # start it.
 Start RS_1 Node_1
-sleep 30
+sleeptime=30
+sleep $sleeptime
 
 while true; do
 
 	Fail_Disk Disk_2
-	sleep 30
+	sleep $sleeptime
 
 	Heal_Disk Disk_2
-	on $Node_1: drbd_reattach minor=0 name=r0
-	sleep 30
+	on $Node_2: drbd_reattach minor=0 name=r0
+	sleep $sleeptime
 	# now wait for sync,
 	# I don't want to bail out of the test early
 	# because I fail the only good copy of the data ...
-	on $Node_1: drbd_wait_sync minor=0
+	on $Node_2: drbd_wait_sync minor=0
 
 	Reloc RS_1 Node_2
-	sleep 30
+	sleep $sleeptime
 
 	# and reverse
 	
 	Fail_Disk Disk_1
-	sleep 30
+	sleep $sleeptime
 
 	Heal_Disk Disk_1
-	on $Node_2: drbd_reattach minor=0 name=r0
-	sleep 30
-	on $Node_2: drbd_wait_sync minor=0
+	on $Node_1: drbd_reattach minor=0 name=r0
+	sleep $sleeptime
+	on $Node_1: drbd_wait_sync minor=0
 
 	Reloc RS_1 Node_1
-	sleep 30
+	sleep $sleeptime
 
 done