diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2008-04-25 17:38:10 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2008-04-25 17:38:10 +0200 |
commit | 2a743814acac368dd09ea0e222e5dcd16b72af57 (patch) | |
tree | 869e182fe2eeb4143fe5100853baae2aa2ee4880 /tests | |
parent | b9dbe019a442b0d202722faad5570ebc38bb0dd0 (diff) |
have the binary look up the file name and only use the shell script wrapper to determine if LDAP server is available
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@697 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_myldap.c | 12 | ||||
-rwxr-xr-x | tests/test_myldap.sh | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/tests/test_myldap.c b/tests/test_myldap.c index c127b58..1e9f5da 100644 --- a/tests/test_myldap.c +++ b/tests/test_myldap.c @@ -391,8 +391,16 @@ static void test_connections(void) /* the main program... */ int main(int argc,char *argv[]) { - assert(argc==2); - cfg_init(argv[1]); + char *srcdir; + char fname[100]; + /* build the name of the file */ + srcdir=getenv("srcdir"); + if (srcdir==NULL) + srcdir="."; + snprintf(fname,sizeof(fname),"%s/nss-ldapd-test.conf",srcdir); + fname[sizeof(fname)-1]='\0'; + /* initialize configuration */ + cfg_init(fname); /* partially initialize logging */ log_setdefaultloglevel(LOG_DEBUG); test_search(); diff --git a/tests/test_myldap.sh b/tests/test_myldap.sh index 5f1844f..b7f89db 100755 --- a/tests/test_myldap.sh +++ b/tests/test_myldap.sh @@ -39,4 +39,4 @@ ldapsearch -b "$base" -s base -x -H "$uri" > /dev/null 2>&1 || { echo "test_myldap.sh: using LDAP server $uri" # just execute test_myldap -exec ./test_myldap "$cfgfile" +exec ./test_myldap |