diff options
author | stbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9> | 2015-09-18 15:15:18 +0000 |
---|---|---|
committer | stbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9> | 2015-09-18 15:15:18 +0000 |
commit | 8b2630a82fbecfd57fa38aebb397a755936690e5 (patch) | |
tree | a9cfcd7bb5bea87d63fc8ef81c8456a130a249bc /tests/mod-proxy.t.deprecated | |
parent | e57c8295ebe92b58ca3e68fa8ea8f70d4b0b4cee (diff) | |
download | lighttpd-master.tar.gz |
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@3041 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/mod-proxy.t.deprecated')
-rw-r--r-- | tests/mod-proxy.t.deprecated | 175 |
1 files changed, 0 insertions, 175 deletions
diff --git a/tests/mod-proxy.t.deprecated b/tests/mod-proxy.t.deprecated deleted file mode 100644 index dc161726..00000000 --- a/tests/mod-proxy.t.deprecated +++ /dev/null @@ -1,175 +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 => 21; -use LightyTest; - -my $tf_proxy = LightyTest->new(); -my $tf_backend1 = LightyTest->new(); -my $tf_backend2 = LightyTest->new(); - -my $t; - -## we need two procs -## 1. the real webserver -## 2. the proxy server - -SKIP: { - skip "disabled for now", 21; -$tf_proxy->{PORT} = 2048; -$tf_proxy->{CONFIGFILE} = 'proxy.conf'; -$tf_proxy->{LIGHTTPD_PIDFILE} = $tf_proxy->{SRCDIR}.'/tmp/lighttpd/lighttpd-proxy.pid'; - -$tf_backend1->{PORT} = 2050; -$tf_backend1->{CONFIGFILE} = 'proxy-backend-1.conf'; -$tf_backend1->{LIGHTTPD_PIDFILE} = $tf_backend1->{SRCDIR}.'/tmp/lighttpd/lighttpd-backend-1.pid'; - -$tf_backend2->{PORT} = 2051; -$tf_backend2->{CONFIGFILE} = 'proxy-backend-2.conf'; -$tf_backend2->{LIGHTTPD_PIDFILE} = $tf_backend2->{SRCDIR}.'/tmp/lighttpd/lighttpd-backend-2.pid'; - - -ok($tf_backend1->start_proc == 0, "Starting lighttpd") or die(); - -ok($tf_proxy->start_proc == 0, "Starting lighttpd as proxy") or die(); - -sleep(1); - -$t->{REQUEST} = ( <<EOF -GET /index.html HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; -ok($tf_proxy->handle_http($t) == 0, 'valid request'); - -$t->{REQUEST} = ( <<EOF -GET /index.html HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Server' => 'proxy-backend-1' } ]; -ok($tf_proxy->handle_http($t) == 0, 'drop Server from real server'); - -$t->{REQUEST} = ( <<EOF -GET /balance-rr/foo HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-1' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance rr - one backend'); - -$t->{REQUEST} = ( <<EOF -GET /balance-rr/foo HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-1' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance rr - one host down, failover'); - -$t->{REQUEST} = ( <<EOF -GET /balance-fair/foo HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-1' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance fair - one backend'); - -## backend 2 starting -ok($tf_backend2->start_proc == 0, "Starting second proxy backend") or die(); - -$t->{REQUEST} = ( <<EOF -GET /balance-rr/foo HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-2' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance rr - lb, backend 1'); - -$t->{REQUEST} = ( <<EOF -GET /balance-rr/foo HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-1' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance rr - lb, backend 2'); - -$t->{REQUEST} = ( <<EOF -GET /balance-hash/foo HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-1' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance hash - lb, backend 1'); - -$t->{REQUEST} = ( <<EOF -GET /balance-hash/foo HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-1' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance hash - lb, backend 1 - same URL'); - -$t->{REQUEST} = ( <<EOF -GET /balance-hash/bar HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-2' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance hash - lb, backend 2'); - -$t->{REQUEST} = ( <<EOF -GET /balance-hash/bar HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-2' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance hash - lb, backend 2 - same URL'); - -## backend 1 stopping, failover -ok($tf_backend1->stop_proc == 0, "Stopping backend 1"); - -$t->{REQUEST} = ( <<EOF -GET /balance-hash/foo HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-2' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance hash - failover to backend 2'); - -$t->{REQUEST} = ( <<EOF -GET /balance-hash/bar HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-2' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance hash - failover to backend 2 - same URL'); - -$t->{REQUEST} = ( <<EOF -GET /balance-rr/foo HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-2' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance rr - failover to backend 2'); - -$t->{REQUEST} = ( <<EOF -GET /balance-fair/foo HTTP/1.0 -Host: www.example.org -EOF - ); -$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'Server' => 'proxy-backend-2' } ]; -ok($tf_proxy->handle_http($t) == 0, 'balance fair - failover to backend 2'); - - -ok($tf_backend2->stop_proc == 0, "Stopping lighttpd"); - -ok($tf_proxy->stop_proc == 0, "Stopping lighttpd proxy"); -} |