3 # add current source dir to the include-path
4 # we need this for make distcheck
5 (my $srcdir = $0) =~ s
,/[^/]+$,/,;
11 use Test
::More tests
=> 17;
14 my $tf = LightyTest
->new();
17 $ENV{"env_test"} = "good_env";
19 $tf->{CONFIGFILE
} = 'var-include.conf';
21 ok
($tf->start_proc == 0, "Starting lighttpd") or die();
23 $t->{REQUEST
} = ( "GET /index.html HTTP/1.0\r\nHost: www.example.org\r\n" );
24 $t->{RESPONSE
} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => "/redirect" } ];
25 ok
($tf->handle_http($t) == 0, 'basic test');
28 my $server_name = "test.example.org";
32 "include" => "/good_include",
33 "concat" => "/good_" . "concat",
34 "servername1" => "/good_" . $server_name,
35 "servername2" => $server_name . "/good_",
36 "servername3" => "/good_" . $server_name . "/",
37 "var.myvar" => "/good_var_myvar" . $myvar,
38 "myvar" => "/good_myvar" . $myvar,
39 "env" => "/" . $ENV{"env_test"},
41 "number1" => "/good_number" . "1",
42 "number2" => "1" . "/good_number",
43 "array_append" => "/good_array_append",
44 "string_append" => "/good_" . $mystr,
45 "number_append" => "/good_" . "2",
47 "include_shell" => "/good_include_shell_" . "456"
50 foreach my $test (keys %{ $tests }) {
51 my $expect = $tests->{$test};
52 $t->{REQUEST
} = ( <<EOF
57 $t->{RESPONSE
} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => $expect } ];
58 ok
($tf->handle_http($t) == 0, $test);
61 ok
($tf->stop_proc == 0, "Stopping lighttpd");