summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2012-10-25 16:51:49 -0400
committerNalin Dahyabhai <nalin@redhat.com>2012-10-25 17:38:59 -0400
commit8c2ec5b5cad770c4e13dbfebf888a4ef08c0c4d2 (patch)
tree6ff501773e4ff82013f1fbdf40ab78ca5f836249
parent3d6a8bb1b9e0f6c7a3e168979b4e280ab89774c0 (diff)
downloadslapi-nis-8c2ec5b5cad770c4e13dbfebf888a4ef08c0c4d2.tar.gz
slapi-nis-8c2ec5b5cad770c4e13dbfebf888a4ef08c0c4d2.tar.xz
slapi-nis-8c2ec5b5cad770c4e13dbfebf888a4ef08c0c4d2.zip
compare LDIF without case sensitivity
Case sensitive comparisons keep getting tripped up by DN canonicalization and the like.
-rwxr-xr-xtests/run-tests.sh21
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/run-tests.sh b/tests/run-tests.sh
index a508755..3ab4fe1 100755
--- a/tests/run-tests.sh
+++ b/tests/run-tests.sh
@@ -1,5 +1,16 @@
#!/bin/sh
source ${builddir:-.}/slapd.sh
+probably=
+compare()
+{
+ probably=
+ if ! cmp -s "$@" ; then
+ if diff -u -i "$@" > /dev/null 2> /dev/null ; then
+ probably="(probably)"
+ fi
+ fi
+ diff -u -i "$@" > /dev/null 2> /dev/null
+}
showdiff()
{
base1=`basename "$1"`
@@ -37,7 +48,7 @@ for subdir in "$@" ; do
sleep 5
$TESTDIR/$subdir/before.sh > before.out 2>&1
if test -r $TESTDIR/$subdir/before.txt ; then
- if ! cmp -s $TESTDIR/$subdir/before.txt before.out ; then
+ if ! compare $TESTDIR/$subdir/before.txt before.out ; then
echo `basename "$subdir"`:
showdiff $TESTDIR/$subdir/before.txt before.out
stopslapd
@@ -48,7 +59,7 @@ for subdir in "$@" ; do
if test -x $TESTDIR/$subdir/change.sh ; then
$TESTDIR/$subdir/change.sh > change.out 2>&1
if test -r $TESTDIR/$subdir/change.txt ; then
- if ! cmp -s $TESTDIR/$subdir/change.txt change.out ; then
+ if ! compare $TESTDIR/$subdir/change.txt change.out ; then
echo `basename "$subdir"`:
showdiff $TESTDIR/$subdir/change.txt change.out
stopslapd
@@ -60,7 +71,7 @@ for subdir in "$@" ; do
sleep 5
$TESTDIR/$subdir/after.sh > after.out 2>&1
if test -r $TESTDIR/$subdir/after.txt ; then
- if ! cmp -s $TESTDIR/$subdir/after.txt after.out ; then
+ if ! compare $TESTDIR/$subdir/after.txt after.out ; then
echo `basename "$subdir"`:
showdiff $TESTDIR/$subdir/after.txt after.out
stopslapd
@@ -83,9 +94,9 @@ for subdir in "$@" ; do
stopslapd
popd > /dev/null
if test -s $TESTDIR/$subdir/description.txt ; then
- echo `basename $subdir`" ("`head -n 1 $TESTDIR/$subdir/description.txt`")": OK
+ echo `basename $subdir`" ("`head -n 1 $TESTDIR/$subdir/description.txt`")": $probably OK
else
- echo `basename $subdir`: OK
+ echo `basename $subdir`: $probably OK
fi
done
exit 0