Index: openacs-4/etc/install/crawl-links.test =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/crawl-links.test,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/etc/install/crawl-links.test 26 Nov 2003 16:38:01 -0000 1.1 @@ -0,0 +1,28 @@ +if { [catch { + # Source procedures + source tcl/test-procs.tcl + + ::twt::log_section "Login the site wide admin" + ::twt::user::login_site_wide_admin + + set exclude_list {delete remove /acs-admin/install} + ::twt::set_crawler_exclude_links $exclude_list + + ::twt::log_section "crawling links starting from \"$crawl_links_start_path\"" + ::twt::crawl_links $crawl_links_start_path + + if { [llength [::twt::get_excluded_urls]] > 0 } { + ::twt::log "Did not visit the following URLs because of exclude list: [join [::twt::get_excluded_urls] "\n"]" + } else { + ::twt::log "No URLs matched the exclude list ([join $exclude_list ", "])" + } +} result] } { + global errorInfo + ::twt::log $result + ::twt::log "*** Tcl TRACE ***" + ::twt::log $errorInfo + + ::twt::log "The response body is: [response body]" + + error "Test failed: $result" +} Index: openacs-4/etc/install/install.sh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/install.sh,v diff -u -r1.36 -r1.37 --- openacs-4/etc/install/install.sh 20 Nov 2003 13:58:58 -0000 1.36 +++ openacs-4/etc/install/install.sh 26 Nov 2003 16:38:01 -0000 1.37 @@ -203,7 +203,7 @@ restart_loop_count=`get_config_param restart_loop_count` shutdown_loop_count=`get_config_param shutdown_loop_count` dotlrn_demo_data=`get_config_param dotlrn_demo_data` -crawl_links=`get_config_param crawl_links` +crawl_links_start_path=`get_config_param crawl_links_start_path` aolserver_user=`get_config_param aolserver_user` aolserver_group=`get_config_param aolserver_group` admin_email=`get_config_param admin_email` @@ -259,7 +259,7 @@ x=0 while test "$x" -lt $shutdown_loop_count ; do - pid=`grep_for_pid "nsd.*$serverroot"` + pid=`grep_for_pid "nsd.*$aolserver_config_file"` if [ "$pid" == "" ]; then echo "$(date): Server is down" break @@ -271,7 +271,7 @@ done # Verify that the server is down, and abort if not -pid=$(grep_for_pid "nsd.*$serverroot") +pid=$(grep_for_pid "nsd.*$aolserver_config_file") if ! [ "$pid" == "" ]; then echo "$(date): Cannot stop the server. You must shut down the server first." exit -1 @@ -529,12 +529,24 @@ #--------------------------------------------------------------- # Search for broken pages - if parameter_true $crawl_links; then - echo "$(date): Starting to crawl links to search for broken pages at." - ${tclwebtest_dir}/tclwebtest -config_file $config_file dotlrn-links-check.test + if [ -n "$crawl_links_start_path" ]; then + echo "$(date): Starting to crawl links to search for broken pages. Start path is $crawl_links_start_path" + ${tclwebtest_dir}/tclwebtest -config_file $config_file crawl-links.test fi #------------------------------------------------------------------- + # Run any additional tclwebtest scripts + if [ -n "$tclwebtest_scripts" ]; then + echo "$(date): Running additional tclwebtest scripts" + + for tclwebtest_script_path in $tclwebtest_scripts + do + echo "$(date): Running tclwebtest script $tclwebtest_script_path" + ${tclwebtest_dir}/tclwebtest -config_file $config_file $tclwebtest_script_path + done + fi + + #------------------------------------------------------------------- # Check errors in the log file # We do this before the Tcl API tests as these tend to generate errors intentionally if [ -r ${error_log_file} ]; then @@ -565,18 +577,6 @@ fi #------------------------------------------------------------------- - # Run any additional tclwebtest scripts - if [ -n "$tclwebtest_scripts" ]; then - echo "$(date): Running additional tclwebtest scripts" - - for tclwebtest_script_path in $tclwebtest_scripts - do - echo "$(date): Running tclwebtest script $tclwebtest_script_path" - ${tclwebtest_dir}/tclwebtest -config_file $config_file $tclwebtest_script_path - done - fi - - #------------------------------------------------------------------- # Warn about errors in the HTML returned from the server ./warn-if-installation-errors.sh `get_config_param install_output_file` Index: openacs-4/etc/install/install.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/install.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/etc/install/install.tcl 19 Nov 2003 16:46:04 -0000 1.15 +++ openacs-4/etc/install/install.tcl 26 Nov 2003 16:39:56 -0000 1.16 @@ -255,8 +255,10 @@ set dotlrn_users_data_file "users-data.csv" set demo_users_password "guest" -# Should links be crawled to search for broken pages? This doesn't quite work! -set crawl_links "no" +# Should links be crawled to search for broken pages? If so, specify the path +# to start from here. To crawl the whole site, set this parameter to "/". To +# not do any crawling, leave empty. +set crawl_links_start_path "" #---------------------------------------------------------------------- # HTTP level testing and demo data setup with tclwebtest