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:

  1. SuSE Linux 9.3 Minimal Installation
  2. Apache 2 Webserver (apache2-2.0.53)
  3. Samba 3 (samba-3.0.12)
  4. ssh (openssh-3.9p1)
  5. vsftp (vsftpd-2.0.2-3)

System setup

  1. You need maven to build the local test-data structure. This is done automatically during build of VFS.
  2. Create a user 'vfsusr' with password 'vfs/%\te:st' and home directory '/home/vfsusr'

  3. Create the directories
    1. /vfstest
    2. /vfstest/write-tests
    and copy from your local 'target/test-data' the directories
    code,read-tests
    into it.

    Now your structure looks like this:

  4. Setup a symbolic link to '/vfstest'

  5. Set permissions

  6. 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

  1. Create a file named '/etc/apache2/conf.d/vfstest.conf' with this content

  2. change the permission on
  3. Activate the WebDAV module by adding 'dav' and 'dav_fs' to the list of modules in '/etc/sysconfig/apache2'. e.g

  4. Setup the webserver to use user-id 'vfsusr' and group 'users'. This can be done by changing the file '/etc/apache2/uid.conf'

  5. Create the VFS user to access the Webdav resource

Samba 3

  1. Create a share 'vfsusr'

  2. Setup a 'vfsusr' with password 'vfs/%\te:st'

ssh

  1. In '/etc/ssh/sshd_config' ensure

vsftp

  1. Ensure the server is not disabled in the xinetd configuration

    Set
    disable=no
    in '/etc/xinetd.d/vsftpd'
  2. 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
  1. reactivate the tests in 'build.xml'.

    Search for and comment the exclude.
  2. 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.