test030-relay 1.93 KB
Newer Older
1
2
3
4
#! /bin/sh
# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
Quanah Gibson-Mount's avatar
Quanah Gibson-Mount committed
5
## Copyright 1998-2020 The OpenLDAP Foundation.
6
7
8
9
10
11
12
13
14
15
16
17
18
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
## Public License.
##
## A copy of this license is available in the file LICENSE in the
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.

echo "running defines.sh"
. $SRCDIR/scripts/defines.sh

19
if test $RWM = rwmno ; then 
20
	echo "rwm (Rewrite/remap) overlay not available, test skipped"
21
22
23
24
25
	exit 0
fi 

echo ""

26
27
28
29
30
31
if test "x$RELAYS" = "x" ; then
	RELAYS=
	# back-relay
	if test $BACKRELAY = relayno ; then 
		echo "relay backend not available, test skipped"
	else
32
33
34
35
		if test "x$RELAYS" != "x" ; then
			RELAYS="${RELAYS} "
		fi
		RELAYS="${RELAYS}relay"
36
	fi
37

38
39
40
41
	# back-ldap
	if test $BACKLDAP = ldapno ; then 
		echo "ldap backend not available, test skipped"
	else
42
43
44
45
		if test "x$RELAYS" != "x" ; then
			RELAYS="${RELAYS} "
		fi
		RELAYS="${RELAYS}ldap"
46
47
48
49
50
51
	fi

	# back-meta
	if test $BACKMETA = metano ; then 
		echo "meta backend not available, test skipped"
	else
52
53
		if test "x$RELAYS" != "x" ; then
			RELAYS="${RELAYS} "
54
		fi
55
		RELAYS="${RELAYS}meta"
56
	fi 
57
58
fi

59
60
61
62
63
64
if test "x$RELAYS" = "x" ; then
	echo "no relaying capable backend is available"
	echo ">>>>> Test succeeded"
	exit 0
fi

65
echo "Testing virtual naming context mapping with $RELAYS backend(s)..."
66
echo ""
67

Pierangelo Masarati's avatar
Pierangelo Masarati committed
68
69
70
71
tmpfile=savelog.log
if test -f $tmpfile ; then
	rm -f $tmpfile
fi
72
73
first=1
for RELAY in $RELAYS ; do
74
75
76
77
78
79
80
81
82
	if test $first = 1 ; then
		first=0
	else
		echo ">>>>> waiting for things to exit"
		test $KILLSERVERS != no && wait
		echo ""

		mv -f $LOG1 $tmpfile
		rm -rf $TESTDIR
83
84
	fi

85
	mkdir -p $TESTDIR $DBDIR1
Pierangelo Masarati's avatar
Pierangelo Masarati committed
86

87
88
	if test -f $tmpfile ; then
		mv $tmpfile $LOG1
89
	fi
90
91

	. $SRCDIR/scripts/relay
92
93
94
done

echo ">>>>> Test succeeded"
95

96
97
98
test $KILLSERVERS != no && wait

exit 0