From 0f5af04003a2ee2dff639079bfa8ef2f01d1837d Mon Sep 17 00:00:00 2001 From: clayton Date: Fri, 31 Jul 1998 21:16:32 +0000 Subject: [PATCH] Fixed the 'use' line in the examples. Removed a few lines from api.pl and added a configuration option to set the number of adds. --- directory/perldap/test_api/api.pl | 19 +++++++++---------- directory/perldap/test_api/search.pl | 4 ++-- directory/perldap/test_api/write.pl | 4 ++-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/directory/perldap/test_api/api.pl b/directory/perldap/test_api/api.pl index 4384cac73f4..3f3dcdc6b10 100755 --- a/directory/perldap/test_api/api.pl +++ b/directory/perldap/test_api/api.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w ############################################################################# -# $Id: api.pl,v 1.2 1998-07-24 19:01:49 clayton Exp $ +# $Id: api.pl,v 1.3 1998-07-31 21:16:30 clayton Exp $ # # The contents of this file are subject to the Mozilla Public License # Version 1.0 (the "License"); you may not use this file except in @@ -29,7 +29,7 @@ # ############################################################################# -use Mozilla::LDAP::API (:api :constant); +use Mozilla::LDAP::API qw(:api :constant); use strict; my $BASE = "ou=Test,o=Motorola,c=US"; @@ -38,7 +38,8 @@ my $PASS = "abcd1234"; my $HOST = "localhost"; my $PORT = 389; -system("/usr/ucb/ps -auxw | grep $$ | grep -v grep"); +$howmany = 50; + # Initialize the Connection { my $ld = ldap_init($HOST,$PORT); @@ -109,7 +110,7 @@ if (ldap_add_s($ld,$BASE,$entry) != LDAP_SUCCESS) # Add People -foreach my $number (1..50) +foreach my $number (1..$howmany) { $entry = { "objectclass" => ["top","person"], @@ -126,7 +127,7 @@ foreach my $number (1..50) } # Modify People -foreach my $number (1..5) +foreach my $number (1..$howmany) { $entry = { "sn" => {"a",["Test"]}, @@ -155,7 +156,7 @@ if (ldap_search_s($ld,$BASE,LDAP_SCOPE_SUBTREE,$filter,$attrs,0,$res) } # Count Results -if (ldap_count_entries($ld,$res) != 5) +if (ldap_count_entries($ld,$res) != $howmany) { print "count_res - Failed!\n"; } else { @@ -238,7 +239,7 @@ ldap_ber_free($ber,0); ldap_msgfree($res); # Compare Attribute Values -foreach my $number (1..10) +foreach my $number (1..$howmany) { if(ldap_compare_s($ld,"cn=Mozilla $number,$BASE","sn",$number) != LDAP_COMPARE_TRUE) @@ -250,7 +251,7 @@ foreach my $number (1..10) } # Delete Users -foreach my $number (1..50) +foreach my $number (1..$howmany) { if (ldap_delete_s($ld,"cn=Mozilla $number,$BASE") != LDAP_SUCCESS) { @@ -270,5 +271,3 @@ if (ldap_delete_s($ld,"$BASE") != LDAP_SUCCESS) # Unbind ldap_unbind($ld); } - -system("/usr/ucb/ps -auxw | grep $$ | grep -v grep"); diff --git a/directory/perldap/test_api/search.pl b/directory/perldap/test_api/search.pl index 5c36c718201..1581c204905 100755 --- a/directory/perldap/test_api/search.pl +++ b/directory/perldap/test_api/search.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl ############################################################################# -# $Id: search.pl,v 1.2 1998-07-24 19:01:50 clayton Exp $ +# $Id: search.pl,v 1.3 1998-07-31 21:16:31 clayton Exp $ # # The contents of this file are subject to the Mozilla Public License # Version 1.0 (the "License"); you may not use this file except in @@ -25,7 +25,7 @@ # ############################################################################# -use Mozilla::LDAP::API (:api :constant); +use Mozilla::LDAP::API qw(:api :constant); use strict; diff --git a/directory/perldap/test_api/write.pl b/directory/perldap/test_api/write.pl index bd6a4cae935..348cfd8a64a 100755 --- a/directory/perldap/test_api/write.pl +++ b/directory/perldap/test_api/write.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w ############################################################################# -# $Id: write.pl,v 1.2 1998-07-24 19:01:51 clayton Exp $ +# $Id: write.pl,v 1.3 1998-07-31 21:16:32 clayton Exp $ # # The contents of this file are subject to the Mozilla Public License # Version 1.0 (the "License"); you may not use this file except in @@ -30,7 +30,7 @@ ############################################################################# use strict; -use Mozilla::LDAP::API (:constant :api); +use Mozilla::LDAP::API qw(:constant :api); # This is the entry we will be adding. Do not use a pre-existing entry.