NAME

HTTP::WebTest::Plugin::Apache - Local web file tests plugin

SYNOPSIS

Not Applicable

DESCRIPTION

This plugin provides support for local web file test mode. Apache must be installed to run tests in this mode.

If HTTP::WebTest encounters parameter file_path it switches in local web file test mode. In local web file test mode it launches an instance of Apache daemon, copies local test file(s) under DocumentRoot of this Apache and performs test checks against it.

Apache Directory and Files

A tree of directories with templates of Apache config files is required to run local web file tests.

The apache_dir parameter must be set to the name of a directory that contains the subdirectories conf, logs and htdocs. The conf subdirectory must contain a file named httpd.conf-dist. The htdocs subdirectory must contain a subdirectory named webtest that contains a file named is_apache_responding.html. If your installation of Apache has the Perl module Apache::ASP configured, the apache_dir directory must also contain a subdirectory named asp_tmp.

The file httpd.conf-dist is used as template for the Apache config file. It contains tags which are replaced with the values needed by the Apache server that the program starts at runtime.

  • Please_do_not_modify_PORT

    To be replaced with port number on which Apache runs during tests.

  • Please_do_not_modify_HOST_NAME

    To be replace with Apache host name.

  • Please_do_not_modify_SERVER_ROOT

    To be replaced with Apache server root.

  • Please_do_not_modify_LOG_LEVEL

    To be replaced with Apache log level.

TEST PARAMETERS

apache_dir

Absolute or relative path name of directory containing Apache files. See the APACHE DIRECTORY AND FILES section. This parameter is ignored unless the file_path parameter is specified.

Default Value

/usr/local/etc/http-webtest

apache_exec

Absolute or relative path name of Apache executable. This command can be in your $PATH. This parameter is ignored unless the file_path parameter is specified.

Default Value

/usr/sbin/apache

apache_loglevel

Apache logging level. If you use a level less than warn (i.e., debug, info, or notice), the program may generate irrelevant errors. This parameter is ignored unless the file_path parameter is specified. See also the ignore_error_log parameter.

Allowed Values

debug, info, notice, warn, error, crit, alert, emerg

Default Value

warn

apache_max_wait

Maximum number of seconds to wait for Apache to start. This parameter is ignored unless the file_path parameter is specified.

Default Value

60

apache_options

Additional Apache command line options. Many of the options cause Apache to exit immediately after starting, so the web page tests will not run. This parameter is ignored unless the file_path parameter is specified.

error_log

The pathname of a local web server error log. The module counts the number of lines in the error log before and after each request. If the number of lines increases, an error is counted and the additional lines are listed in the report. This argument should be used only when the local web server is running in single-process mode. Otherwise, requests generated by other processes/users may add lines to the error log that are not related to the requests generated by this module. See also parameter ignore_error_log.

file_path

Two-element list. First element is the file to test, either an absolute or a relative pathname. Second element is the subdirectory pathname, relative to the Apache htdocs directory, to copy the file to. The copied file will have the same basename as the first element and the relative pathname of the second element. To copy the file directly to the htdocs directory, use a pathname of . or ./..

ignore_error_log

Option to ignore any errors found in the Apache error log. The default behavior is to flag an error if the fetch causes any errors to be added to the error log and echo the errors to the program output. This check is available only if error_log parameter is specified. See also the apache_loglevel parameter.

Allowed values

yes, no

Default value

no

include_file_path

List with an even number of elements. Odd-numbered elements are files to copy to the the temporary Apache directory before running the tests. These files can be specified using either an absolute or a relative pathname. Even-numbered elements are the subdirectory pathname, relative to the Apache ServerRoot directory, to copy the corresponding file to. The copied file will have the same basename as the odd-numbered element and the relative pathname of the corresponding even-numbered element. To copy the file directly to the ServerRoot directory, use a pathname of . or ./..

COPYRIGHT

Copyright (c) 2000-2001 Richard Anderson. All rights reserved.

Copyright (c) 2001,2002 Ilya Martynov. All rights reserved.

This module is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License.

SEE ALSO

HTTP::WebTest

HTTP::WebTest::API

HTTP::WebTest::Plugin

HTTP::WebTest::Plugins