Accepting request 144823 from devel:tools:scm:svn
- for package maintainers, add support to run regression tests over ra_neon and ra_serf (http://) via Apache / mod_dav_svn when built --with=regression_tests (forwarded request 144822 from AndreasStieger) OBS-URL: https://build.opensuse.org/request/show/144823 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/subversion?expand=0&rev=91
This commit is contained in:
commit
279059041e
2
subversion-tests-httpd-users
Normal file
2
subversion-tests-httpd-users
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
jrandom:xCGl35kV9oWCY
|
||||||
|
jconstant:xCGl35kV9oWCY
|
33
subversion-tests-httpd.conf.tmpl
Normal file
33
subversion-tests-httpd.conf.tmpl
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
Listen 127.0.0.1:REPLACE_PORT
|
||||||
|
ServerName tests.example.com
|
||||||
|
ErrorLog ./error_log
|
||||||
|
PidFile ./httpd.pid
|
||||||
|
LoadModule auth_basic_module REPLACE_APACHE_LIBEXECDIR/mod_auth_basic.so
|
||||||
|
LoadModule authn_file_module REPLACE_APACHE_LIBEXECDIR/mod_authn_file.so
|
||||||
|
LoadModule alias_module REPLACE_APACHE_LIBEXECDIR/mod_alias.so
|
||||||
|
LoadModule dav_module REPLACE_APACHE_LIBEXECDIR/mod_dav.so
|
||||||
|
LoadModule dav_svn_module REPLACE_BUILDROOTREPLACE_APACHE_LIBEXECDIR/mod_dav_svn.so
|
||||||
|
LoadModule authz_svn_module REPLACE_BUILDROOTREPLACE_APACHE_LIBEXECDIR/mod_authz_svn.so
|
||||||
|
|
||||||
|
<Location /svn-test-work/repositories>
|
||||||
|
DAV svn
|
||||||
|
SVNParentPath REPLACE_BUILDDIR/subversion/tests/cmdline/svn-test-work/repositories
|
||||||
|
AuthzSVNAccessFile REPLACE_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz
|
||||||
|
AuthType Basic
|
||||||
|
AuthName "Subversion Repository"
|
||||||
|
AuthUserFile REPLACE_BUILDDIR/users
|
||||||
|
Require valid-user
|
||||||
|
</Location>
|
||||||
|
|
||||||
|
<Location /svn-test-work/local_tmp/repos>
|
||||||
|
DAV svn
|
||||||
|
SVNPath REPLACE_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp/repos
|
||||||
|
AuthzSVNAccessFile REPLACE_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz
|
||||||
|
AuthType Basic
|
||||||
|
AuthName "Subversion Repository"
|
||||||
|
AuthUserFile REPLACE_BUILDDIR/users
|
||||||
|
Require valid-user
|
||||||
|
</Location>
|
||||||
|
|
||||||
|
RedirectMatch permanent ^/svn-test-work/repositories/REDIRECT-PERM-(.*)$ /svn-test-work/repositories/$1
|
||||||
|
RedirectMatch ^/svn-test-work/repositories/REDIRECT-TEMP-(.*)$ /svn-test-work/repositories/$1
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Dec 8 12:11:19 UTC 2012 - andreas.stieger@gmx.de
|
||||||
|
|
||||||
|
- for package maintainers, add support to run regression tests
|
||||||
|
over ra_neon and ra_serf (http://) via Apache / mod_dav_svn
|
||||||
|
when built --with=regression_tests
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Oct 6 10:44:48 UTC 2012 - andreas.stieger@gmx.de
|
Sat Oct 6 10:44:48 UTC 2012 - andreas.stieger@gmx.de
|
||||||
|
|
||||||
|
@ -154,6 +154,8 @@ BuildRequires: sqlite3-devel >= %{sqlite_version}
|
|||||||
%requires_ge libsqlite3-0
|
%requires_ge libsqlite3-0
|
||||||
%endif # with_intree_sqlite
|
%endif # with_intree_sqlite
|
||||||
Source92: %{name}.rpmlintrc
|
Source92: %{name}.rpmlintrc
|
||||||
|
Source93: subversion-tests-httpd.conf.tmpl
|
||||||
|
Source94: subversion-tests-httpd-users
|
||||||
#
|
#
|
||||||
Patch11: subversion.libtool-verbose.patch
|
Patch11: subversion.libtool-verbose.patch
|
||||||
# build fixes
|
# build fixes
|
||||||
@ -626,38 +628,93 @@ ulimit -a
|
|||||||
# During "make check", auth-test loads DSOs at runtime and can't find
|
# During "make check", auth-test loads DSOs at runtime and can't find
|
||||||
# them if we don't set up LD_LIBRARY_PATH as below.
|
# them if we don't set up LD_LIBRARY_PATH as below.
|
||||||
export LD_LIBRARY_PATH="$PWD/subversion/libsvn_auth_kwallet/.libs:$PWD/subversion/libsvn_auth_gnome_keyring/.libs:$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="$PWD/subversion/libsvn_auth_kwallet/.libs:$PWD/subversion/libsvn_auth_gnome_keyring/.libs:$LD_LIBRARY_PATH"
|
||||||
# run test over ra_local (file://)
|
|
||||||
CHECK_FS_TYPE=fsfs
|
CHECK_FS_TYPE=fsfs
|
||||||
|
|
||||||
|
# run tests over ra_local (file://)
|
||||||
%__make check LOG_TO_STDOUT=true CLEANUP=true FS_TYPE="$CHECK_FS_TYPE"
|
%__make check LOG_TO_STDOUT=true CLEANUP=true FS_TYPE="$CHECK_FS_TYPE"
|
||||||
|
|
||||||
SVNSERVE_PIDFILE="$PWD/svnserve.pid"
|
SVNSERVE_PIDFILE="$PWD/svnserve.pid"
|
||||||
|
HTTPD_PIDFILE="$PWD/httpd.pid"
|
||||||
# hook up cleanup routine
|
# hook up cleanup routine
|
||||||
function on_exit {
|
function on_exit {
|
||||||
if [ -e "$SVNSERVE_PIDFILE" ]; then
|
if [ -e "$SVNSERVE_PIDFILE" ]; then
|
||||||
pid=`cat "$SVNSERVE_PIDFILE" 2>/dev/null || :`
|
pid=`cat "$SVNSERVE_PIDFILE" 2>/dev/null || :`
|
||||||
test -n "$pid" && kill -9 "$pid" || :
|
test -n "$pid" && kill -9 "$pid" || :
|
||||||
fi
|
fi
|
||||||
|
if [ -e "$HTTPD_PIDFILE" ]; then
|
||||||
|
pid=`cat "$HTTPD_PIDFILE" 2>/dev/null || :`
|
||||||
|
test -n "$pid" && kill -9 "$pid" || :
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
trap on_exit EXIT
|
trap on_exit EXIT
|
||||||
# find free port
|
|
||||||
free_port=""
|
# find next free port
|
||||||
for p in `/usr/sbin/ss -nat|tail +2|awk '{ split($4, a, ":"); if (a[2] > 1024) { print a[2]; }}'`; do used_port[$p]="$p"; done
|
function find_next_free_port {
|
||||||
for p in `seq 1025 65535`; do
|
if [ -z "$free_port" ]; then # on first invocation
|
||||||
|
local start_port=1025 # start with user port range
|
||||||
|
else # on subsequent invocations
|
||||||
|
local start_port=$free_port; # look for ports above the last
|
||||||
|
let start_port++; # as the daemon might still use it
|
||||||
|
fi
|
||||||
|
free_port=""
|
||||||
|
# in the OBS build VMs, the call to ss actually fails, resulting in all port to be returned as unused,
|
||||||
|
# subsequent calls to the function will use a sequence from 1025, which are always available in VM.
|
||||||
|
# For local builds this takes into account locally used ports. Either way works to get a usable port.
|
||||||
|
for p in `/usr/sbin/ss -nat|tail +2|awk '{ split($4, a, ":"); if (a[2] > 1024) { print a[2]; }}'`; do used_port[$p]="$p"; done
|
||||||
|
for p in `seq $start_port 65535`; do
|
||||||
if [ -z "${used_port[$p]}" ]; then
|
if [ -z "${used_port[$p]}" ]; then
|
||||||
free_port="$p"
|
free_port="$p"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ -z "$free_port" ]; then
|
if [ -z "$free_port" ]; then
|
||||||
echo "ERROR: failed to find a free port" >&2
|
echo "ERROR: failed to find a free port" >&2
|
||||||
echo "Used TCP ports: ${used_port[*]}" >&2
|
echo "Used TCP ports: ${used_port[*]}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
find_next_free_port
|
||||||
|
|
||||||
# run tests over ra_svn (svn://)
|
# run tests over ra_svn (svn://)
|
||||||
"$PWD/subversion/svnserve/svnserve" --listen-host 127.0.0.1 --listen-port "$free_port" --pid-file "$SVNSERVE_PIDFILE" -d -r "$PWD/subversion/tests/cmdline"
|
"$PWD/subversion/svnserve/svnserve" --listen-host 127.0.0.1 --listen-port "$free_port" --pid-file "$SVNSERVE_PIDFILE" -d -r "$PWD/subversion/tests/cmdline"
|
||||||
%__make check LOG_TO_STDOUT=true CLEANUP=true FS_TYPE="$CHECK_FS_TYPE" BASE_URL="svn://127.0.0.1:$free_port" || cat $RPM_SOURCE_DIR/%name*/tests.log
|
%__make check LOG_TO_STDOUT=true CLEANUP=true FS_TYPE="$CHECK_FS_TYPE" BASE_URL="svn://127.0.0.1:$free_port" || cat $RPM_SOURCE_DIR/%name*/tests.log
|
||||||
kill -9 `cat "$SVNSERVE_PIDFILE" 2>/dev/null`
|
kill -9 `cat "$SVNSERVE_PIDFILE" 2>/dev/null`
|
||||||
%__rm "$SVNSERVE_PIDFILE"
|
%__rm "$SVNSERVE_PIDFILE"
|
||||||
|
|
||||||
|
# run tests over ra_neon (http://)
|
||||||
|
%if %{with neon}
|
||||||
|
find_next_free_port
|
||||||
|
# create apache configuration
|
||||||
|
%__cp "%{SOURCE94}" users
|
||||||
|
APACHE_LIBEXECDIR="%{apache_libexecdir}"
|
||||||
|
< "%{SOURCE93}" \
|
||||||
|
sed "s/REPLACE_PORT/$free_port/g" | \
|
||||||
|
sed "s/REPLACE_BUILDROOT/${RPM_BUILD_ROOT//\//\\/}/g" | \
|
||||||
|
sed "s/REPLACE_BUILDDIR/${PWD//\//\\/}/g" | \
|
||||||
|
sed "s/REPLACE_APACHE_LIBEXECDIR/${APACHE_LIBEXECDIR//\//\\/}/g" > httpd.conf
|
||||||
|
LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" /usr/sbin/httpd2 -d "$PWD" -f httpd.conf
|
||||||
|
%__make check LOG_TO_STDOUT=true CLEANUP=true FS_TYPE="$CHECK_FS_TYPE" BASE_URL=http://127.0.0.1:$free_port HTTP_LIBRARY=neon || cat $RPM_SOURCE_DIR/%name*/tests.log
|
||||||
|
kill -9 `cat "$HTTPD_PIDFILE" 2>/dev/null`
|
||||||
|
%__rm "$HTTPD_PIDFILE"
|
||||||
|
%endif # neon
|
||||||
|
|
||||||
|
# run tests over ra_serf (http://)
|
||||||
|
%if %{with serf}
|
||||||
|
find_next_free_port
|
||||||
|
# create apache configuration
|
||||||
|
%__cp "%{SOURCE94}" users
|
||||||
|
APACHE_LIBEXECDIR="%{apache_libexecdir}"
|
||||||
|
< "%{SOURCE93}" \
|
||||||
|
sed "s/REPLACE_PORT/$free_port/g" | \
|
||||||
|
sed "s/REPLACE_BUILDROOT/${RPM_BUILD_ROOT//\//\\/}/g" | \
|
||||||
|
sed "s/REPLACE_BUILDDIR/${PWD//\//\\/}/g" | \
|
||||||
|
sed "s/REPLACE_APACHE_LIBEXECDIR/${APACHE_LIBEXECDIR//\//\\/}/g" > httpd.conf
|
||||||
|
LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH" /usr/sbin/httpd2 -d "$PWD" -f httpd.conf
|
||||||
|
%__make check LOG_TO_STDOUT=true CLEANUP=true FS_TYPE="$CHECK_FS_TYPE" BASE_URL=http://127.0.0.1:$free_port HTTP_LIBRARY=serf || cat $RPM_SOURCE_DIR/%name*/tests.log
|
||||||
|
kill -9 `cat "$HTTPD_PIDFILE" 2>/dev/null`
|
||||||
|
%__rm "$HTTPD_PIDFILE"
|
||||||
|
%endif # serf
|
||||||
|
|
||||||
%if %with_java
|
%if %with_java
|
||||||
%__make check-javahl
|
%__make check-javahl
|
||||||
%endif # with_java
|
%endif # with_java
|
||||||
|
Loading…
x
Reference in New Issue
Block a user