Testserver
This documentation describes how to setup a VFS testserver needed during development for the junit
tests.
I tried to simplify things as good as I can, e.g. this setup uses for all server the same vfs work
directory.
Thus it is needed to setup apache to use user 'vfsusr' instead of 'wwwrun'.
Based on this description it should be possible for you to avoid this "insecurity" if needed.
I created it during setup a fresh server based on the following components:
- SuSE Linux 9.3 Minimal Installation
- Apache 2 Webserver (apache2-2.0.53)
- Samba 3 (samba-3.0.12)
- ssh (openssh-3.9p1)
- vsftp (vsftpd-2.0.2-3)
System setup
- You need maven to build the local test-data structure. This is done automatically during build of VFS.
- Create a user 'vfsusr' with password 'vfs/%\te:st' and home directory '/home/vfsusr'
- Create the directories
- /vfstest
- /vfstest/write-tests
and copy from your local 'target/test-data' the directories
into it.
Now your structure looks like this:
- Setup a symbolic link to '/vfstest'
- Set permissions
- After you followed the steps below and setup the server ensure they
are activated and running.
This is only needed if you installed a fresh system. Otherwise simply restart them.
Apache 2 Webserver
- Create a file named '/etc/apache2/conf.d/vfstest.conf' with this content
- change the permission on
- Activate the WebDAV module by adding 'dav' and 'dav_fs' to the list of modules in '/etc/sysconfig/apache2'. e.g
- Setup the webserver to use user-id 'vfsusr' and group 'users'. This can be done by changing the file '/etc/apache2/uid.conf'
- Create the VFS user to access the Webdav resource
Samba 3
- Create a share 'vfsusr'
- Setup a 'vfsusr' with password 'vfs/%\te:st'
ssh
- In '/etc/ssh/sshd_config' ensure
vsftp
- Ensure the server is not disabled in the xinetd configuration
Set
in '/etc/xinetd.d/vsftpd'
- Setup the server config: '/etc/vsftpd.conf'
write_enable=YES
local_enable=YES
Tests
Now we are finished and you can try to activate the tests by
- reactivate the tests in 'build.xml'.
Search for
and comment the exclude.
- or use the class org.apache.commons.vfs.RunTest where you have
to adapt some properties at the top of the file and choose which test
you would like to run by comment the others.
This is the way how I debug a failed testcase.