|
Packit |
6bd9ab |
#!/bin/sh
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
# test_myldap.sh - simple wrapper test script for test_myldap
|
|
Packit |
6bd9ab |
#
|
|
Packit |
6bd9ab |
# Copyright (C) 2007-2014 Arthur de Jong
|
|
Packit |
6bd9ab |
#
|
|
Packit |
6bd9ab |
# This library is free software; you can redistribute it and/or
|
|
Packit |
6bd9ab |
# modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6bd9ab |
# License as published by the Free Software Foundation; either
|
|
Packit |
6bd9ab |
# version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6bd9ab |
#
|
|
Packit |
6bd9ab |
# This library is distributed in the hope that it will be useful,
|
|
Packit |
6bd9ab |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6bd9ab |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6bd9ab |
# Lesser General Public License for more details.
|
|
Packit |
6bd9ab |
#
|
|
Packit |
6bd9ab |
# You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6bd9ab |
# License along with this library; if not, write to the Free Software
|
|
Packit |
6bd9ab |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
Packit |
6bd9ab |
# 02110-1301 USA
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
# This script expects to be run in an environment where an LDAP server
|
|
Packit |
6bd9ab |
# is available at the location specified in nslcd-test.conf in
|
|
Packit |
6bd9ab |
# this directory.
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
set -e
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
# get LDAP config
|
|
Packit |
6bd9ab |
srcdir="${srcdir-`dirname "$0"`}"
|
|
Packit |
6bd9ab |
builddir="${builddir-`dirname "$0"`}"
|
|
Packit |
6bd9ab |
cfgfile="$srcdir/nslcd-test.conf"
|
|
Packit |
6bd9ab |
uri=`sed -n 's/^uri *//p' "$cfgfile" | head -n 1`
|
|
Packit |
6bd9ab |
base="dc=test,dc=tld"
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
# try to fetch the base DN (fail with exit 77 to indicate problem)
|
|
Packit |
6bd9ab |
"$srcdir/testenv.sh" check_ldap "$uri" "$base" || exit 77
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
# fix configuration file permissions for test to pass
|
|
Packit |
6bd9ab |
chmod o-rwx "$cfgfile"
|
|
Packit |
6bd9ab |
|
|
Packit |
6bd9ab |
# just execute test_myldap
|
|
Packit |
6bd9ab |
export srcdir
|
|
Packit |
6bd9ab |
exec "$builddir/test_myldap"
|