Commit 8e999efb authored by Alexander Larsson's avatar Alexander Larsson

Initial version of testing framework

This is an initial import of the gvfs-test test frameworks
from Martin Pitt, integrated into the gvfs tree.

For now its only run if you make test in the tests subdir
as some tests are failing. It also doesn't use the gvfs-testbed
script to launch a fuller test environment
parent 7dfcc1d1
......@@ -9,7 +9,6 @@ Makefile.in
*.exe
.deps
.libs
test
aclocal.m4
autom4te.cache
config.cache
......@@ -41,3 +40,5 @@ gtk-doc.make
monitor/proxy/gvfsvolumemonitordbus.*
metadata/metadata-dbus.*
common/gvfsdbus.*
man/*.1
man/*.7
......@@ -18,3 +18,4 @@ gvfsd-smb-browse
gvfsd-test
gvfsd-trash
*.mount
*.localmount
......@@ -39,6 +39,9 @@ service_DATA = gvfs-daemon.service
%.mount: %.mount.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
%.localmount: %.mount.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(abs_builddir)|" $< > $@
libexec_PROGRAMS=gvfsd gvfsd-sftp gvfsd-trash gvfsd-computer gvfsd-burn gvfsd-localtest gvfsd-ftp gvfsd-network
mount_in_files = sftp.mount.in ftp.mount.in trash.mount.in computer.mount.in burn.mount.in localtest.mount.in network.mount.in
......@@ -119,6 +122,8 @@ mount_DATA += afp-browse.mount afp.mount
libexec_PROGRAMS += gvfsd-afp-browse gvfsd-afp
endif
noinst_DATA = $(mount_DATA:.mount=.localmount)
EXTRA_DIST = \
gvfs-daemon.service.in \
$(mount_in_files) \
......
*.service
session.conf
......@@ -16,4 +16,48 @@ noinst_PROGRAMS = \
benchmark-posix-big-files \
$(NULL)
EXTRA_DIST = benchmark-common.c
session.conf: session.conf.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@testdir\@|$(abs_builddir)|" $< > $@
gvfs-daemon.service: $(top_srcdir)/daemon/gvfs-daemon.service.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(abs_top_builddir)/daemon|" $< > $@
gvfs-metadata.service: $(top_srcdir)/metadata/gvfs-metadata.service.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(abs_top_builddir)/metadata|" $< > $@
noinst_DATA= session.conf gvfs-daemon.service gvfs-metadata.service
if USE_AFC
org.gtk.Private.AfcVolumeMonitor.service: $(top_srcdir)/monitor/afc/org.gtk.Private.AfcVolumeMonitor.service.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(abs_top_builddir)/monitor//afc|" $< > $@
noinst_DATA+=org.gtk.Private.AfcVolumeMonitor.service
endif
if USE_GDU
org.gtk.Private.GduVolumeMonitor.service: $(top_srcdir)/monitor/gdu/org.gtk.Private.GduVolumeMonitor.service.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(abs_top_builddir)/monitor//gdu|" $< > $@
noinst_DATA+=org.gtk.Private.GduVolumeMonitor.service
endif
if USE_GPHOTO2
org.gtk.Private.GPhoto2VolumeMonitor.service: $(top_srcdir)/monitor/gphoto2/org.gtk.Private.GPhoto2VolumeMonitor.service.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(abs_top_builddir)/monitor//gphoto2|" $< > $@
noinst_DATA+=org.gtk.Private.GPhoto2VolumeMonitor.service
endif
if USE_HAL
org.gtk.Private.HalVolumeMonitor.service: $(top_srcdir)/monitor/hal/org.gtk.Private.HalVolumeMonitor.service.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(abs_top_builddir)/monitor//hal|" $< > $@
noinst_DATA+=org.gtk.Private.HalVolumeMonitor.service
endif
if USE_UDISKS2
org.gtk.Private.UDisks2VolumeMonitor.service: $(top_srcdir)/monitor/udisks2/org.gtk.Private.UDisks2VolumeMonitor.service.in ../config.log
$(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(abs_top_builddir)/monitor//udisks2|" $< > $@
noinst_DATA+=org.gtk.Private.UDisks2VolumeMonitor.service
endif
test: session.conf gvfs-daemon.service gvfs-metadata.service
./run-in-tree.sh ./gvfs-test
EXTRA_DIST = benchmark-common.c session.conf.in gvfs-test
This diff is collapsed.
#!/bin/bash
if [ $# -lt 1 ]; then
echo missing argument
exit
fi
# Set up env vars to make gvfs read mounts from the build tree
export GVFS_MOUNTABLE_EXTENSION=".localmount"
export GVFS_MOUNTABLE_DIR=`pwd`/../daemon
export PATH=`pwd`/../programs:$PATH
# Start a custom session dbus
PIDFILE=`mktemp`
export DBUS_SESSION_BUS_ADDRESS=`dbus-daemon --config-file=session.conf --fork --print-address=1 --print-pid=3 3>${PIDFILE}`
DBUS_SESSION_BUS_PID=`cat $PIDFILE`
rm $PIDFILE
trap "kill -9 $DBUS_SESSION_BUS_PID" SIGINT SIGTERM EXIT
$@
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Our well-known bus type, don't change this -->
<type>session</type>
<!-- If we fork, keep the user's original umask to avoid affecting
the behavior of child processes. -->
<keep_umask/>
<listen>unix:tmpdir=/tmp</listen>
<servicedir>@testdir@</servicedir>
<standard_session_servicedirs />
<policy context="default">
<!-- Allow everything to be sent -->
<allow send_destination="*" eavesdrop="true"/>
<!-- Allow everything to be received -->
<allow eavesdrop="true"/>
<!-- Allow anyone to own anything -->
<allow own="*"/>
</policy>
<include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
<!-- For the session bus, override the default relatively-low limits
with essentially infinite limits, since the bus is just running
as the user anyway, using up bus resources is not something we need
to worry about. In some cases, we do set the limits lower than
"all available memory" if exceeding the limit is almost certainly a bug,
having the bus enforce a limit is nicer than a huge memory leak. But the
intent is that these limits should never be hit. -->
<!-- the memory limits are 1G instead of say 4G because they can't exceed 32-bit signed int max -->
<limit name="max_incoming_bytes">1000000000</limit>
<limit name="max_incoming_unix_fds">250000000</limit>
<limit name="max_outgoing_bytes">1000000000</limit>
<limit name="max_outgoing_unix_fds">250000000</limit>
<limit name="max_message_size">1000000000</limit>
<limit name="max_message_unix_fds">4096</limit>
<limit name="service_start_timeout">120000</limit>
<limit name="auth_timeout">240000</limit>
<limit name="max_completed_connections">100000</limit>
<limit name="max_incomplete_connections">10000</limit>
<limit name="max_connections_per_user">100000</limit>
<limit name="max_pending_service_starts">10000</limit>
<limit name="max_names_per_connection">50000</limit>
<limit name="max_match_rules_per_connection">50000</limit>
<limit name="max_replies_per_connection">50000</limit>
</busconfig>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment