Masato Taruishi
taru****@users*****
2004年 10月 7日 (木) 14:59:52 JST
=================================================================== RCS file: ultrapossum/module/test/test.d/00protocol,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ultrapossum/module/test/test.d/00protocol 2004/10/07 02:45:19 1.3 +++ ultrapossum/module/test/test.d/00protocol 2004/10/07 05:59:52 1.4 @@ -28,16 +28,9 @@ set -x fi -# For tempfile -. $SHAREDIR/init.d/10compat - -tmp=`tempfile` -tmp2=`tempfile` -trap "/bin/rm -f $tmp $tmp2" 0 - ########### Add Test -cat >$tmp <<EOF +cat >$TMPFILE <<EOF dn: ou=add,$TESTSUFFIX objectClass: top objectClass: organizationalUnit @@ -45,13 +38,12 @@ EOF -ldapadd -x -w $ROOTPW -D $ROOTDN -h $HOST -f $tmp -ldapsearch -x -w $ROOTPW -LLL -D $ROOTDN -h $HOST -b $TESTSUFFIX ou=add > $tmp2 -diff -c $tmp $tmp2 +ldapadd -x -w $ROOTPW -D $ROOTDN -h $HOST -f $TMPFILE +ldapsearch -x -w $ROOTPW -LLL -D $ROOTDN -h $HOST -b $TESTSUFFIX ou=add | diff -c $TMPFILE - ############ Modify Test -cat >$tmp <<EOF +cat >$TMPFILE <<EOF dn: cn=people,$TESTSUFFIX objectClass: top objectClass: person @@ -60,7 +52,7 @@ sn: people EOF -ldapadd -x -w $ROOTPW -D $ROOTDN -h $HOST -f $tmp +ldapadd -x -w $ROOTPW -D $ROOTDN -h $HOST -f $TMPFILE # modify data cat >$TMPFILE <<EOF =================================================================== RCS file: ultrapossum/module/test/test.d/05replication,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ultrapossum/module/test/test.d/05replication 2004/10/07 02:45:19 1.3 +++ ultrapossum/module/test/test.d/05replication 2004/10/07 05:59:52 1.4 @@ -30,16 +30,9 @@ set -x fi -# For tempfile -. $SHAREDIR/init.d/10compat - -tmp=`tempfile` -tmp2=`tempfile` -trap "/bin/rm -f $tmp $tmp2" 0 - ########### Add Test -cat >$tmp <<EOF +cat >$TMPFILE <<EOF dn: ou=add,$TESTSUFFIX objectClass: top objectClass: organizationalUnit @@ -47,9 +40,8 @@ EOF -ldapadd -x -w $ROOTPW -D $ROOTDN -h $HOST -f $tmp -ldapsearch -x -w $ROOTPW -LLL -D $ROOTDN -h $HOST -b $TESTSUFFIX ou=add > $tmp2 -diff -c $tmp $tmp2 +ldapadd -x -w $ROOTPW -D $ROOTDN -h $HOST -f $TMPFILE +ldapsearch -x -w $ROOTPW -LLL -D $ROOTDN -h $HOST -b $TESTSUFFIX ou=add | diff -c $TMPFILE - sleep 1 for host in $SLAVES @@ -57,8 +49,7 @@ ( for i in 1 2 3 4 5 6 7 8 9 10 do echo "Checking for $host..." - ldapsearch -x -w $ROOTPW -LLL -D $ROOTDN -h $host -b $TESTSUFFIX ou=add > $tmp2 - diff -c $tmp $tmp2 && exit 0 + ldapsearch -x -w $ROOTPW -LLL -D $ROOTDN -h $host -b $TESTSUFFIX ou=add | diff -c $TMPFILE - && exit 0 sleep $i done exit 1 @@ -67,7 +58,7 @@ ############ Modify Test -cat >$tmp <<EOF +cat >$TMPFILE <<EOF dn: cn=people,$TESTSUFFIX objectClass: top objectClass: person @@ -76,7 +67,7 @@ sn: people EOF -ldapadd -x -w $ROOTPW -D $ROOTDN -h $HOST -f $tmp +ldapadd -x -w $ROOTPW -D $ROOTDN -h $HOST -f $TMPFILE # modify data cat >$TMPFILE <<EOF @@ -87,7 +78,7 @@ EOF ldapmodify -x -w $ROOTPW -D $ROOTDN -h $HOST -f $TMPFILE -ldapsearch -x -L -b $TESTSUFFIX -h $HOST -D "cn=people,$TESTSUFFIX" -w new cn=people userPassword > $tmp +ldapsearch -x -L -b $TESTSUFFIX -h $HOST -D "cn=people,$TESTSUFFIX" -w new cn=people userPassword > $TMPFILE sleep 1 for host in $SLAVES @@ -95,8 +86,7 @@ ( for i in 1 2 3 4 5 6 7 8 9 10 do echo "Checking for $host..." - ldapsearch -x -L -b $TESTSUFFIX -h $host -D "cn=people,$TESTSUFFIX" -w new cn=people userPassword > $tmp2 - diff -c $tmp $tmp2 && exit 0 + ldapsearch -x -L -b $TESTSUFFIX -h $host -D "cn=people,$TESTSUFFIX" -w new cn=people userPassword | diff -c $TMPFILE - && exit 0 sleep $i done exit 1