Index: openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl,v diff -u -r1.79.2.61 -r1.79.2.62 --- openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 2 Sep 2022 13:18:20 -0000 1.79.2.61 +++ openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 9 Sep 2022 11:32:59 -0000 1.79.2.62 @@ -1267,6 +1267,29 @@ $url] } + ad_proc -public ::acs::test::url {} { + @return the test URL representing our system for testing. This + would normally look like the output of ns_conn location, + unless it was overridden via the TestURL parameter in this + package. + } { + # + # Check, if a testURL was specified in the config file + # + # ns_section ns/server/${server}/acs/acs-automated-testing + # ns_param TestURL http://127.0.0.1:8080/ + # + set url [parameter::get \ + -package_id [apm_package_id_from_key acs-automated-testing] \ + -parameter TestURL \ + -default ""] + if {$url eq ""} { + set url [ns_conn location] + } + + return $url + } + ad_proc -public ::acs::test::http { {-user_id 0} {-user_info ""} @@ -1302,19 +1325,7 @@ #aa_log "HTTP: user_info [ns_quotehtml <$user_info>]" #aa_log "HTTP: start session_info [ns_quotehtml <$session>]" - # - # Check, if a testURL was specified in the config file - # - # ns_section ns/server/${server}/acs/acs-automated-testing - # ns_param TestURL http://127.0.0.1:8080/ - # - set url [parameter::get \ - -package_id [apm_package_id_from_key acs-automated-testing] \ - -parameter TestURL \ - -default ""] - if {$url eq ""} { - set url [ns_conn location] - } + set url [acs::test::url] set urlInfo [ns_parseurl $url] set address [dict get $urlInfo host] set url "$url/$request" Index: openacs-4/packages/acs-tcl/tcl/test/http-client-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/http-client-procs.tcl,v diff -u -r1.1.2.20 -r1.1.2.21 --- openacs-4/packages/acs-tcl/tcl/test/http-client-procs.tcl 1 Sep 2022 09:50:57 -0000 1.1.2.20 +++ openacs-4/packages/acs-tcl/tcl/test/http-client-procs.tcl 9 Sep 2022 11:32:59 -0000 1.1.2.21 @@ -248,15 +248,7 @@ } { set endpoint_name /acs-tcl-util-http-post-vars - set url [parameter::get \ - -package_id [apm_package_id_from_key acs-automated-testing] \ - -parameter TestURL \ - -default ""] - if {$url eq ""} { - set url [ns_conn location] - } - set urlInfo [ns_parseurl $url] - set url ${url}${endpoint_name} + set url [acs::test::url]${endpoint_name} set script { set files [list] Index: openacs-4/packages/acs-tcl/tcl/test/security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/security-procs.tcl,v diff -u -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/acs-tcl/tcl/test/security-procs.tcl 26 Aug 2022 12:06:44 -0000 1.1.2.8 +++ openacs-4/packages/acs-tcl/tcl/test/security-procs.tcl 9 Sep 2022 11:32:59 -0000 1.1.2.9 @@ -32,19 +32,7 @@ } } - # - # Check, if a testURL was specified in the config file - # - # ns_section ns/server/${server}/acs/acs-automated-testing - # ns_param TestURL http://127.0.0.1:8080/ - # - set url [parameter::get \ - -package_id [apm_package_id_from_key acs-automated-testing] \ - -parameter TestURL -default ""] - if {$url eq ""} { - set url [ns_conn location] - } - set url "$url/$test_url" + set url [acs::test::url]/${test_url} # This test strictly requires a cookie-based # authentication, and not e.g. a test authentication Index: openacs-4/packages/acs-templating/tcl/test/acs-integration-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/test/acs-integration-procs.tcl,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/acs-templating/tcl/test/acs-integration-procs.tcl 1 Sep 2022 12:58:54 -0000 1.1.2.2 +++ openacs-4/packages/acs-templating/tcl/test/acs-integration-procs.tcl 9 Sep 2022 11:32:59 -0000 1.1.2.3 @@ -16,15 +16,7 @@ } { set endpoint_name /acs-templating-test-ad-return-exception-template - set url [parameter::get \ - -package_id [apm_package_id_from_key acs-automated-testing] \ - -parameter TestURL \ - -default ""] - if {$url eq ""} { - set url [ns_conn location] - } - set urlInfo [ns_parseurl $url] - set url ${url}${endpoint_name} + set url [acs::test::url]${endpoint_name} try { ns_register_proc GET $endpoint_name { Index: openacs-4/packages/acs-templating/tcl/test/file-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/test/file-procs.tcl,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/packages/acs-templating/tcl/test/file-procs.tcl 2 Sep 2022 13:18:20 -0000 1.1.2.4 +++ openacs-4/packages/acs-templating/tcl/test/file-procs.tcl 9 Sep 2022 11:32:59 -0000 1.1.2.5 @@ -28,15 +28,7 @@ } { set endpoint_name /acs-templating-test-template-widget-file - set url [parameter::get \ - -package_id [apm_package_id_from_key acs-automated-testing] \ - -parameter TestURL \ - -default ""] - if {$url eq ""} { - set url [ns_conn location] - } - set urlInfo [ns_parseurl $url] - set url ${url}${endpoint_name} + set url [acs::test::url]${endpoint_name} set script { set ::template::parse_level 0 Index: openacs-4/packages/proctoring-support/tcl/test/proctoring-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/proctoring-support/tcl/test/proctoring-test-procs.tcl,v diff -u -r1.1.2.16 -r1.1.2.17 --- openacs-4/packages/proctoring-support/tcl/test/proctoring-test-procs.tcl 2 Mar 2022 14:46:38 -0000 1.1.2.16 +++ openacs-4/packages/proctoring-support/tcl/test/proctoring-test-procs.tcl 9 Sep 2022 11:32:59 -0000 1.1.2.17 @@ -478,22 +478,7 @@ set name camera set file [acs_root_dir]/packages/proctoring-support/tcl/test/data/test.png - # - # Check, if a testURL was specified in the config file - # - # ns_section ns/server/${server}/acs/acs-automated-testing - # ns_param TestURL http://127.0.0.1:8080/ - # - set url [parameter::get \ - -package_id [apm_package_id_from_key acs-automated-testing] \ - -parameter TestURL \ - -default ""] - if {$url eq ""} { - set url [ns_conn location] - } - set urlInfo [ns_parseurl $url] - set address [dict get $urlInfo host] - set url "${url}${package_url}upload" + set url [acs::test::url]${package_url}upload aa_section "Upload enforcing active proctoring conf"