summaryrefslogtreecommitdiff
path: root/APACHE_1_3_42/src/test/vhtest/README
blob: e5b422201a7bdd1f5d4cd7f43565d723796bc460 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
This is a basic test of the virtual host functionality.

At present it *does not test*:

- ServerPath
- <VirtualHost> DNS lookups (specifically, multiple A records is interesting)

It does test the basic gear that uses ip addresses and ports to decide what
ip-vhost or set of name-vhosts are to be considered.  It tests _default_
behaviour with both explicit and wildcard ports.  It tests the precedence
behaviour -- i.e. earlier vhosts have higher precedence than later vhosts.
It has a basic ServerAlias test.

It also tests some error conditions.

These tests are "white box" tests, i.e. I know how the code is written and
I'm testing very specific cases within the code.  Black box tests would
be nice too.

To use:

    perl -pi.orig -e "s#/home/dgaudet/ap/vhtest#`pwd`#" conf/*.conf
    ./runtest /path/to/httpd

Or to run a specific test:

    ./runtest /path/to/httpd test3

The output looks something like:

127.0.0.1:8080       ''                   'vhost1'       : passed
127.0.0.1:8080       'vhost1:8080'        'vhost1'       : passed
127.0.0.1:8080       'vhost2:8080'        'vhost1'       : passed
127.0.0.1:8081       ''                   'vhost2'       : passed
127.0.0.1:8081       'vhost2:8081'        'vhost2'       : passed
127.0.0.1:8081       'vhost1:8081'        'vhost2'       : passed
127.0.0.2:8080       ''                   'vhost3'       : passed

The first column is the ipaddr:port connected to.  The second column is
the Host: header sent ('' means no Host: header sent).  The third column
is the vhost expected.

It probably only works on Linux because it uses the loopback interface for
all tests -- and Linux lo0 responds to *all* addresses in 127/8 rather than
just 127.0.0.1.  You'd probably have to add the following aliases to other
boxes:

    127.0.0.2
    127.0.0.3
    127.0.0.4
    127.0.0.5

Dean