From: knutroy Date: Tue, 4 Sep 2007 14:00:13 +0000 (+0000) Subject: * Added information about test framework to "Inside Varnish". X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ceb1e5a9894ad97ce0eeea32c2caee8db0f419e;p=varnish * Added information about test framework to "Inside Varnish". git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1936 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-doc/en/inside-varnish/article.xml b/varnish-doc/en/inside-varnish/article.xml index 3b537524..fbda5ceb 100644 --- a/varnish-doc/en/inside-varnish/article.xml +++ b/varnish-doc/en/inside-varnish/article.xml @@ -335,7 +335,76 @@ Request timestamp + proc time + xmit time = Complete timestamp.
The test framework - Lorem ipsum dolor sit amet + The test framework for Varnish consists of a library of Perl + modules organized under Varnish::Test. The + framework works by starting up a Varnish daemon process and + communicating with it while acting as both client and server. The + framework also operates the management command-line interface of + the Varnish daemon. This enables the framework to monitor all + external aspects of the daemon's behavior. + + The test framework contains a set of test-cases, each one + being a Perl module organized under + Varnish::Test::Case. The test-cases are run + sequentially, and each one typically focuses on a specific element + of Varnish's behavior or functionality. If the expectations of a + test-case is not fulfilled by the daemon being tested, the + test-case fails. Only when all test-cases succeeds, the Varnish + daemon may be considered healthy. + + Test-case development is an ongoing process, and anyone is + welcome to contribute test-cases which reveals erroneous behavior + in at least one revision of Varnish. + +
+ I/O-handling + + The test framework is based on a single + select(2)-driven loop, where all relevant + I/O channels are monitored. Activity on the I/O channels is + handled in an event-driven way, so the select loop also works as + an event loop. I/O-events are dispatched and optionally handled + by the running test-case which then decides what to do next. The + event loop may be paused, in order to drive the test processing + flow forward. +
+ +
+ Object structure + + The test framework employs an object-oriented approach and + uses (Perl) objects to represent instances of servers + (Varnish::Test::Server), clients + (Varnish::Test::Client), and HTTP messages + (HTTP::Message). + + Also, the Varnish daemon is represented by an object + (Varnish::Test::Varnish) taking care of the + daemon process which is spawned by the test framework process + before the tests start. + + Additionally, each test-case is represented by its own + object derived from the super-class + Varnish::Test::Case. + + In the center of all the objects stands the engine object + (Varnish::Test::Engine) which coordinates + the communication between the other objects by dispatching and + queuing events. The engine also sets up the + select(2)-loop, using an object instance of + the CPAN module IO::Multiplex. +
+ +
+ Further information + + Consult the POD-based in-source documentation for more + details if you like to get involved in developing test-cases or + improving the framework in general. In that case, prior + experience with Perl as well as a general understanding of + network programming using select(2), is + beneficial. +