View Single Post
Old 03-31-2006, 06:56 PM  
Senior Member
Join Date: Jul 2005
Posts: 153
Default regression framework for ioftpd

it has been very busy around here, in the growing pains sort of way. i've got a lot of projects on my plate, and i'm trying to divide my time between all of them. this works much better in theory. :/

on the ioftpd front, i've built the beginning of a regression test framework so i can actually reproduce the problems reported here on the forums. it is complete enough that i've written several basic tests. a test input (baseline) file looks something like this:

;;; a basic list of the README on the remote server, using the
;;; anonymous account.
<-- 220 FTP Server ready.
--> USER anonymous
<-- 331 Password required for anonymous.
--> PASS root@
<-- 230-    [0-9]{2}/[0-9]{2}/[0-9]{2}[0-9]{2}:[0-9]{2}:[0-9]{2}
<-- 230-User [a-zA-Z]+ from [a-zA-Z]+, welcome to our FTP server.
<-- 230-
<-- 230-Site layout:
<-- 230-
<-- 230-        /home/          - Home directories
<-- 230-        /mnt/           - Network mounts
<-- 230-        /private/       - Private content
<-- 230-        /pub/           - Public content
<-- 230-
<-- 230-
<-- 230-Site activity:
<-- 230-
<-- 230-        Users online    : [0-9]+
<-- 230-        Active transfers: [0-9]+
<-- 230-
<-- 230-Enjoy your stay.
<-- 230 User anonymous logged in.
--> TYPE I
<-- 200 Type set to I.
--> PASV
<-- 227 Entering Passive Mode \([0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+\)
<-- 150 Opening BINARY mode data connection for README.
this tarball should be uncompressed into the root of the ioFTPD
server you intend to test.  it is designed to test the default
ioFTPD configuration, so make sure you haven't made any
configuration changes before running this test suite.
<-- 226 Transfer complete.
--> QUIT
<-- 221 Come back soon!
the test framework sends lines that start with '-->' to the ftp server, and compares what it gets back against the lines starting with '<--' in the baseline.

with the test suite i've got, i can unzip the files in the root of the ftp server and run the tests against the now configured "test" server. overall, it works pretty well. the one *major* problem is that the test suite currently runs on linux, as i had a bunch of tools developed for linux that i could leverage.

i'd like this to be something i can publish to the community so i can add user-contributed tests to the test suite. this would be especially useful when reporting problems... if it can be recreated it can be fixed.

what is the interest in writing tests? is the fact that the test suite runs on linux a problem? let me know what you think of the idea, i'm sure i didn't do it justice with the quick description.

please direct all comments to the comment thread.
_panic_ is offline