cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: RTSP support for libcurl, preview patch for comments

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 21 Jan 2010 10:31:00 +0100 (CET)

On Wed, 20 Jan 2010, Chris Conroy wrote:

> As for unit tests, I probably spent far too long trying fighting the test
> framework to no avail. A lot of it is pretty protocol-centric and I'm not
> much of a perl hacker. At first I figured I could just crib from the HTTP
> tests and tell it to use RTSP instead, but it turns out the test backend
> doesn't quite work that way..

The test suite pretty much works like this:

A raw and basic server for the prtocol is started. It is there to respond to
basic commands and to allow itself to get controlled to change behavior in
order to provide various test aspects. The test script then runs a given
command that uses this server, and then in the end it verifies that the
outputs and protocol parts etc all matched the way the test case says they
should look like.

For HTTP we have the 'sws' server to server simple HTTP. In order to support
somewhat complex things such as PUT, POST and multi-pass authentications it
has some specific HTTP knowledge but otherwise it mostly just serves the exact
content the test case tells it to.

> Unless I'm missing something, it seems like the SWS code will need to be
> modified to support RTSP. However, perhaps the more general ping-pong
> framework would suffice?

Given that RTSP is more like HTTP than the pingpong protocols (FTP, IMAP,
POP3, SMTP) I would assume that extending sws to provide an RTSP-mode would be
the appropriate route forward.

If extending or building on top of sws to create a dual-protocol server turns
out too nasty code-wise, I don't see any problems with simply making a version
of sws into a separate "rtspd" for RTSP and then basicaly handicraft that to
just do RTSP for the test suite purposes.

> P.S. While I'm on the subject. My autotools-fu is not that great, and in
> trying to make some test cases I found that to add one to the project I
> need to make distclean, buildconf, make curl, then make test. Is there
> any way to just re-run the buildconf for the tests/ directory only?

Let me give you the lengty explanation here too:

In order to just add a test case that uses the curl command line tool, you
just need to add a "test/data/testXXXX" file and then you can run the test
with "cd tests && ./runtests.pl XXXX". No need to make or buildconf anything.
I tend to just 'cd tests' and then run the individual tests in there while
working with specific tests or protocols to make sure that each works fine.

If you do a libcurl-test in the libtest/ dir, then you need to make sure that
is built before you can run it and then of course you need to 'make' to get it
built.

If you modify the test server code or have change the libcurl code and wants
to re-run all tests, then you 'make' in the tests dir before you ./runtests.pl
again.

In general, if you use configure's --enable-maintainer-mode among the
configure options you will also see that 'make' will rerun the autotool magic
pretty much automatically when you've modified the autotool input files.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-01-21