svn commit: lorikeet r780 - in trunk/heimdal/tests/kdc: .

lha at samba.org lha at samba.org
Wed Aug 8 07:08:31 GMT 2007


Author: lha
Date: 2007-08-08 07:08:30 +0000 (Wed, 08 Aug 2007)
New Revision: 780

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=780

Log:
Merged with Heimdal svn revision 21858
Modified:
   trunk/heimdal/tests/kdc/check-iprop.in
   trunk/heimdal/tests/kdc/wait-kdc.sh


Changeset:
Modified: trunk/heimdal/tests/kdc/check-iprop.in
===================================================================
--- trunk/heimdal/tests/kdc/check-iprop.in	2007-08-08 04:57:56 UTC (rev 779)
+++ trunk/heimdal/tests/kdc/check-iprop.in	2007-08-08 07:08:30 UTC (rev 780)
@@ -67,6 +67,8 @@
 rm -f mkey.file*
 rm -f messages.log
 
+> messages.log
+
 echo Creating database
 ${kadmin} -l \
     init \
@@ -88,33 +90,32 @@
 ipdm=
 kdcpid=
 
-trap "kill \${ipdm} \${ipds} \${kdcpid}; echo killing ipropd slave + master; exit 1;" EXIT
+> iprop-stats
+trap "echo 'killing ipropd s + m + kdc'; kill \${ipdm} \${ipds} \${kdcpid}; tail -10 messages.log iprop-stats; exit 1;" EXIT
 
 echo Starting kdc
 ${kdc} &
 kdcpid=$!
 
-sh ${srcdir}/wait-kdc.sh
-if [ "$?" != 0 ] ; then
-    kill ${kdcpid}
-    exit 1
-fi
+sh ${srcdir}/wait-kdc.sh || exit 1
 
 echo "starting master"
 ${ipropdmaster} --hostname=localhost -k ${keytab} \
     --database=${objdir}/current-db &
 ipdm=$!
-sleep 2
+sh ${srcdir}/wait-kdc.sh ipropd-master || exit 1
 
 echo "starting slave"
 KRB5_CONFIG="${objdir}/krb5-slave.conf" \
 ${ipropdslave} --hostname=slave -k ${keytab} localhost &
 ipds=$!
+sh ${srcdir}/wait-kdc.sh ipropd-slave || exit 1
 
-sleep 2
 echo "checking slave is up"
 ${EGREP} 'iprop/slave at TEST.H5L.SE.*Up' iprop-stats >/dev/null || exit 1
 
+# ----------------- checking: pushing lives changes
+
 echo "Add host"
 ${kadmin} -l add --random-key --use-defaults host/foo@${R} || exit 1
 sleep 2
@@ -141,6 +142,17 @@
 
 ${EGREP} 'iprop/slave at TEST.H5L.SE.*Down' iprop-stats >/dev/null || exit 1
 
+# ----------------- checking: slave is missing changes while down
+
+echo "doing changes while slave is down"
+${kadmin} -l cpw --random-password user@${R} > /dev/null || exit 1
+${kadmin} -l cpw --random-password user@${R} > /dev/null || exit 1
+
+echo "Makeing a copy of the master log file"
+cp ${objdir}/current.log ${objdir}/current.log.tmp
+
+# ----------------- checking: checking that master and slaves resyncs
+
 echo "starting slave again"
 > iprop-stats
 KRB5_CONFIG="${objdir}/krb5-slave.conf" \
@@ -168,6 +180,8 @@
 echo "checking for replay problems"
 ${EGREP} 'Entry already exists in database' messages.log && exit 1
 
+# ----------------- checking: checking live truncation of master log
+
 ${kadmin} -l cpw --random-password user@${R} > /dev/null || exit 1
 sleep 2
 
@@ -175,10 +189,9 @@
 ${iproplog} truncate || exit 1
 sleep 2
 
-trap "" EXIT
+echo "Killing master and slave"
+kill ${ipdm} ${ipds}
 
-kill ${ipdm} ${ipds} ${kdcpid}
-
 sleep 2
 ${EGREP} "^master down at " iprop-stats > /dev/null || exit 1
 
@@ -188,4 +201,39 @@
 ${iproplog} last-version > master-last.tmp
 cmp master-last.tmp slave-last.tmp || exit 1
 
+# ----------------- checking: master going backward
+
+echo "Going back to old version of the master log file"
+cp ${objdir}/current.log.tmp ${objdir}/current.log
+
+echo "starting master"
+${ipropdmaster} --hostname=localhost -k ${keytab} \
+    --database=${objdir}/current-db &
+ipdm=$!
+sleep 4
+
+echo "starting slave"
+> iprop-stats
+KRB5_CONFIG="${objdir}/krb5-slave.conf" \
+${ipropdslave} --hostname=slave -k ${keytab} localhost &
+ipds=$!
+sleep 2
+echo "checking slave is up again"
+${EGREP} 'iprop/slave at TEST.H5L.SE.*Up' iprop-stats >/dev/null || exit 1
+echo "checking for replay problems"
+${EGREP} 'Entry already exists in database' messages.log && exit 1
+
+echo "pushing one change"
+${kadmin} -l cpw --random-password user@${R} > /dev/null || exit 1
+sleep 2
+
+trap "" EXIT
+kill ${ipdm} ${ipds} ${kdcpid}
+
+echo "compare versions on master and slave logs"
+KRB5_CONFIG=${objdir}/krb5-slave.conf \
+${iproplog} last-version > slave-last.tmp
+${iproplog} last-version > master-last.tmp
+cmp master-last.tmp slave-last.tmp || exit 1
+
 exit $ec

Modified: trunk/heimdal/tests/kdc/wait-kdc.sh
===================================================================
--- trunk/heimdal/tests/kdc/wait-kdc.sh	2007-08-08 04:57:56 UTC (rev 779)
+++ trunk/heimdal/tests/kdc/wait-kdc.sh	2007-08-08 07:08:30 UTC (rev 780)
@@ -31,29 +31,30 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
 # SUCH DAMAGE. 
 #
-# $Id: wait-kdc.sh 18396 2006-10-10 10:30:09Z lha $
+# $Id: wait-kdc.sh 21858 2007-08-08 07:01:03Z lha $
 #
 
-log=${1:-messages.log}
+name=${1:-KDC}
+log=${2:-messages.log}
 
 t=0
 waitsec=20
 
-echo "Waiting for KDC to start, looking logfile ${log}"
+echo "Waiting for ${name} to start, looking logfile ${log}"
 
 while true ; do
     t=`expr ${t} + 2`
     sleep 2
     echo "Have waited $t seconds"
-    if tail -3 ${log} | grep 'KDC started' > /dev/null; then
+    if tail -30 ${log} | grep "${name} started" > /dev/null; then
 	break
     fi
-    if tail -3 ${log} | grep "No sockets" ; then
-       echo "The KDC failed to bind to any sockets, another KDC running ?"
+    if tail -30 ${log} | grep "No sockets" ; then
+       echo "The ${name} failed to bind to any sockets, another ${name} running ?"
        exit 1
     fi
     if [ "$t" -gt $waitsec ]; then
-       echo "Waited for $waitsec for the KDC to start, and it didnt happen"
+       echo "Waited for $waitsec for the ${name} to start, and it didnt happen"
        exit 2
     fi
 done



More information about the samba-cvs mailing list