[Fedora-directory-commits] dsgw/tests setup.sh,1.3,1.4

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Tue Feb 19 15:20:24 UTC 2008


Author: rmeggins

Update of /cvs/dirsec/dsgw/tests
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23811/dsgw/tests

Modified Files:
	setup.sh 
Log Message:
1) The old code used a CGI variable called completion_javascript - this variable contained arbitrary javascript code that was eval'd on in the client browser.  I have removed this code and put it in the resource file.  The dsgw code will set completion_javascript to one of the 3 keywords, and the new function emit_completion_javascript will look up the code in the resource file and output it with any required arguments.  It just seems like a really bad idea to execute arbitrary blobs of javascript passed in a CGI argument.

2) Make the checking for the template file names stricter.

3) Added many new tests.

4) When removing unused or duplicate LDAP Mods, if we remove the last one, just free the entire array.



Index: setup.sh
===================================================================
RCS file: /cvs/dirsec/dsgw/tests/setup.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- setup.sh	9 Feb 2008 18:24:23 -0000	1.3
+++ setup.sh	19 Feb 2008 15:20:22 -0000	1.4
@@ -1,14 +1,14 @@
 #!/bin/sh
 
 testdir="$1"
-sroot=/home/$USER/11srv
+sroot=/NotBackedUp/$USER/11srv
 port=1100
 secport=1101
 rootdn="cn=directory manager"
-rootpw=password
+rootpw=secret12
 adminpw=admin
 #needinstance=1
-#needdata=1
+needdata=1
 #usessl=1
 PATH=/usr/lib64/mozldap:/usr/lib/mozldap:$PATH
 export PATH
@@ -32,7 +32,7 @@
 fi
 
 if [ "$needdata" ] ; then
-$sroot/lib/dirsrv/slapd-localhost/ldif2db.pl -D "$rootdn" -w "$rootpw" -n userRoot -i $testdir/nsroot.ldif
+$sroot/lib/dirsrv/slapd-localhost/ldif2db.pl -D "$rootdn" -w "$rootpw" -n userRoot -i $sroot/share/dirsrv/data/Example.ldif
 sleep 10
 fi
 
@@ -40,7 +40,7 @@
 mkdir testtmp
 
 if [ "$usessl" ] ; then
-    ldapurl="ldaps://$hostname:$secport/$suffix"
+    ldapurl="ldaps://$hostname:$secport"
     # grab CA cert
     certutil -L -d $sroot/etc/dirsrv/$inst -n "CA certificate" -a > testtmp/cacert.asc
     # pin file
@@ -51,7 +51,7 @@
     certutil -A -d testtmp -n "CA certificate" -t "CT,," -a -i testtmp/cacert.asc
     port=$secport
 else
-    ldapurl="ldap://localhost:$port/$suffix"
+    ldapurl="ldap://localhost:$port"
     hostname=localhost
 fi
 
@@ -88,21 +88,21 @@
 
 pwpfile=/tmp/pwp.$$
 cat > $pwpfile <<EOF
-User: admin
-Password: $adminpw
+User: directory manager
+Password: $rootpw
 
-UserDN: uid=admin, ou=Administrators, ou=TopologyManagement, o=NetscapeRoot
-SIEPWD: $adminpw
+UserDN: cn=directory manager
+SIEPWD: $rootpw
 EOF
 
 #VGPREFIX="valgrind --tool=memcheck --leak-check=yes --suppressions=$HOME/valgrind.supp --num-callers=40 --suppressions=$testdir/valgrind.supp "
 # These are CGI programs - they assume they will run for a very short period of time - they use exit() instead of free() :P
 VGPREFIX="valgrind --tool=memcheck --leak-check=no --suppressions=$HOME/valgrind.supp --num-callers=40 --suppressions=$testdir/valgrind.supp "
-GDB="gdb -x .gdbinit "
+#GDB="gdb -x .gdbinit "
 DEBUGCMD=VALGRIND
 #DEBUGCMD="$GDB"
 
-PROGS="domodify"
+PROGS="dnedit"
 
 # use scripts for orgchart perl scripts
 SCRIPTS=""
@@ -186,15 +186,15 @@
     prog="$1" # test must be in dir of same name
     shift
     getlist=/tmp/gettests.$$
-    find $testdir/$prog -name testget.\* -print 2> /dev/null | sort -n > $getlist
+    find $testdir/$prog -name skip -prune -o -name testget.\* -print 2> /dev/null | sort -n > $getlist
     for test in `cat $getlist` ; do
 	runATest "$prog" GET "$test"
 	ctxnum=1
 	for ctx in "" "/" "." "../../../" "somebogusvalue" "pb" "dsgw" ; do
 	    if [ -s "$test" ] ; then
-		runATest "$prog" GET "$test" .$ctxnum "&context=$ctx"
+		runATest "$prog" GET "$test" .$ctxnum "&context=$ctx&binddn=$rootdn&passwd=$rootpw"
 	    else
-		runATest "$prog" GET "$test" .$ctxnum "context=$ctx"
+		runATest "$prog" GET "$test" .$ctxnum "context=$ctx&binddn=$rootdn&passwd=$rootpw"
 	    fi
 	    ctxnum=`expr $ctxnum + 1`
 	done
@@ -206,12 +206,12 @@
     prog="$1" # test must be in dir of same name
     shift
     postlist=/tmp/posttests.$$
-    find $testdir/$prog -name testpost.\* -print 2> /dev/null | sort -n > $postlist
+    find $testdir/$prog -name skip -prune -o -name testpost.\* -print 2> /dev/null | sort -n > $postlist
     for test in `cat $postlist` ; do
 	runATest "$prog" POST "$test"
 	ctxnum=1
 	for ctx in "" "/" "." "../../../" "somebogusvalue" "pb" "dsgw" ; do
-	    runATest "$prog" POST "$test" .$ctxnum "&context=$ctx"
+	    runATest "$prog" POST "$test" .$ctxnum "&context=$ctx&binddn=$rootdn&passwd=$rootpw"
 	    ctxnum=`expr $ctxnum + 1`
 	done
     done




More information about the Fedora-directory-commits mailing list