Accepting request 335993 from home:pgajdos:apache2
- version 20150930 - %apache_test_module_start_apache, %apache_test_module_load: introduce -t option - %apache_test_module_curl: introduce -r option OBS-URL: https://build.opensuse.org/request/show/335993 OBS-URL: https://build.opensuse.org/package/show/Apache/apache-rpm-macros?expand=0&rev=21
This commit is contained in:
parent
47c5fbefab
commit
348ddeb892
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 30 17:14:29 UTC 2015 - pgajdos@suse.com
|
||||||
|
|
||||||
|
- version 20150930
|
||||||
|
- %apache_test_module_start_apache, %apache_test_module_load:
|
||||||
|
introduce -t option
|
||||||
|
- %apache_test_module_curl: introduce -r option
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Sep 22 07:16:24 UTC 2015 - pgajdos@suse.com
|
Tue Sep 22 07:16:24 UTC 2015 - pgajdos@suse.com
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
%endif
|
%endif
|
||||||
%define macros_file macros.apache
|
%define macros_file macros.apache
|
||||||
Name: apache-rpm-macros
|
Name: apache-rpm-macros
|
||||||
Version: 20150921
|
Version: 20150930
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Apache RPM Macros
|
Summary: Apache RPM Macros
|
||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
#
|
#
|
||||||
# macro: apache_test_module_start_apache -- start apache with specified modules loaded
|
# macro: apache_test_module_start_apache -- start apache with specified modules loaded
|
||||||
#
|
#
|
||||||
# usage: apache_test_module_start_apache -m module_list [-i include_list] [-r document_root]
|
# usage: apache_test_module_start_apache [-m module_list] [-i include_list] [-r document_root]
|
||||||
# [-u user] [-g group] [-p port]
|
# [-u user] [-g group] [-p port] [-t mpm]
|
||||||
#
|
#
|
||||||
# module_list: colon separated list of module names to be loaded with test run
|
# module_list: colon separated list of module names to be loaded with test run
|
||||||
# search path: %{buildroot} tree
|
# search path: %{buildroot} tree
|
||||||
@ -35,12 +35,13 @@
|
|||||||
# [default value: abuild]
|
# [default value: abuild]
|
||||||
# port: listen on port
|
# port: listen on port
|
||||||
# [default value: 60080]
|
# [default value: 60080]
|
||||||
|
# mpm: multiprocessing module (prefork, worker, event)
|
||||||
|
# [default value: prefork]
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
%apache_test_module_start_apache(m:,i:,r:,u:,g:) \
|
%apache_test_module_start_apache(m:,i:,r:,u:,g:,t:) \
|
||||||
# constants \
|
# constants \
|
||||||
TEST_DIR='%{__test_dir}' \
|
TEST_DIR='%{__test_dir}' \
|
||||||
TEST_MPM='%{__test_mpm}' \
|
|
||||||
# arguments \
|
# arguments \
|
||||||
# modules to load, from BUILD tree or system \
|
# modules to load, from BUILD tree or system \
|
||||||
MODULES=$(echo %{-m:%{-m*}} | tr ':' ' ') \
|
MODULES=$(echo %{-m:%{-m*}} | tr ':' ' ') \
|
||||||
@ -65,6 +66,10 @@
|
|||||||
if [ -z "$TEST_PORT" ]; then \
|
if [ -z "$TEST_PORT" ]; then \
|
||||||
TEST_PORT='%{__test_port}' \
|
TEST_PORT='%{__test_port}' \
|
||||||
fi \
|
fi \
|
||||||
|
TEST_MPM="%{-t:%{-t*}}" \
|
||||||
|
if [ -z "$TEST_MPM" ]; then \
|
||||||
|
TEST_MPM='%{__test_mpm}' \
|
||||||
|
fi \
|
||||||
# helpers \
|
# helpers \
|
||||||
APACHE_BRANCH=$(echo %{apache_branch} | tr -d '.') \
|
APACHE_BRANCH=$(echo %{apache_branch} | tr -d '.') \
|
||||||
# begin \
|
# begin \
|
||||||
@ -119,15 +124,6 @@
|
|||||||
done \
|
done \
|
||||||
echo "DocumentRoot $DOCUMENT_ROOT" >> $TEST_CONF_FILE \
|
echo "DocumentRoot $DOCUMENT_ROOT" >> $TEST_CONF_FILE \
|
||||||
echo "DirectoryIndex index.html" >> $TEST_CONF_FILE \
|
echo "DirectoryIndex index.html" >> $TEST_CONF_FILE \
|
||||||
echo "<Directory $DOCUMENT_ROOT>" >> $TEST_CONF_FILE \
|
|
||||||
if [ $APACHE_BRANCH -ge 24 ]; then \
|
|
||||||
echo " Require local" >> $TEST_CONF_FILE \
|
|
||||||
else \
|
|
||||||
echo " Order deny,allow" >> $TEST_CONF_FILE \
|
|
||||||
echo " Deny from all" >> $TEST_CONF_FILE \
|
|
||||||
echo " Allow from localhost" >> $TEST_CONF_FILE \
|
|
||||||
fi \
|
|
||||||
echo "</Directory>" >> $TEST_CONF_FILE \
|
|
||||||
# run apache \
|
# run apache \
|
||||||
CMD=$(ls %{_sbindir}/httpd*-$TEST_MPM | head -n 1) \
|
CMD=$(ls %{_sbindir}/httpd*-$TEST_MPM | head -n 1) \
|
||||||
echo -n "Starting Apache ... " \
|
echo -n "Starting Apache ... " \
|
||||||
@ -162,22 +158,25 @@
|
|||||||
# document root of test instance
|
# document root of test instance
|
||||||
#
|
#
|
||||||
# usage: apache_test_module_curl -d document_to_curl -o output_of_curl
|
# usage: apache_test_module_curl -d document_to_curl -o output_of_curl
|
||||||
# -p port -u user:password
|
# -p port -u user:password -r protocol
|
||||||
#
|
#
|
||||||
# document_to_curl: relative to DocumentRoot [default: /]
|
# document_to_curl: relative to DocumentRoot [default: /]
|
||||||
# output_of_curl: where to save document (required)
|
# output_of_curl: where to save document (required)
|
||||||
# port: from which port of localhost will be document
|
# port: from which port of localhost will be document
|
||||||
# downloaded [default value: 60080]
|
# downloaded [default value: 60080]
|
||||||
# user:password: --user parameter of curl
|
# user:password: --user parameter of curl
|
||||||
|
# protocol: protocol to download document
|
||||||
|
# [default: http]
|
||||||
#
|
#
|
||||||
# example: apache_test_module_curl -d foo/test.html -o test.html
|
# example: apache_test_module_curl -d foo/test.html -o test.html
|
||||||
# apache_test_module_curl -d foo/ -o output.txt
|
# apache_test_module_curl -d foo/ -o output.txt
|
||||||
#
|
#
|
||||||
%apache_test_module_curl(d:,o:,p:,u:) \
|
%apache_test_module_curl(d:,o:,p:,u:,r:) \
|
||||||
TEST_DOCUMENT="%{-d:%{-d*}}" \
|
TEST_DOCUMENT="%{-d:%{-d*}}" \
|
||||||
TEST_OUTPUT="%{-o:%{-o*}}" \
|
TEST_OUTPUT="%{-o:%{-o*}}" \
|
||||||
TEST_PORT="%{-p:%{-p*}}" \
|
TEST_PORT="%{-p:%{-p*}}" \
|
||||||
TEST_CURL_USER="%{-u:%{-u*}}" \
|
TEST_CURL_USER="%{-u:%{-u*}}" \
|
||||||
|
TEST_PROTO="%{-r:%{-r*}}" \
|
||||||
if [ -z "$TEST_PORT" ]; then \
|
if [ -z "$TEST_PORT" ]; then \
|
||||||
TEST_PORT='%{__test_port}' \
|
TEST_PORT='%{__test_port}' \
|
||||||
fi \
|
fi \
|
||||||
@ -189,13 +188,16 @@
|
|||||||
if [ ! -z "$TEST_CURL_USER" ]; then \
|
if [ ! -z "$TEST_CURL_USER" ]; then \
|
||||||
USER_PARAM="-u $TEST_CURL_USER" \
|
USER_PARAM="-u $TEST_CURL_USER" \
|
||||||
fi \
|
fi \
|
||||||
curl -s "http://localhost:$TEST_PORT/$TEST_DOCUMENT" --create-dirs -o "$TEST_OUTPUT" $USER_PARAM \
|
if [ -z "$TEST_PROTO" ]; then \
|
||||||
|
TEST_PROTO="http" \
|
||||||
|
fi \
|
||||||
|
curl -s -k "$TEST_PROTO://127.0.0.1:$TEST_PORT/$TEST_DOCUMENT" --create-dirs -o "$TEST_OUTPUT" $USER_PARAM \
|
||||||
%nil
|
%nil
|
||||||
|
|
||||||
#
|
#
|
||||||
# macro: apache_test_module_load -- tests that module(s) can be loaded
|
# macro: apache_test_module_load -- tests that module(s) can be loaded
|
||||||
#
|
#
|
||||||
# usage: apache_test_module_load -m module_list [-i include_list]
|
# usage: apache_test_module_load [-m module_list] [-i include_list] [-t mpm]
|
||||||
#
|
#
|
||||||
# module_list: colon separated list of module names to be loaded with test run
|
# module_list: colon separated list of module names to be loaded with test run
|
||||||
# search path: %{buildroot} tree
|
# search path: %{buildroot} tree
|
||||||
@ -207,9 +209,11 @@
|
|||||||
# search path %{buildroot}%{apache_sysconfdir} tree
|
# search path %{buildroot}%{apache_sysconfdir} tree
|
||||||
# $PWD tree
|
# $PWD tree
|
||||||
# [example value: mod_asn.conf]
|
# [example value: mod_asn.conf]
|
||||||
|
# mpm: multiprocessing module (prefork, worker, event)
|
||||||
|
# [default value: prefork]
|
||||||
#
|
#
|
||||||
%apache_test_module_load(m:,i:) \
|
%apache_test_module_load(m:,i:,t:) \
|
||||||
%apache_test_module_start_apache %{-m:-m %{-m*}} %{-i:-i %{-i*}} \
|
%apache_test_module_start_apache %{-m:-m %{-m*}} %{-i:-i %{-i*}} %{-t:-t %{-t*}} \
|
||||||
%apache_test_module_stop_apache \
|
%apache_test_module_stop_apache \
|
||||||
%nil
|
%nil
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user