You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2016/09/09 16:19:36 UTC

svn commit: r1760063 - in /tcl/rivet/trunk: ./ rivet/rivet-tcl/ tests/ tests/apachetest/

Author: mxmanghi
Date: Fri Sep  9 16:19:36 2016
New Revision: 1760063

URL: http://svn.apache.org/viewvc?rev=1760063&view=rev
Log:
    * tests/runtests.tcl: support for Apache 1.3 dropped. Add modules needed by
    Apache 2.4
    * tests/apachetests/apachetests.tcl: Dropped support for Apache 1.3
    * tests/shorthand.test: shorthand notation test versioning added
    * tests/virtualhost.test: removed NameVirtualHost directive no longer supported
    * tests/bailout.test: add tests for ::rivet::catch and ::rivet::try
    * tests/catch.rvt,try.rvt: script testing handling various conditions
    * rivet/rivet-tcl/url_query.tcl: add new command ::rivet::url_query


Added:
    tcl/rivet/trunk/rivet/rivet-tcl/url_query.tcl
    tcl/rivet/trunk/tests/catch.rvt
    tcl/rivet/trunk/tests/try.rvt
Modified:
    tcl/rivet/trunk/ChangeLog
    tcl/rivet/trunk/rivet/rivet-tcl/tclIndex
    tcl/rivet/trunk/tests/apachetest/apachetest.tcl
    tcl/rivet/trunk/tests/apachetest/template.conf.2.tcl
    tcl/rivet/trunk/tests/bailout.test
    tcl/rivet/trunk/tests/runtests.tcl
    tcl/rivet/trunk/tests/shorthand.test
    tcl/rivet/trunk/tests/virtualhost.test

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1760063&r1=1760062&r2=1760063&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Fri Sep  9 16:19:36 2016
@@ -1,3 +1,13 @@
+2016-09-08 Massimo Manghi <mx...@apache.org>
+    * tests/runtests.tcl: support for Apache 1.3 dropped. Add modules needed by
+    Apache 2.4
+    * tests/apachetests/apachetests.tcl: Dropped support for Apache 1.3
+    * tests/shorthand.test: shorthand notation test versioning added
+    * tests/virtualhost.test: removed NameVirtualHost directive no longer supported
+    * tests/bailout.test: add tests for ::rivet::catch and ::rivet::try
+    * tests/catch.rvt,try.rvt: script testing handling various conditions
+    * rivet/rivet-tcl/url_query.tcl: add new command ::rivet::url_query
+    
 2016-09-07 Massimo Manghi <mx...@apache.org>
     * rivet/rivet-tcl/catch.tcl: fixed argument management in ::catch call
 

Modified: tcl/rivet/trunk/rivet/rivet-tcl/tclIndex
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/tclIndex?rev=1760063&r1=1760062&r2=1760063&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/tclIndex (original)
+++ tcl/rivet/trunk/rivet/rivet-tcl/tclIndex Fri Sep  9 16:19:36 2016
@@ -30,3 +30,4 @@ set auto_index(::rivet::xml) [list sourc
 set auto_index(::rivet::redirect) [list source [file join $dir redirect.tcl]]
 set auto_index(::rivet::catch) [list source [file join $dir catch.tcl]]
 set auto_index(::rivet::try) [list source [file join $dir try.tcl]]
+set auto_index(::rivet::url_query) [list source [file join $dir url_query.tcl]]

Added: tcl/rivet/trunk/rivet/rivet-tcl/url_query.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/rivet-tcl/url_query.tcl?rev=1760063&view=auto
==============================================================================
--- tcl/rivet/trunk/rivet/rivet-tcl/url_query.tcl (added)
+++ tcl/rivet/trunk/rivet/rivet-tcl/url_query.tcl Fri Sep  9 16:19:36 2016
@@ -0,0 +1,24 @@
+# -- url_query
+#
+# Build a URL query starting from a list of parameter-value
+# pairs. If the list size is odd the last element in the list
+# is discarded. Values in the list are escaped using 
+# ::rivet::escape_string
+
+
+namespace eval ::rivet {
+
+    proc url_query {args} {
+
+        set args_list $args
+
+        set urlarg ""
+        while {[llength $args_list] > 1} {
+            set args_list [lassign $args_list par val]
+            lappend urlarg "$par=[::rivet::escape_string $val]"
+        }
+        return [join $urlarg "&"]
+
+    }
+
+}

Modified: tcl/rivet/trunk/tests/apachetest/apachetest.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tests/apachetest/apachetest.tcl?rev=1760063&r1=1760062&r2=1760063&view=diff
==============================================================================
--- tcl/rivet/trunk/tests/apachetest/apachetest.tcl (original)
+++ tcl/rivet/trunk/tests/apachetest/apachetest.tcl Fri Sep  9 16:19:36 2016
@@ -41,7 +41,7 @@ namespace eval apachetest {
 	variable httpd_version  $::httpd_version
     # this file should be in the same directory this script is.
     variable templatefile [file join [file dirname [info script]] \
-			       template.conf.$httpd_version\.tcl]
+			       template.conf.2.tcl]
 }
 
 # apachetest::need_modules --
@@ -121,13 +121,13 @@ proc apachetest::start { options conftex
     #OpenBSD related workaround, their stock apache tries to chroot by default
     #have to  add -u to the arguments to prevent this
     catch {exec uname} uname_str
-    if {[string equal $uname_str OpenBSD] && $httpd_version == 1 } {
+    if {[string equal $uname_str OpenBSD]} {
         set server_args "-u -X -f"
     } else {
-        set server_args "-X -f"
+        set server_args [list -X -f]
     }
     # There has got to be a better way to do this, aside from waiting.
-    set serverpid [eval exec  $binname $server_args \
+    set serverpid [eval exec $binname $server_args \
 	       [file join [pwd] server.conf] $options >& apachelog.txt &] 
     apachetest::connect
     if { $debug > 0 } {
@@ -138,15 +138,13 @@ proc apachetest::start { options conftex
 
     # Kill and wait are the only reasons we need TclX.
     # apache2 binary started with -X reacts to SIGQUIT and ignores TERM
-    #kill QUIT $serverpid 
-
-    eval exec $binname -k stop -f [file join [pwd] server.conf]
-    #catch {
-    #    set waitres [wait $serverpid]
-    #    if { $debug > 0 } {
-    #        puts $waitres
-    ##    }
-    #} 
+    kill QUIT $serverpid 
+    catch {
+        set waitres [wait $serverpid]
+        if { $debug > 0 } {
+            puts $waitres
+        }
+    } 
 }
 
 # startserver - start the server with 'options'.
@@ -210,7 +208,7 @@ proc apachetest::getcompiledin { binname
 # find the httpd.conf file
 
 proc apachetest::gethttpdconf { binname } {
-    set bin [open [list | "$binname" -V] r]
+    set bin [open [list | $binname -V] r]
     set options [read $bin]
     close $bin
     regexp {SERVER_CONFIG_FILE="(.*?)"} "$options" match filename

Modified: tcl/rivet/trunk/tests/apachetest/template.conf.2.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tests/apachetest/template.conf.2.tcl?rev=1760063&r1=1760062&r2=1760063&view=diff
==============================================================================
--- tcl/rivet/trunk/tests/apachetest/template.conf.2.tcl (original)
+++ tcl/rivet/trunk/tests/apachetest/template.conf.2.tcl Fri Sep  9 16:19:36 2016
@@ -24,10 +24,11 @@ ServerName localhost
 DocumentRoot "$CWD"
 
 <Directory "$CWD">
-Options All MultiViews
-AllowOverride All
-Order allow,deny
-Allow from all
+    Options All MultiViews
+    AllowOverride All
+    #Order allow,deny
+    #Allow from all
+    Require all granted
 </Directory>
 
 <IfModule mod_dir.c>

Modified: tcl/rivet/trunk/tests/bailout.test
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tests/bailout.test?rev=1760063&r1=1760062&r2=1760063&view=diff
==============================================================================
--- tcl/rivet/trunk/tests/bailout.test (original)
+++ tcl/rivet/trunk/tests/bailout.test Fri Sep  9 16:19:36 2016
@@ -1,17 +1,16 @@
-# redirect.test -- test redirect command.
+# bailout.test -- test redirect command.
 #
 # redirect must trigger an AbortScript and have
 # predictable data stored in the abort code
 
-# $Id: $
+# $Id: bailout.test 1760054 2016-09-09 16:02:29Z mxmanghi $
 
-::tcltest::test bailout-1.1 {redirect command} {
+::tcltest::test bailout-1.1 {::rivet::redirect command} {
     apachetest::start {} {
         RivetServerConf AbortScript "::rivet::apache_log_error err \\\"catching redirect\\\""
         RivetServerConf AbortScript "set tmpfp \[open redirect_code.txt w+\]"
         RivetServerConf AbortScript "puts \$tmpfp \[::rivet::abort_code\]"
         RivetServerConf AbortScript "close \$tmpfp"
-        RivetServerConf AbortScript "touch /tmp/aaaaaa"
     } {
         set url "${urlbase}redirect.rvt?base=$urlbase"
         #puts $url
@@ -25,7 +24,8 @@
     list $r1 $r2
 } {1 1}
 
-::tcltest::test bailout-1.2 {exit command} {
+
+::tcltest::test bailout-1.2 {::rivet::exit command} {
     apachetest::start {} {
         RivetServerConf AbortScript "::rivet::apache_log_error err \\\"catching exit\\\""
         RivetServerConf AbortScript "set abcode \[::rivet::abort_code\]"
@@ -41,5 +41,131 @@
     set r
 } {1 exit 100} 
 
+::tcltest::test bailout-2.0 {::rivet::catch procedure successful execution} {
+    apachetest::start {} {
+    } {
+        set url "${urlbase}catch.rvt"
+        set page [::http::geturl $url]
+        set r [::http::data $page]
+        ::http::cleanup $page
+    }
+    set r [string trim $r]
+    set r
+} {OK}
+
+::tcltest::test bailout-2.1 {::rivet::catch command generic error handling} {
+    apachetest::start {} {
+    } {
+        set url "${urlbase}catch.rvt?abort=1"
+        set page [::http::geturl $url]
+        set r [::http::data $page]
+        ::http::cleanup $page
+    }
+    set r [string trim $r]
+    set r
+} {OK}
+
+::tcltest::test bailout-2.2 {::rivet::catch command abort_page handling} {
+    apachetest::start {} {
+        RivetServerConf AbortScript "::rivet::apache_log_error err \\\"catching abort condition\\\""
+        RivetServerConf AbortScript "puts -nonewline \[::rivet::abort_page -aborting\]"
+    } {
+        puts "test ::rivet::catch and ::rivet::abort_page interaction"
+        set url "${urlbase}catch.rvt?abort=2"
+        set page [::http::geturl $url]
+        set r [::http::data $page]
+        ::http::cleanup $page
+    }
+    set r
+} {1}
+
+::tcltest::test bailout-2.3 {::rivet::catch handling options dictionary} {
+    apachetest::start {} {
+    } {
+        set url "${urlbase}catch.rvt?abort=3"
+        set page [::http::geturl $url]
+        set r [::http::data $page]
+        ::http::cleanup $page
+    }
+    set r [string trim $r]
+    set r
+} {3 error}
+
+::tcltest::test bailout-3.0 {::rivet::try successful procedure call} {
+    apachetest::start {} {
+    } {
+        set url "${urlbase}try.rvt"
+        set page [::http::geturl $url]
+        set r [::http::data $page]
+        ::http::cleanup $page
+    }
+    set r [string trim $r]
+    set r
+} {finalize}
+
+::tcltest::test bailout-3.1 {::rivet::try handling break return code} {
+    apachetest::start {} {
+    } {
+        set url "${urlbase}try.rvt?cond=3"
+        set page [::http::geturl $url]
+        set r [::http::data $page]
+        ::http::cleanup $page
+    }
+    set r [string trim $r]
+    set r
+} {try 3 finalize}
+
+::tcltest::test bailout-3.2 {::rivet::try handling error return code} {
+    apachetest::start {} {
+    } {
+        set url "${urlbase}try.rvt?cond=1"
+        set page [::http::geturl $url]
+        set r [::http::data $page]
+        ::http::cleanup $page
+    }
+    set r [string trim $r]
+    set r
+} {try 1 finalize}
+
+::tcltest::test bailout-3.3 {::rivet::try handling continue return code} {
+    apachetest::start {} {
+    } {
+        set url "${urlbase}try.rvt?cond=4"
+        set page [::http::geturl $url]
+        set r [::http::data $page]
+        ::http::cleanup $page
+    }
+    set r [string trim $r]
+    set r
+} {try 4 finalize}
 
+::tcltest::test bailout-3.4 {::rivet::try abort_page handling} {
+    apachetest::start {} {
+        RivetServerConf AbortScript "::rivet::apache_log_error err \\\"catching abort condition\\\""
+        RivetServerConf AbortScript "puts -nonewline \\\" \[::rivet::abort_page -aborting\]\\\""
+        RivetServerConf AbortScript "puts -nonewline \\\" \[::rivet::abort_code\]\\\""
+    } {
+        set url "${urlbase}try.rvt?cond=abort"
+        set page [::http::geturl $url]
+        set r [::http::data $page]
+        ::http::cleanup $page
+    }
+    set r [string trim $r]
+    set r
+} {finalize 1 arg1}
 
+::tcltest::test bailout-3.4 {::rivet::try handling ::rivet::exit} {
+    apachetest::start {} {
+        RivetServerConf AbortScript "::rivet::apache_log_error err \\\"catching abort condition\\\""
+        RivetServerConf AbortScript "set abcode \[::rivet::abort_code\]"
+        RivetServerConf AbortScript "puts -nonewline \\\" \[::rivet::abort_page -exiting\]\\\""
+        RivetServerConf AbortScript "puts -nonewline \\\" \[dict get \$abcode error_code\] \[dict get \$abcode return_code\]\\\""
+    } {
+        set url "${urlbase}try.rvt?cond=exit"
+        set page [::http::geturl $url]
+        set r [::http::data $page]
+        ::http::cleanup $page
+    }
+    set r [string trim $r]
+    set r
+} {finalize 1 exit 101}

Added: tcl/rivet/trunk/tests/catch.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tests/catch.rvt?rev=1760063&view=auto
==============================================================================
--- tcl/rivet/trunk/tests/catch.rvt (added)
+++ tcl/rivet/trunk/tests/catch.rvt Fri Sep  9 16:19:36 2016
@@ -0,0 +1,38 @@
+<?
+    proc failproc {arg1} {
+        switch $arg1 {
+            1 {
+                fail
+            }
+            3 {
+                return -code error -options [dict create argument $arg1 code error] "errore"
+            }
+        }
+    }
+
+    switch [::rivet::var_qs get abort] {
+        1 {
+            if {[::rivet::catch {failproc 1}]} {
+                puts -nonewline "OK"
+            }
+        }
+        2 {
+            if {[::rivet::catch {::rivet::abort_page}]} {
+                ?>should never get here if AbortScript is defined<?
+            }
+        }
+        3 {
+            if {[::rivet::catch {failproc 3} er opt]} {
+                dict with opt {
+                    puts -nonewline "$argument $code"
+                }
+            }
+        }
+        default {
+            if {![::rivet::catch {set a 1}]} {
+                ?>OK<?
+            }
+        }
+    }
+
+?>

Modified: tcl/rivet/trunk/tests/runtests.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tests/runtests.tcl?rev=1760063&r1=1760062&r2=1760063&view=diff
==============================================================================
--- tcl/rivet/trunk/tests/runtests.tcl (original)
+++ tcl/rivet/trunk/tests/runtests.tcl Fri Sep  9 16:19:36 2016
@@ -18,7 +18,6 @@
 
 # $Id$
 
-
 set auto_path [linsert $auto_path 0 [file join [file dirname [info script]] apachetest]]
 
 puts stderr "runtests.tcl is running with auto_path: $auto_path"
@@ -28,23 +27,32 @@ proc runtests_usage {} {
     exit 1
 }
 
-proc get_httpd_version {httpd} {
+proc get_httpd_version {httpd {bd broken_down_version}} {
+    upvar 1 $bd broken_down_version
+
 	catch {exec $httpd -v} raw_string
-	set version  [lindex [regexp -inline {([0-9]{1,}\.[0-9]{1,}\.[0-9]{1,})} $raw_string]  1]
-	if [string match "1.3.*" $version] {
-		return 1
-	} else {
-		return 2
-	}
+
+	set version_l [regexp -inline {([0-9]{1,})\.([0-9]{1,})\.([0-9]{1,})} $raw_string]
+	if {[llength $version_l]} {
+
+        lassign $version_l m major minor patchlevel
+        set broken_down_version [list $major $minor $patchlevel]
+
+    } else {
+
+        return -code error "could not identify the Apache httpd version from '$raw_string'"
+
+    }
+    return $m
 }
 
 if { [llength $argv] < 1 } {
     runtests_usage
 } else {
-    set httpd_version [get_httpd_version  [lindex $argv 0]]
+    set httpd_version [get_httpd_version [lindex $argv 0]]
 }
 
-puts stderr "Tests will be run against apache${httpd_version}"
+puts stderr "Tests will be run against apache ${httpd_version} version"
 
 package require apachetest
 
@@ -64,52 +72,41 @@ if { [catch {
     runtests_usage
 }
 
-
-if {$httpd_version == 1} {
-	apachetest::need_modules {
-		{mod_log_config		config_log_module}
-		{mod_mime		    mime_module}
-		{mod_negotiation	negotiation_module}
-		{mod_dir		    dir_module}
-		{mod_auth		    auth_module}
-		{mod_access		    access_module}
-	}
-} else {
-	apachetest::need_modules {
-		{mod_mime           mime_module}
-		{mod_negotiation    negotiation_module}
-		{mod_dir            dir_module}
-		{mod_log_config     log_config_module}
-		{mod_authz_host     authz_host_module}
-	}
+apachetest::need_modules {
+    {mod_mime           mime_module}
+    {mod_negotiation    negotiation_module}
+    {mod_dir            dir_module}
+    {mod_log_config     log_config_module}
+    {mod_authz_core     authz_core_module}
+    {mod_authz_host     authz_host_module}
+    {mod_unixd          unixd_module}
+    {mod_mpm_prefork    mpm_prefork_module}
 }
 
 apachetest::makeconf server.conf {
-    LoadModule rivet_module [file join $CWD .. src/.libs mod_rivet[info sharedlibextension]]
-
+    LoadModule rivet_module         [file join $CWD .. src/.libs mod_rivet[info sharedlibextension]]
 # User and Group directives removed to ease dependency of test suite from the output of command 'id' (from which
 # the values for these directives were inferred (Bug #53396)
 
     <IfModule mod_mime.c>
-    TypesConfig $CWD/mime.types
-    AddLanguage en .en
-    AddLanguage it .it
-    AddLanguage es .es
-    AddType application/x-httpd-rivet .rvt
-    AddType application/x-rivet-tcl .tcl
+        TypesConfig $CWD/mime.types
+        AddLanguage en .en
+        AddLanguage it .it
+        AddLanguage es .es
+        AddType application/x-httpd-rivet .rvt
+        AddType application/x-rivet-tcl   .tcl
     </IfModule>
 
-
     <IfDefine SERVERCONFTEST>
-    RivetServerConf BeforeScript 'puts "Page Header"'
-    RivetServerConf AfterScript 'puts "Page Footer"'
+        RivetServerConf BeforeScript 'puts "Page Header"'
+        RivetServerConf AfterScript 'puts "Page Footer"'
     </IfDefine>
 
     <IfDefine DIRTEST>
-    <Directory />
-    RivetDirConf BeforeScript 'puts "Page Header"'
-    RivetDirConf AfterScript 'puts "Page Footer"'
-    </Directory>
+        <Directory />
+            RivetDirConf BeforeScript 'puts "Page Header"'
+            RivetDirConf AfterScript 'puts "Page Footer"'
+        </Directory>
     </IfDefine>
 
     # We can use this to include our own stuff for each test.
@@ -118,21 +115,23 @@ apachetest::makeconf server.conf {
     # For testing, we want core dumps.
     CoreDumpDirectory $CWD
 }
+
 # Copy the rivet init files.
 file delete -force rivet
-file copy -force [file join .. rivet] .
+file copy   -force [file join .. rivet] .
 set env(TCLLIBPATH) [file normalize [file join [file dirname [info script]] rivet]]
 
 # If 'startserver' is specified on the command line, just start up the
 # server without running tests.
 
-
+puts "running test with arguments: $argv"
 switch -exact -- [lindex $argv 1] {
     startserver {
 	    apachetest::startserver
     }
     default {
         set argv [lrange $argv 1 end]
+
         source [file join . rivet.test]
     }
 }

Modified: tcl/rivet/trunk/tests/shorthand.test
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tests/shorthand.test?rev=1760063&r1=1760062&r2=1760063&view=diff
==============================================================================
--- tcl/rivet/trunk/tests/shorthand.test (original)
+++ tcl/rivet/trunk/tests/shorthand.test Fri Sep  9 16:19:36 2016
@@ -1,6 +1,6 @@
 # $Id: $
 
-::tcltest::test shorthand {shorthand expression for simple output} {
+::tcltest::test shorthand-1.1 {shorthand expression for simple output} {
     set page  [::http::geturl "${urlbase}shorthand.rvt"]
     set match [::http::data $page]
     set match

Added: tcl/rivet/trunk/tests/try.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tests/try.rvt?rev=1760063&view=auto
==============================================================================
--- tcl/rivet/trunk/tests/try.rvt (added)
+++ tcl/rivet/trunk/tests/try.rvt Fri Sep  9 16:19:36 2016
@@ -0,0 +1,41 @@
+<?
+
+    proc failproc {arg1} {
+
+        switch $arg1 {
+            0 {
+                return -code ok
+            }
+            1 {
+                return -code error -options [dict create cmd try condition 1] "Errore"
+            }
+            3 {
+                return -code break -options [dict create cmd try condition 3] "Break"
+            }
+            4 {
+                return -code continue -options [dict create cmd try condition 4] "Continue"
+            }
+            abort {
+                ::rivet::abort_page arg1
+            }
+            exit {
+                ::rivet::exit 101
+            }
+        }
+
+    }
+
+    ::rivet::try {
+        failproc [::rivet::var_qs get cond]
+    } on continue {er opt} {
+        dict with opt { puts -nonewline "$cmd $condition " }
+    } on error {er opt} {
+        dict with opt { puts -nonewline "$cmd $condition " }
+    } on break {er opt} {
+        dict with opt { puts -nonewline "$cmd $condition " }
+    } finally {
+        puts -nonewline "finalize"
+    }
+
+
+?>

Modified: tcl/rivet/trunk/tests/virtualhost.test
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tests/virtualhost.test?rev=1760063&r1=1760062&r2=1760063&view=diff
==============================================================================
--- tcl/rivet/trunk/tests/virtualhost.test (original)
+++ tcl/rivet/trunk/tests/virtualhost.test Fri Sep  9 16:19:36 2016
@@ -6,15 +6,15 @@ set docroot1 [file join [pwd] docroot1]
 set docroot2 [file join [pwd] docroot2]
 
 set vhostconf {
-    NameVirtualHost 127.0.0.1
+    #NameVirtualHost 127.0.0.1
     <VirtualHost 127.0.0.1>
-    DocumentRoot $docroot1
-    ServerName vhost1
+        DocumentRoot $docroot1
+        ServerName vhost1
     </VirtualHost>
 
     <VirtualHost 127.0.0.1>
-    DocumentRoot $docroot2
-    ServerName vhost2
+        DocumentRoot $docroot2
+        ServerName vhost2
     </VirtualHost>
 }
 
@@ -40,7 +40,7 @@ set vhostconf {
     apachetest::start {} {
         RivetServerConf SeparateVirtualInterps off
         RivetServerConf ChildInitScript "source [file join $docroot1 childinit.tcl]"
-        NameVirtualHost 127.0.0.1
+        #NameVirtualHost 127.0.0.1
         <VirtualHost 127.0.0.1>
             DocumentRoot $docroot1
             ServerName vhost1
@@ -67,7 +67,7 @@ set vhostconf {
 ::tcltest::test vhost-2.2 {virtual host w/ ChildInitScript in vhost} {
     set data {}
     apachetest::start {} {
-	NameVirtualHost 127.0.0.1
+	#NameVirtualHost 127.0.0.1
 	<VirtualHost 127.0.0.1>
         DocumentRoot $docroot1
         ServerName vhost1
@@ -97,7 +97,7 @@ set vhostconf {
     set data {}
     apachetest::start {} {
 	RivetServerConf BeforeScript "source [file join $docroot1 beforescript.tcl]"
-	NameVirtualHost 127.0.0.1
+	#NameVirtualHost 127.0.0.1
 	<VirtualHost 127.0.0.1>
 	DocumentRoot $docroot1
 	ServerName vhost1
@@ -128,7 +128,7 @@ set vhostconf {
     set data {}
     apachetest::start {} {
         RivetServerConf SeparateVirtualInterps on
-        NameVirtualHost 127.0.0.1
+        #NameVirtualHost 127.0.0.1
         <VirtualHost 127.0.0.1>
             RivetServerConf ChildInitScript "set ::childinit1 1"
             DocumentRoot $docroot1
@@ -161,7 +161,7 @@ set vhostconf {
 
 # Format: directive, file, 2 regexps to match
 set configs {
-    ChildInitScript childinit.tcl "vhost2 hello world<br>\n::childinit2 exists<br>\n::childinit1 exists<br>" \
+    ChildInitScript childinit.tcl "vhost2 hello world<br>\n::childinit2 exists<br>\n::childinit1 exists<br>\n" \
                                   "vhost1 hello world<br>\n::childinit1 exists<br>\n::childinit2 exists<br>"
     BeforeScript beforescript.tcl "^beforescript2\nVirtual Host2 Test" "^beforescript1\nVirtual Host1 Test"
     AfterScript afterscript.tcl "afterscript2" "afterscript1"
@@ -173,7 +173,7 @@ foreach {conf file re1 re2} $configs {
 	apachetest::start {} "
 RivetServerConf SeparateVirtualInterps off
 RivetServerConf $conf \"source [file join $docroot1 $file]\"
-NameVirtualHost 127.0.0.1
+#NameVirtualHost 127.0.0.1
 <VirtualHost 127.0.0.1>
 DocumentRoot $docroot1
 ServerName vhost1
@@ -187,18 +187,17 @@ ServerName vhost2
 " {
 	set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]]
 	set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]]
-	set data1 [string trim [::http::data $page1]]
-	set data2 [string trim [::http::data $page2]]
+	set data1 [::http::data $page1]
+	set data2 [::http::data $page2]
 	::http::cleanup $page1
 	::http::cleanup $page2
 }
-#puts "|$re1|\n#$data1#"
-#puts "|$re2|\n#$data2#"
+#puts "--$re1--\n--$data1--"
+#puts "--$re2--\n--$data2--"
 
-list [regexp $re1 $data1 match] [regexp $re2 $data2 match]
+list [regexp $re1 $data1 match] [regexp $re1 $data1 match]
 #list $data1 $data2
     } {1 1}
-    incr i
 }
 
 set configs {
@@ -215,7 +214,7 @@ foreach {conf file re1 re2} $configs {
 	apachetest::start {} "
 RivetServerConf SeparateVirtualInterps on
 RivetServerConf $conf \"source [file join $docroot1 $file]\"
-NameVirtualHost 127.0.0.1
+#NameVirtualHost 127.0.0.1
 <VirtualHost 127.0.0.1>
 DocumentRoot $docroot1
 ServerName vhost1
@@ -242,3 +241,5 @@ list [regexp $re1 $data1 match] [regexp
 
 incr i
 }
+
+



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org