[DRBD-cvs] testing by lars; small improvements to CTH, Drbd_MD5_diff...
drbd-user@lists.linbit.com
drbd-user@lists.linbit.com
Thu, 17 Jun 2004 03:35:57 +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-007.sh functions.sh
Log Message:
small improvements to CTH, Drbd_MD5_diff
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/testing/CTH/Attic/CTH_bash.helpers,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -3 -r1.1.2.10 -r1.1.2.11
--- CTH_bash.helpers 15 Jun 2004 08:41:02 -0000 1.1.2.10
+++ CTH_bash.helpers 17 Jun 2004 01:35:52 -0000 1.1.2.11
@@ -1,5 +1,5 @@
#!/bin/bash -nv
-# $Id: CTH_bash.helpers,v 1.1.2.10 2004/06/15 08:41:02 lars Exp $
+# $Id: CTH_bash.helpers,v 1.1.2.11 2004/06/17 01:35:52 lars Exp $
#
# define some implicit magic
# so the definition of the DRBDs will be easier
@@ -208,11 +208,11 @@
# let "MLOC=USIZE-128*1024"
perl -e '
use Digest::MD5 "md5_hex";
- $pos=0;
+ $nr=0;
while (sysread(STDIN,$buf,4096)==4096) {
printf "%6d\t%s\n",$nr++,md5_hex($buf);
- '${USIZE:+"last if \$pos+=4 >= $USIZE*1024;"}'
- }' < $DEV
+ '${USIZE:+"last if \$pos+=4 >= $USIZE*256;"}'
+ }; print "\nDEVICE_SIZE\t$nr\tblocks \@ 4KB\n"; ' < $DEV
}
Drbd_MD5_diff()
@@ -224,9 +224,9 @@
> md5sum-${!left}-$name
on ${!right}: blockwise_md5_pl DEV=/dev/mapper/$name USIZE=$usize \
> md5sum-${!right}-$name
- lines=$(wc -l < md5sum-${!right}-$name)
+ blocks=$( grep ^DEVICE_SIZE < md5sum-${!right}-$name | cut -f 2 )
echo "NOTE: internal meta data may differ..."
- echo "md probably starts at blocknr $[lines-(128<<8)]"
+ echo "md probably starts at blocknr $[blocks-(128<<8)]"
diff -u md5sum-${!left}-$name md5sum-${!right}-$name
}
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/testing/CTH/Attic/T-007.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-007.sh 15 Jun 2004 08:41:02 -0000 1.1.2.1
+++ T-007.sh 17 Jun 2004 01:35:52 -0000 1.1.2.2
@@ -1,5 +1,5 @@
#!/usr/bin/env - /bin/bash
-# $Id: T-007.sh,v 1.1.2.1 2004/06/15 08:41:02 lars Exp $
+# $Id: T-007.sh,v 1.1.2.2 2004/06/17 01:35:52 lars Exp $
#
# Fail Link; Heal Link; wait for sync; Relocate service.
@@ -7,13 +7,13 @@
# in a loop. does work.
#
-sleeptime=20
+sleeptime=30
# start it.
Start RS_1 Node_1
sleep 10
-iter=2
+iter=150
while (( iter-- )); do
Fail_Link Link_1
@@ -39,12 +39,15 @@
sleep $(( sleeptime - SECONS ))
fi
- Reloc RS_1 Node_1
+ Stop RS_1
+ if (( iter % 10 == 0 )) ; then
+ Drbd_MD5_diff Drbd_1 > md5sum.r0.diff.$iter
+ fi
+ Start RS_1 Node_1
+
sleep $sleeptime
echo "===> $iter iterations to go ... <==="
done
Stop RS_1
-
-Drbd_MD5_diff Drbd_1 > md5sum.r0.diff
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/testing/CTH/Attic/functions.sh,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -3 -r1.1.2.7 -r1.1.2.8
--- functions.sh 15 Jun 2004 08:41:02 -0000 1.1.2.7
+++ functions.sh 17 Jun 2004 01:35:52 -0000 1.1.2.8
@@ -1,6 +1,6 @@
#!/bin/bash
# vim: set foldmethod=marker nofoldenable :
-# $Id: functions.sh,v 1.1.2.7 2004/06/15 08:41:02 lars Exp $
+# $Id: functions.sh,v 1.1.2.8 2004/06/17 01:35:52 lars Exp $
#DEBUG="-vx"
#DEBUG="-v"
@@ -55,8 +55,7 @@
wbtest -s checkpoint -t data -l $WBTLOG -V 2>&1 |
sed '/Processed checkfile .*: \([0-9]*\)\/\1 passed/d'
echo "remaining garbage files:"
- # FIXME should be empty, but is not.
- # wbtest does not like to be killed.
+ echo "FIXME! should be empty, but is not. wbtest does not like to be killed."
ls -l checkpoint/ data/
du -s checkpoint/ data/
# CHANGE, but be aware that -c 20,
@@ -339,12 +338,12 @@
{
: ${name:?unknown resource name}
: ${force:=}
+ drbdadm $force primary $name
# FIXME should not be neccessary!
# patch already done, needs to be checked in...
- drbdadm $force primary $name
- if [[ $force ]] ; then
- drbdadm invalidate_remote $name || true
- fi
+ # if [[ $force ]] ; then
+ # drbdadm invalidate_remote $name || true
+ # fi
echo "$name now Primary on $HOSTNAME"
}