summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2018-12-03 01:26:20 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2018-12-03 23:03:04 -0500
commit8aad0916137df6a6a45025f507425c777893834a (patch)
tree724a4a26fc33d757e461b47a39184fa3b5a77d2f /tests
parent5299bded323623aa4b501276384daed0cf9e862d (diff)
downloadlighttpd1.4-8aad0916137df6a6a45025f507425c777893834a.tar.gz
lighttpd1.4-8aad0916137df6a6a45025f507425c777893834a.zip
[mod_evhost] t/test_mod_evhost
create t/test_mod_evhost to test mod_evhost basic logic remove tests/mod-evhost.t
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/mod-evhost.conf47
-rwxr-xr-xtests/mod-evhost.t63
-rwxr-xr-xtests/prepare.sh6
4 files changed, 1 insertions, 117 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7f1f1663..b680ef23 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -42,8 +42,6 @@ CONFS=\
mod-cgi.t \
mod-compress.conf \
mod-compress.t \
- mod-evhost.conf \
- mod-evhost.t \
mod-extforward.conf \
mod-extforward.t \
mod-fastcgi.t \
diff --git a/tests/mod-evhost.conf b/tests/mod-evhost.conf
deleted file mode 100644
index a7a7b079..00000000
--- a/tests/mod-evhost.conf
+++ /dev/null
@@ -1,47 +0,0 @@
-server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/evhost"
-server.pid-file = env.SRCDIR + "/tmp/lighttpd/lighttpd.pid"
-
-## bind to port (default: 80)
-server.port = 2048
-
-## bind to localhost (default: all interfaces)
-server.bind = "localhost"
-server.name = "www.example.org"
-server.tag = "Proxy"
-server.errorlog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.error.log"
-server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.log"
-accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
-
-server.modules = (
- "mod_evhost",
- "mod_accesslog" )
-
-server.indexfiles = ( "index.html" )
-
-
-######################## MODULE CONFIG ############################
-
-
-#### mod-evhost
-$HTTP["host"] =~ "evhost1.example.org" {
- evhost.path-pattern = env.SRCDIR + "/tmp/lighttpd/servers/evhost/%{3.1}/%{3.2}/%3/pages/"
-}
-
-else $HTTP["host"] =~ "evhost2.example.org" {
- evhost.path-pattern = env.SRCDIR + "/tmp/lighttpd/servers/evhost/%3/pages/"
-}
-
-else $HTTP["host"] =~ "evhost3.example.org" {
- evhost.path-pattern = env.SRCDIR + "/tmp/lighttpd/servers/evhost/%{3.0}/pages/"
-}
-
-else $HTTP["host"] =~ "evhost4.example.org" {
- evhost.path-pattern = env.SRCDIR + "/tmp/lighttpd/servers/evhost/%3.\1/pages/"
-}
-
-else $HTTP["host"] =~ "evhost5.example.org" {
- evhost.path-pattern = env.SRCDIR + "/tmp/lighttpd/servers/evhost/%3.\1/pages/"
-}
-else $HTTP["host"] =~ "evhost.example.org" {
- url.access-deny = ("")
-}
diff --git a/tests/mod-evhost.t b/tests/mod-evhost.t
deleted file mode 100755
index 4deea805..00000000
--- a/tests/mod-evhost.t
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env perl
-BEGIN {
- # add current source dir to the include-path
- # we need this for make distcheck
- (my $srcdir = $0) =~ s#/[^/]+$#/#;
- unshift @INC, $srcdir;
-}
-
-use strict;
-use IO::Socket;
-use Test::More tests => 7;
-use LightyTest;
-
-my $tf = LightyTest->new();
-$tf->{CONFIGFILE} = 'mod-evhost.conf';
-my $t;
-
-ok($tf->start_proc == 0, "Starting lighttpd") or die();
-
-# test for correct config
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-Host: evhost1.example.org
-EOF
- );
-ok($tf->handle_http($t) == 0, 'correct pattern using dot notation');
-
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
-$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-Host: evhost2.example.org
-EOF
- );
-ok($tf->handle_http($t) == 0, 'correct pattern not using dot notation');
-
-# test for broken config
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
-$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-Host: evhost3.example.org
-EOF
- );
-ok($tf->handle_http($t) == 0, 'broken pattern 1');
-
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
-$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-Host: evhost4.example.org
-EOF
- );
-ok($tf->handle_http($t) == 0, 'broken pattern 2');
-
-$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
-$t->{REQUEST} = ( <<EOF
-GET /index.html HTTP/1.0
-Host: evhost5.example.org
-EOF
- );
-ok($tf->handle_http($t) == 0, 'broken pattern 3');
-
-ok($tf->stop_proc == 0, "Stopping lighttpd");
-
diff --git a/tests/prepare.sh b/tests/prepare.sh
index f4f11ef8..32dd2b8f 100755
--- a/tests/prepare.sh
+++ b/tests/prepare.sh
@@ -23,8 +23,6 @@ mkdir -p "${tmpdir}/servers/www.example.org/pages/indexfile/"
mkdir -p "${tmpdir}/servers/123.example.org/pages/"
mkdir -p "${tmpdir}/servers/a.example.org/pages/a/"
mkdir -p "${tmpdir}/servers/b.example.org/pages/b/"
-mkdir -p "${tmpdir}/servers/evhost/e/v/evhost1/pages"
-mkdir -p "${tmpdir}/servers/evhost/evhost2/pages"
mkdir -p "${tmpdir}/logs/"
mkdir -p "${tmpdir}/cache/"
mkdir -p "${tmpdir}/cache/compress/"
@@ -52,9 +50,7 @@ touch "${tmpdir}/servers/www.example.org/pages/image.jpg" \
"${tmpdir}/servers/www.example.org/pages/image.JPG" \
"${tmpdir}/servers/www.example.org/pages/Foo.txt" \
"${tmpdir}/servers/www.example.org/pages/a" \
- "${tmpdir}/servers/www.example.org/pages/index.html~" \
- "${tmpdir}/servers/evhost/e/v/evhost1/pages/index.html" \
- "${tmpdir}/servers/evhost/evhost2/pages/index.html"
+ "${tmpdir}/servers/www.example.org/pages/index.html~"
echo "12345" > "${tmpdir}/servers/www.example.org/pages/range.pdf"
printf "%-40s" "preparing infrastructure"