From 18ec4f419ccea116ae1833b27b19087cb21876b5 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Thu, 26 Aug 2021 01:25:19 -0400 Subject: [tests] move tests/docroot/www contents up 1 level reduce directories under tests (because automake is sloooow and the fewer dirs, the better) --- configure.ac | 1 - tests/docroot/404.html | 1 + tests/docroot/404.pl | 46 +++++++++++++++ tests/docroot/Makefile.am | 12 +++- tests/docroot/cgi.pl | 73 +++++++++++++++++++++++ tests/docroot/exec-date.shtml | 1 + tests/docroot/index.html | 113 ++++++++++++++++++++++++++++++++++++ tests/docroot/index.txt | 113 ++++++++++++++++++++++++++++++++++++ tests/docroot/prefix.fcgi | 1 + tests/docroot/ssi-include.shtml | 5 ++ tests/docroot/ssi-include.txt | 1 + tests/docroot/ssi.shtml | 1 + tests/docroot/www/404.html | 1 - tests/docroot/www/404.pl | 46 --------------- tests/docroot/www/Makefile.am | 11 ---- tests/docroot/www/cgi.pl | 73 ----------------------- tests/docroot/www/exec-date.shtml | 1 - tests/docroot/www/index.html | 113 ------------------------------------ tests/docroot/www/index.txt | 113 ------------------------------------ tests/docroot/www/prefix.fcgi | 1 - tests/docroot/www/ssi-include.shtml | 5 -- tests/docroot/www/ssi-include.txt | 1 - tests/docroot/www/ssi.shtml | 1 - tests/prepare.sh | 10 ++-- 24 files changed, 371 insertions(+), 373 deletions(-) create mode 100644 tests/docroot/404.html create mode 100755 tests/docroot/404.pl create mode 100755 tests/docroot/cgi.pl create mode 100644 tests/docroot/exec-date.shtml create mode 100644 tests/docroot/index.html create mode 100644 tests/docroot/index.txt create mode 100644 tests/docroot/prefix.fcgi create mode 100644 tests/docroot/ssi-include.shtml create mode 100644 tests/docroot/ssi-include.txt create mode 100644 tests/docroot/ssi.shtml delete mode 100644 tests/docroot/www/404.html delete mode 100755 tests/docroot/www/404.pl delete mode 100644 tests/docroot/www/Makefile.am delete mode 100755 tests/docroot/www/cgi.pl delete mode 100644 tests/docroot/www/exec-date.shtml delete mode 100644 tests/docroot/www/index.html delete mode 100644 tests/docroot/www/index.txt delete mode 100644 tests/docroot/www/prefix.fcgi delete mode 100644 tests/docroot/www/ssi-include.shtml delete mode 100644 tests/docroot/www/ssi-include.txt delete mode 100644 tests/docroot/www/ssi.shtml diff --git a/configure.ac b/configure.ac index 793ec82e..9bdf9773 100644 --- a/configure.ac +++ b/configure.ac @@ -1696,7 +1696,6 @@ AC_CONFIG_FILES([\ Makefile \ src/Makefile \ tests/docroot/Makefile \ - tests/docroot/www/Makefile \ tests/Makefile \ ]) AC_OUTPUT diff --git a/tests/docroot/404.html b/tests/docroot/404.html new file mode 100644 index 00000000..ce72e899 --- /dev/null +++ b/tests/docroot/404.html @@ -0,0 +1 @@ +static not found diff --git a/tests/docroot/404.pl b/tests/docroot/404.pl new file mode 100755 index 00000000..eb5df2ee --- /dev/null +++ b/tests/docroot/404.pl @@ -0,0 +1,46 @@ +#!/usr/bin/env perl + +my $request_uri = $ENV{'REQUEST_URI'}; + +if ($request_uri =~ m/^\/dynamic\/200\// ) { + print "Status: 200\n", + "Content-Type: text/plain\n", + "\n", + "found here\n"; +} +elsif ($request_uri =~ m|^/dynamic/302/| ) { + print "Status: 302\n", + "Location: http://www.example.org/\n", + "\n"; +} +elsif ($request_uri =~ m/^\/dynamic\/404\// ) { + print "Status: 404\n", + "Content-Type: text/plain\n", + "\n", + "Not found here\n"; +} +elsif ($request_uri =~ m/^\/send404\.pl/ ) { + print "Status: 404\n", + "Content-Type: text/plain\n", + "\n", + "Not found here (send404)\n"; +} +elsif ($request_uri =~ m/^\/dynamic\/nostatus\// ) { + print ("found here\n"); +} +elsif ($request_uri =~ m/^\/dynamic\/redirect_status\// ) { + print "Status: $ENV{'REDIRECT_STATUS'}\n", + "Content-Type: text/plain\n", + "\n", + "REDIRECT_STATUS\n"; +} +elsif ($ENV{PATH_INFO} eq "/internal-redir" ) { + # (not actually 404 error, but use separate script from cgi.pl for testing) + print "Status: 200\r\n\r\n"; +} +else { + print "Status: 500\n", + "Content-Type: text/plain\n", + "\n", + "huh\n"; +}; diff --git a/tests/docroot/Makefile.am b/tests/docroot/Makefile.am index d86055d8..f99830c7 100644 --- a/tests/docroot/Makefile.am +++ b/tests/docroot/Makefile.am @@ -1,2 +1,12 @@ -SUBDIRS=www GNUMAKEFLAGS=--no-print-directory -s +EXTRA_DIST=\ + 404.html \ + 404.pl \ + cgi.pl \ + exec-date.shtml \ + index.html \ + index.txt \ + prefix.fcgi \ + ssi-include.shtml \ + ssi-include.txt \ + ssi.shtml diff --git a/tests/docroot/cgi.pl b/tests/docroot/cgi.pl new file mode 100755 index 00000000..97e00d31 --- /dev/null +++ b/tests/docroot/cgi.pl @@ -0,0 +1,73 @@ +#!/usr/bin/env perl + +# env +if ($ENV{"QUERY_STRING"} =~ /^env=(\w+)/) { + print "Status: 200\r\n\r\n$ENV{$1}"; + exit 0; +} + +# redirection +if ($ENV{"QUERY_STRING"} eq "internal-redir") { + # (not actually 404 error, but use separate script from cgi.pl for testing) + print "Location: /404.pl/internal-redir\r\n\r\n"; + exit 0; +} + +# redirection +if ($ENV{"QUERY_STRING"} eq "external-redir") { + print "Location: http://www.example.org:2048/\r\n\r\n"; + exit 0; +} + +# 404 +if ($ENV{"QUERY_STRING"} eq "send404") { + print "Status: 404\n\nsend404\n"; + exit 0; +} + +# X-Sendfile +if ($ENV{"QUERY_STRING"} eq "xsendfile") { + # urlencode path for CGI header + # (including urlencode ',' if in path, for X-Sendfile2 w/ FastCGI (not CGI)) + # (This implementation is not minimal encoding; + # encode everything that is not alphanumeric, '.' '_', '-', '/') + require Cwd; + my $path = Cwd::getcwd() . "/index.txt"; + $path =~ s#([^\w./-])#"%".unpack("H2",$1)#eg; + + print "Status: 200\r\n"; + print "X-Sendfile: $path\r\n\r\n"; + exit 0; +} + +# NPH +if ($ENV{"QUERY_STRING"} =~ /^nph=(\w+)/) { + print "Status: $1 FooBar\r\n\r\n"; + exit 0; +} + +# crlfcrash +if ($ENV{"QUERY_STRING"} eq "crlfcrash") { + print "Location: http://www.example.org/\r\n\n\n"; + exit 0; +} + +# POST length +if ($ENV{"QUERY_STRING"} eq "post-len") { + $cl = $ENV{CONTENT_LENGTH} || 0; + my $len = 0; + if ($ENV{"REQUEST_METHOD"} eq "POST") { + while (<>) { # expect test data to end in newline + $len += length($_); + last if $len >= $cl; + } + } + print "Status: 200\r\n\r\n$len"; + exit 0; +} + +# default +print "Content-Type: text/plain\r\n\r\n"; +print $ENV{"QUERY_STRING"}; + +0; diff --git a/tests/docroot/exec-date.shtml b/tests/docroot/exec-date.shtml new file mode 100644 index 00000000..2c8535bc --- /dev/null +++ b/tests/docroot/exec-date.shtml @@ -0,0 +1 @@ + diff --git a/tests/docroot/index.html b/tests/docroot/index.html new file mode 100644 index 00000000..3c149671 --- /dev/null +++ b/tests/docroot/index.html @@ -0,0 +1,113 @@ + + + +Webserver testpage + + + + + + + + + + + + + + + + + + + + + + + + +
    +
+ +++ testinfo - webserver +++ +
+
  +
+ This is only a test page for the webserver!
+ SuSE is not responsible for the contents of this domain! +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
   
system information + + Operating system: [ SuSE Linux 8.0 (i386) + ]
+ Host: [ grisu.home.kneschke.de, Kernel: 2.4.18-4GB (i686) + ] +
+
  
webserver and modules + + Webserver version:
+ [ lighttpd/0.1.0 (Unix) ]

+ + Installed modules:
+ [ PHP module is not installed ]
+ [ Apache perl module (mod_perl) is not installed ]
+ [ Apache DAV module (mod_dav) is not installed ]
+ [ Apache Python module (mod_python) is not installed ]
+ +
+
  
documentation + +[ This host is not configured as server for the SuSE help system ]

+[ Apache manual is not installed ]
+ +
+ [ The SuSE website ]
+ + + +
+
  
+
 powered by SuSE
+ + + + + + + + + + + + diff --git a/tests/docroot/index.txt b/tests/docroot/index.txt new file mode 100644 index 00000000..3c149671 --- /dev/null +++ b/tests/docroot/index.txt @@ -0,0 +1,113 @@ + + + +Webserver testpage + + + + + + + + + + + + + + + + + + + + + + + + +
    +
+ +++ testinfo - webserver +++ +
+
  +
+ This is only a test page for the webserver!
+ SuSE is not responsible for the contents of this domain! +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
   
system information + + Operating system: [ SuSE Linux 8.0 (i386) + ]
+ Host: [ grisu.home.kneschke.de, Kernel: 2.4.18-4GB (i686) + ] +
+
  
webserver and modules + + Webserver version:
+ [ lighttpd/0.1.0 (Unix) ]

+ + Installed modules:
+ [ PHP module is not installed ]
+ [ Apache perl module (mod_perl) is not installed ]
+ [ Apache DAV module (mod_dav) is not installed ]
+ [ Apache Python module (mod_python) is not installed ]
+ +
+
  
documentation + +[ This host is not configured as server for the SuSE help system ]

+[ Apache manual is not installed ]
+ +
+ [ The SuSE website ]
+ + + +
+
  
+
 powered by SuSE
+ + + + + + + + + + + + diff --git a/tests/docroot/prefix.fcgi b/tests/docroot/prefix.fcgi new file mode 100644 index 00000000..f091de63 --- /dev/null +++ b/tests/docroot/prefix.fcgi @@ -0,0 +1 @@ +# (file exists for mod-fastcgi.t test case) diff --git a/tests/docroot/ssi-include.shtml b/tests/docroot/ssi-include.shtml new file mode 100644 index 00000000..317c6e3a --- /dev/null +++ b/tests/docroot/ssi-include.shtml @@ -0,0 +1,5 @@ + + + + + diff --git a/tests/docroot/ssi-include.txt b/tests/docroot/ssi-include.txt new file mode 100644 index 00000000..3ea09a82 --- /dev/null +++ b/tests/docroot/ssi-include.txt @@ -0,0 +1 @@ +ssi-include diff --git a/tests/docroot/ssi.shtml b/tests/docroot/ssi.shtml new file mode 100644 index 00000000..473c5c65 --- /dev/null +++ b/tests/docroot/ssi.shtml @@ -0,0 +1 @@ + diff --git a/tests/docroot/www/404.html b/tests/docroot/www/404.html deleted file mode 100644 index ce72e899..00000000 --- a/tests/docroot/www/404.html +++ /dev/null @@ -1 +0,0 @@ -static not found diff --git a/tests/docroot/www/404.pl b/tests/docroot/www/404.pl deleted file mode 100755 index eb5df2ee..00000000 --- a/tests/docroot/www/404.pl +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env perl - -my $request_uri = $ENV{'REQUEST_URI'}; - -if ($request_uri =~ m/^\/dynamic\/200\// ) { - print "Status: 200\n", - "Content-Type: text/plain\n", - "\n", - "found here\n"; -} -elsif ($request_uri =~ m|^/dynamic/302/| ) { - print "Status: 302\n", - "Location: http://www.example.org/\n", - "\n"; -} -elsif ($request_uri =~ m/^\/dynamic\/404\// ) { - print "Status: 404\n", - "Content-Type: text/plain\n", - "\n", - "Not found here\n"; -} -elsif ($request_uri =~ m/^\/send404\.pl/ ) { - print "Status: 404\n", - "Content-Type: text/plain\n", - "\n", - "Not found here (send404)\n"; -} -elsif ($request_uri =~ m/^\/dynamic\/nostatus\// ) { - print ("found here\n"); -} -elsif ($request_uri =~ m/^\/dynamic\/redirect_status\// ) { - print "Status: $ENV{'REDIRECT_STATUS'}\n", - "Content-Type: text/plain\n", - "\n", - "REDIRECT_STATUS\n"; -} -elsif ($ENV{PATH_INFO} eq "/internal-redir" ) { - # (not actually 404 error, but use separate script from cgi.pl for testing) - print "Status: 200\r\n\r\n"; -} -else { - print "Status: 500\n", - "Content-Type: text/plain\n", - "\n", - "huh\n"; -}; diff --git a/tests/docroot/www/Makefile.am b/tests/docroot/www/Makefile.am deleted file mode 100644 index 41411e82..00000000 --- a/tests/docroot/www/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -EXTRA_DIST=\ - 404.html \ - 404.pl \ - cgi.pl \ - exec-date.shtml \ - index.html \ - index.txt \ - prefix.fcgi \ - ssi-include.shtml \ - ssi-include.txt \ - ssi.shtml diff --git a/tests/docroot/www/cgi.pl b/tests/docroot/www/cgi.pl deleted file mode 100755 index 97e00d31..00000000 --- a/tests/docroot/www/cgi.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env perl - -# env -if ($ENV{"QUERY_STRING"} =~ /^env=(\w+)/) { - print "Status: 200\r\n\r\n$ENV{$1}"; - exit 0; -} - -# redirection -if ($ENV{"QUERY_STRING"} eq "internal-redir") { - # (not actually 404 error, but use separate script from cgi.pl for testing) - print "Location: /404.pl/internal-redir\r\n\r\n"; - exit 0; -} - -# redirection -if ($ENV{"QUERY_STRING"} eq "external-redir") { - print "Location: http://www.example.org:2048/\r\n\r\n"; - exit 0; -} - -# 404 -if ($ENV{"QUERY_STRING"} eq "send404") { - print "Status: 404\n\nsend404\n"; - exit 0; -} - -# X-Sendfile -if ($ENV{"QUERY_STRING"} eq "xsendfile") { - # urlencode path for CGI header - # (including urlencode ',' if in path, for X-Sendfile2 w/ FastCGI (not CGI)) - # (This implementation is not minimal encoding; - # encode everything that is not alphanumeric, '.' '_', '-', '/') - require Cwd; - my $path = Cwd::getcwd() . "/index.txt"; - $path =~ s#([^\w./-])#"%".unpack("H2",$1)#eg; - - print "Status: 200\r\n"; - print "X-Sendfile: $path\r\n\r\n"; - exit 0; -} - -# NPH -if ($ENV{"QUERY_STRING"} =~ /^nph=(\w+)/) { - print "Status: $1 FooBar\r\n\r\n"; - exit 0; -} - -# crlfcrash -if ($ENV{"QUERY_STRING"} eq "crlfcrash") { - print "Location: http://www.example.org/\r\n\n\n"; - exit 0; -} - -# POST length -if ($ENV{"QUERY_STRING"} eq "post-len") { - $cl = $ENV{CONTENT_LENGTH} || 0; - my $len = 0; - if ($ENV{"REQUEST_METHOD"} eq "POST") { - while (<>) { # expect test data to end in newline - $len += length($_); - last if $len >= $cl; - } - } - print "Status: 200\r\n\r\n$len"; - exit 0; -} - -# default -print "Content-Type: text/plain\r\n\r\n"; -print $ENV{"QUERY_STRING"}; - -0; diff --git a/tests/docroot/www/exec-date.shtml b/tests/docroot/www/exec-date.shtml deleted file mode 100644 index 2c8535bc..00000000 --- a/tests/docroot/www/exec-date.shtml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/docroot/www/index.html b/tests/docroot/www/index.html deleted file mode 100644 index 3c149671..00000000 --- a/tests/docroot/www/index.html +++ /dev/null @@ -1,113 +0,0 @@ - - - -Webserver testpage - - - - - - - - - - - - - - - - - - - - - - - - -
    -
- +++ testinfo - webserver +++ -
-
  -
- This is only a test page for the webserver!
- SuSE is not responsible for the contents of this domain! -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   
system information - - Operating system: [ SuSE Linux 8.0 (i386) - ]
- Host: [ grisu.home.kneschke.de, Kernel: 2.4.18-4GB (i686) - ] -
-
  
webserver and modules - - Webserver version:
- [ lighttpd/0.1.0 (Unix) ]

- - Installed modules:
- [ PHP module is not installed ]
- [ Apache perl module (mod_perl) is not installed ]
- [ Apache DAV module (mod_dav) is not installed ]
- [ Apache Python module (mod_python) is not installed ]
- -
-
  
documentation - -[ This host is not configured as server for the SuSE help system ]

-[ Apache manual is not installed ]
- -
- [ The SuSE website ]
- - - -
-
  
-
 powered by SuSE
- - - - - - - - - - - - diff --git a/tests/docroot/www/index.txt b/tests/docroot/www/index.txt deleted file mode 100644 index 3c149671..00000000 --- a/tests/docroot/www/index.txt +++ /dev/null @@ -1,113 +0,0 @@ - - - -Webserver testpage - - - - - - - - - - - - - - - - - - - - - - - - -
    -
- +++ testinfo - webserver +++ -
-
  -
- This is only a test page for the webserver!
- SuSE is not responsible for the contents of this domain! -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   
system information - - Operating system: [ SuSE Linux 8.0 (i386) - ]
- Host: [ grisu.home.kneschke.de, Kernel: 2.4.18-4GB (i686) - ] -
-
  
webserver and modules - - Webserver version:
- [ lighttpd/0.1.0 (Unix) ]

- - Installed modules:
- [ PHP module is not installed ]
- [ Apache perl module (mod_perl) is not installed ]
- [ Apache DAV module (mod_dav) is not installed ]
- [ Apache Python module (mod_python) is not installed ]
- -
-
  
documentation - -[ This host is not configured as server for the SuSE help system ]

-[ Apache manual is not installed ]
- -
- [ The SuSE website ]
- - - -
-
  
-
 powered by SuSE
- - - - - - - - - - - - diff --git a/tests/docroot/www/prefix.fcgi b/tests/docroot/www/prefix.fcgi deleted file mode 100644 index f091de63..00000000 --- a/tests/docroot/www/prefix.fcgi +++ /dev/null @@ -1 +0,0 @@ -# (file exists for mod-fastcgi.t test case) diff --git a/tests/docroot/www/ssi-include.shtml b/tests/docroot/www/ssi-include.shtml deleted file mode 100644 index 317c6e3a..00000000 --- a/tests/docroot/www/ssi-include.shtml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/tests/docroot/www/ssi-include.txt b/tests/docroot/www/ssi-include.txt deleted file mode 100644 index 3ea09a82..00000000 --- a/tests/docroot/www/ssi-include.txt +++ /dev/null @@ -1 +0,0 @@ -ssi-include diff --git a/tests/docroot/www/ssi.shtml b/tests/docroot/www/ssi.shtml deleted file mode 100644 index 473c5c65..00000000 --- a/tests/docroot/www/ssi.shtml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/prepare.sh b/tests/prepare.sh index eb6afb2b..e9a97265 100755 --- a/tests/prepare.sh +++ b/tests/prepare.sh @@ -28,11 +28,11 @@ mkdir -p "${tmpdir}/servers/www.example.org/pages/" \ "${tmpdir}/cache/compress/" # copy everything into the right places -cp "${srcdir}/docroot/www/"*.html \ - "${srcdir}/docroot/www/"*.pl \ - "${srcdir}/docroot/www/"*.fcgi \ - "${srcdir}/docroot/www/"*.shtml \ - "${srcdir}/docroot/www/"*.txt \ +cp "${srcdir}/docroot/"*.html \ + "${srcdir}/docroot/"*.pl \ + "${srcdir}/docroot/"*.fcgi \ + "${srcdir}/docroot/"*.shtml \ + "${srcdir}/docroot/"*.txt \ "${tmpdir}/servers/www.example.org/pages/" cp "${srcdir}/lighttpd.user" "${tmpdir}/" cp "${srcdir}/lighttpd.htpasswd" "${tmpdir}/" -- cgit v1.2.1