diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 08:56:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 08:56:01 +0000 |
commit | 502c540485a1626fce474639d572904a4e3c55fe (patch) | |
tree | c8bb1ed8bda9ce49697a30eaab650191e9462e2a /testenv | |
parent | Adding debian version 1.21.4-1. (diff) | |
download | wget-502c540485a1626fce474639d572904a4e3c55fe.tar.xz wget-502c540485a1626fce474639d572904a4e3c55fe.zip |
Merging upstream version 1.24.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testenv')
-rw-r--r-- | testenv/Makefile.am | 5 | ||||
-rw-r--r-- | testenv/Makefile.in | 133 | ||||
-rwxr-xr-x | testenv/Test-https-k.py | 98 | ||||
-rwxr-xr-x | testenv/Test-k.py | 85 | ||||
-rwxr-xr-x | testenv/Test-recursive-include.py | 67 | ||||
-rw-r--r-- | testenv/conf/expected_files.py | 39 | ||||
-rw-r--r-- | testenv/server/http/http_server.py | 6 | ||||
-rwxr-xr-x | testenv/test_css_url.py | 63 |
8 files changed, 428 insertions, 68 deletions
diff --git a/testenv/Makefile.am b/testenv/Makefile.am index b34dcf3..a592e90 100644 --- a/testenv/Makefile.am +++ b/testenv/Makefile.am @@ -1,5 +1,5 @@ # Makefile for `wget' utility -# Copyright (C) 2013, 2015, 2018-2023 Free Software Foundation, Inc. +# Copyright (C) 2013, 2015, 2018-2024 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -44,6 +44,7 @@ DEFAULT_TESTS = \ Test-condget.py \ Test-Content-disposition-2.py \ Test-Content-disposition.py \ + test_css_url.py \ Test--convert-links--content-on-error.py \ Test-cookie-401.py \ Test-cookie-domain-mismatch.py \ @@ -51,8 +52,10 @@ DEFAULT_TESTS = \ Test-cookie.py \ Test-Head.py \ Test-hsts.py \ + Test-https-k.py \ Test--https.py \ Test--https-crl.py \ + Test-k.py \ Test-missing-scheme-retval.py \ Test-O.py \ Test-pinnedpubkey-der-https.py \ diff --git a/testenv/Makefile.in b/testenv/Makefile.in index 8fcaf3f..2e6c8e2 100644 --- a/testenv/Makefile.in +++ b/testenv/Makefile.in @@ -15,7 +15,7 @@ @SET_MAKE@ # Makefile for `wget' utility -# Copyright (C) 2013, 2015, 2018-2023 Free Software Foundation, Inc. +# Copyright (C) 2013, 2015, 2018-2024 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -125,7 +125,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/arpa_inet_h.m4 \ $(top_srcdir)/m4/asm-underscore.m4 \ $(top_srcdir)/m4/assert_h.m4 $(top_srcdir)/m4/base32.m4 \ - $(top_srcdir)/m4/btowc.m4 $(top_srcdir)/m4/builtin-expect.m4 \ + $(top_srcdir)/m4/btowc.m4 $(top_srcdir)/m4/build-to-host.m4 \ + $(top_srcdir)/m4/builtin-expect.m4 \ $(top_srcdir)/m4/byteswap.m4 $(top_srcdir)/m4/c-bool.m4 \ $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/canonicalize.m4 \ $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/clock_time.m4 \ @@ -173,7 +174,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes.m4 \ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \ $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/iswblank.m4 \ - $(top_srcdir)/m4/iswdigit.m4 $(top_srcdir)/m4/iswxdigit.m4 \ + $(top_srcdir)/m4/iswctype.m4 $(top_srcdir)/m4/iswdigit.m4 \ + $(top_srcdir)/m4/iswpunct.m4 $(top_srcdir)/m4/iswxdigit.m4 \ $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 \ @@ -187,15 +189,16 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ - $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \ - $(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \ - $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/md4.m4 \ - $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \ - $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkdir.m4 \ - $(top_srcdir)/m4/mkostemp.m4 $(top_srcdir)/m4/mkstemp.m4 \ - $(top_srcdir)/m4/mktime.m4 $(top_srcdir)/m4/mmap-anon.m4 \ - $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \ + $(top_srcdir)/m4/mbrtoc32.m4 $(top_srcdir)/m4/mbrtowc.m4 \ + $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \ + $(top_srcdir)/m4/md4.m4 $(top_srcdir)/m4/md5.m4 \ + $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mempcpy.m4 \ + $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/minmax.m4 \ + $(top_srcdir)/m4/mkdir.m4 $(top_srcdir)/m4/mkostemp.m4 \ + $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/mktime.m4 \ + $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \ + $(top_srcdir)/m4/msvc-inval.m4 \ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ $(top_srcdir)/m4/musl.m4 $(top_srcdir)/m4/nanosleep.m4 \ $(top_srcdir)/m4/netdb_h.m4 $(top_srcdir)/m4/netinet_in_h.m4 \ @@ -253,18 +256,19 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/timegm.m4 $(top_srcdir)/m4/timespec.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tmpdir.m4 \ - $(top_srcdir)/m4/ungetc.m4 $(top_srcdir)/m4/unicase_h.m4 \ - $(top_srcdir)/m4/unictype_h.m4 $(top_srcdir)/m4/uninorm_h.m4 \ - $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \ - $(top_srcdir)/m4/unlink.m4 $(top_srcdir)/m4/unlocked-io.m4 \ - $(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utime_h.m4 \ - $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes.m4 \ - $(top_srcdir)/m4/vasnprintf.m4 $(top_srcdir)/m4/vasprintf.m4 \ - $(top_srcdir)/m4/visibility.m4 $(top_srcdir)/m4/vsnprintf.m4 \ - $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \ - $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ - $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ - $(top_srcdir)/m4/wcrtomb.m4 $(top_srcdir)/m4/wctype_h.m4 \ + $(top_srcdir)/m4/uchar_h.m4 $(top_srcdir)/m4/ungetc.m4 \ + $(top_srcdir)/m4/unicase_h.m4 $(top_srcdir)/m4/unictype_h.m4 \ + $(top_srcdir)/m4/uninorm_h.m4 $(top_srcdir)/m4/unistd-safer.m4 \ + $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlink.m4 \ + $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/utime.m4 \ + $(top_srcdir)/m4/utime_h.m4 $(top_srcdir)/m4/utimens.m4 \ + $(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \ + $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/visibility.m4 \ + $(top_srcdir)/m4/vsnprintf.m4 $(top_srcdir)/m4/wait-process.m4 \ + $(top_srcdir)/m4/waitpid.m4 $(top_srcdir)/m4/warn-on-use.m4 \ + $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/m4/wchar_h.m4 \ + $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wcrtomb.m4 \ + $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wctype_h.m4 \ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wget.m4 \ $(top_srcdir)/m4/wget_manywarnings.m4 \ $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/wmemchr.m4 \ @@ -541,6 +545,8 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ +CXX_HAS_CHAR8_TYPE = @CXX_HAS_CHAR8_TYPE@ +CXX_HAS_UCHAR_TYPES = @CXX_HAS_UCHAR_TYPES@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -556,7 +562,6 @@ ENOLINK_VALUE = @ENOLINK_VALUE@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ -ERROR_H = @ERROR_H@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FLOAT_H = @FLOAT_H@ @@ -578,7 +583,33 @@ GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@ GL_GNULIB_ALPHASORT = @GL_GNULIB_ALPHASORT@ GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@ GL_GNULIB_BIND = @GL_GNULIB_BIND@ +GL_GNULIB_BTOC32 = @GL_GNULIB_BTOC32@ GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@ +GL_GNULIB_C32ISALNUM = @GL_GNULIB_C32ISALNUM@ +GL_GNULIB_C32ISALPHA = @GL_GNULIB_C32ISALPHA@ +GL_GNULIB_C32ISBLANK = @GL_GNULIB_C32ISBLANK@ +GL_GNULIB_C32ISCNTRL = @GL_GNULIB_C32ISCNTRL@ +GL_GNULIB_C32ISDIGIT = @GL_GNULIB_C32ISDIGIT@ +GL_GNULIB_C32ISGRAPH = @GL_GNULIB_C32ISGRAPH@ +GL_GNULIB_C32ISLOWER = @GL_GNULIB_C32ISLOWER@ +GL_GNULIB_C32ISPRINT = @GL_GNULIB_C32ISPRINT@ +GL_GNULIB_C32ISPUNCT = @GL_GNULIB_C32ISPUNCT@ +GL_GNULIB_C32ISSPACE = @GL_GNULIB_C32ISSPACE@ +GL_GNULIB_C32ISUPPER = @GL_GNULIB_C32ISUPPER@ +GL_GNULIB_C32ISXDIGIT = @GL_GNULIB_C32ISXDIGIT@ +GL_GNULIB_C32RTOMB = @GL_GNULIB_C32RTOMB@ +GL_GNULIB_C32SNRTOMBS = @GL_GNULIB_C32SNRTOMBS@ +GL_GNULIB_C32SRTOMBS = @GL_GNULIB_C32SRTOMBS@ +GL_GNULIB_C32STOMBS = @GL_GNULIB_C32STOMBS@ +GL_GNULIB_C32SWIDTH = @GL_GNULIB_C32SWIDTH@ +GL_GNULIB_C32TOB = @GL_GNULIB_C32TOB@ +GL_GNULIB_C32TOLOWER = @GL_GNULIB_C32TOLOWER@ +GL_GNULIB_C32TOUPPER = @GL_GNULIB_C32TOUPPER@ +GL_GNULIB_C32WIDTH = @GL_GNULIB_C32WIDTH@ +GL_GNULIB_C32_APPLY_MAPPING = @GL_GNULIB_C32_APPLY_MAPPING@ +GL_GNULIB_C32_APPLY_TYPE_TEST = @GL_GNULIB_C32_APPLY_TYPE_TEST@ +GL_GNULIB_C32_GET_MAPPING = @GL_GNULIB_C32_GET_MAPPING@ +GL_GNULIB_C32_GET_TYPE_TEST = @GL_GNULIB_C32_GET_TYPE_TEST@ GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@ GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@ GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@ @@ -685,6 +716,7 @@ GL_GNULIB_ISBLANK = @GL_GNULIB_ISBLANK@ GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@ GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@ GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@ +GL_GNULIB_ISWPUNCT = @GL_GNULIB_ISWPUNCT@ GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@ GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@ GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@ @@ -692,13 +724,15 @@ GL_GNULIB_LINK = @GL_GNULIB_LINK@ GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@ GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@ GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@ -GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@ +GL_GNULIB_LOCALENAME_UNSAFE = @GL_GNULIB_LOCALENAME_UNSAFE@ GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@ GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@ GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@ GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@ GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@ GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@ +GL_GNULIB_MBRTOC16 = @GL_GNULIB_MBRTOC16@ +GL_GNULIB_MBRTOC32 = @GL_GNULIB_MBRTOC32@ GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@ GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@ GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@ @@ -708,16 +742,20 @@ GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@ GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@ GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@ GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@ +GL_GNULIB_MBSNRTOC32S = @GL_GNULIB_MBSNRTOC32S@ GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@ GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@ GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@ GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@ +GL_GNULIB_MBSRTOC32S = @GL_GNULIB_MBSRTOC32S@ GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@ GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@ GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@ GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@ +GL_GNULIB_MBSTOC32S = @GL_GNULIB_MBSTOC32S@ GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@ GL_GNULIB_MBSTOWCS = @GL_GNULIB_MBSTOWCS@ +GL_GNULIB_MBSZERO = @GL_GNULIB_MBSZERO@ GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@ GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@ GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@ @@ -831,6 +869,7 @@ GL_GNULIB_PUTS = @GL_GNULIB_PUTS@ GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@ GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@ GL_GNULIB_RAISE = @GL_GNULIB_RAISE@ +GL_GNULIB_RAND = @GL_GNULIB_RAND@ GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@ GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@ GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@ @@ -893,6 +932,7 @@ GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@ GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@ GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@ GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@ +GL_GNULIB_STRTOF = @GL_GNULIB_STRTOF@ GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@ GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@ GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@ @@ -1006,6 +1046,9 @@ GL_GNULIB_UNICTYPE_PROPERTY_HYPHEN_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_H GL_GNULIB_UNICTYPE_PROPERTY_IDEOGRAPHIC_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_IDEOGRAPHIC_DLL_VARIABLE@ GL_GNULIB_UNICTYPE_PROPERTY_IDS_BINARY_OPERATOR_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_IDS_BINARY_OPERATOR_DLL_VARIABLE@ GL_GNULIB_UNICTYPE_PROPERTY_IDS_TRINARY_OPERATOR_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_IDS_TRINARY_OPERATOR_DLL_VARIABLE@ +GL_GNULIB_UNICTYPE_PROPERTY_IDS_UNARY_OPERATOR_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_IDS_UNARY_OPERATOR_DLL_VARIABLE@ +GL_GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_CONTINUE_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_CONTINUE_DLL_VARIABLE@ +GL_GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_START_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_START_DLL_VARIABLE@ GL_GNULIB_UNICTYPE_PROPERTY_ID_CONTINUE_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_ID_CONTINUE_DLL_VARIABLE@ GL_GNULIB_UNICTYPE_PROPERTY_ID_START_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_ID_START_DLL_VARIABLE@ GL_GNULIB_UNICTYPE_PROPERTY_IGNORABLE_CONTROL_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_IGNORABLE_CONTROL_DLL_VARIABLE@ @@ -1031,6 +1074,7 @@ GL_GNULIB_UNICTYPE_PROPERTY_PAIRED_PUNCTUATION_DLL_VARIABLE = @GL_GNULIB_UNICTYP GL_GNULIB_UNICTYPE_PROPERTY_PARAGRAPH_SEPARATOR_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_PARAGRAPH_SEPARATOR_DLL_VARIABLE@ GL_GNULIB_UNICTYPE_PROPERTY_PATTERN_SYNTAX_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_PATTERN_SYNTAX_DLL_VARIABLE@ GL_GNULIB_UNICTYPE_PROPERTY_PATTERN_WHITE_SPACE_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_PATTERN_WHITE_SPACE_DLL_VARIABLE@ +GL_GNULIB_UNICTYPE_PROPERTY_PREPENDED_CONCATENATION_MARK_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_PREPENDED_CONCATENATION_MARK_DLL_VARIABLE@ GL_GNULIB_UNICTYPE_PROPERTY_PRIVATE_USE_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_PRIVATE_USE_DLL_VARIABLE@ GL_GNULIB_UNICTYPE_PROPERTY_PUNCTUATION_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_PUNCTUATION_DLL_VARIABLE@ GL_GNULIB_UNICTYPE_PROPERTY_QUOTATION_MARK_DLL_VARIABLE = @GL_GNULIB_UNICTYPE_PROPERTY_QUOTATION_MARK_DLL_VARIABLE@ @@ -1106,6 +1150,7 @@ GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@ GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@ GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@ GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@ +GL_GNULIB_WGETCWD = @GL_GNULIB_WGETCWD@ GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@ GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@ GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@ @@ -1116,8 +1161,10 @@ GL_GNULIB_WRITE = @GL_GNULIB_WRITE@ GL_GNULIB__EXIT = @GL_GNULIB__EXIT@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ +GNULIBHEADERS_OVERRIDE_CHAR16_T = @GNULIBHEADERS_OVERRIDE_CHAR16_T@ +GNULIBHEADERS_OVERRIDE_CHAR32_T = @GNULIBHEADERS_OVERRIDE_CHAR32_T@ +GNULIBHEADERS_OVERRIDE_CHAR8_T = @GNULIBHEADERS_OVERRIDE_CHAR8_T@ GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@ -GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@ GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ GNUTLS_LIBS = @GNUTLS_LIBS@ @@ -1134,6 +1181,7 @@ HAVE_ALPHASORT = @HAVE_ALPHASORT@ HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C32RTOMB = @HAVE_C32RTOMB@ HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ @@ -1267,6 +1315,8 @@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_LSTAT = @HAVE_LSTAT@ HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOC16 = @HAVE_MBRTOC16@ +HAVE_MBRTOC32 = @HAVE_MBRTOC32@ HAVE_MBRTOWC = @HAVE_MBRTOWC@ HAVE_MBSINIT = @HAVE_MBSINIT@ HAVE_MBSLEN = @HAVE_MBSLEN@ @@ -1357,6 +1407,7 @@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOF = @HAVE_STRTOF@ HAVE_STRTOL = @HAVE_STRTOL@ HAVE_STRTOLD = @HAVE_STRTOLD@ HAVE_STRTOLL = @HAVE_STRTOLL@ @@ -1390,6 +1441,7 @@ HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@ HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@ HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ +HAVE_UCHAR_H = @HAVE_UCHAR_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNISTRING_WOE32DLL_H = @HAVE_UNISTRING_WOE32DLL_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ @@ -1442,6 +1494,7 @@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ HAVE_WMEMPCPY = @HAVE_WMEMPCPY@ HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_WORKING_MBRTOC32 = @HAVE_WORKING_MBRTOC32@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__EXIT = @HAVE__EXIT@ @@ -1461,6 +1514,10 @@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LCOV = @LCOV@ +LC_COLLATE_IMPLEMENTED = @LC_COLLATE_IMPLEMENTED@ +LC_MONETARY_IMPLEMENTED = @LC_MONETARY_IMPLEMENTED@ +LC_NUMERIC_IMPLEMENTED = @LC_NUMERIC_IMPLEMENTED@ +LC_TIME_IMPLEMENTED = @LC_TIME_IMPLEMENTED@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -1476,6 +1533,8 @@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPMULTITHREAD = @LIBPMULTITHREAD@ +LIBPROXY_CFLAGS = @LIBPROXY_CFLAGS@ +LIBPROXY_LIBS = @LIBPROXY_LIBS@ LIBPSL_CFLAGS = @LIBPSL_CFLAGS@ LIBPSL_LIBS = @LIBPSL_LIBS@ LIBPTHREAD = @LIBPTHREAD@ @@ -1572,6 +1631,7 @@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_UCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_UTIME_H = @NEXT_AS_FIRST_DIRECTIVE_UTIME_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ @@ -1611,6 +1671,7 @@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UCHAR_H = @NEXT_UCHAR_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_UTIME_H = @NEXT_UTIME_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ @@ -1652,6 +1713,7 @@ RANLIB = @RANLIB@ REPLACE_ACCESS = @REPLACE_ACCESS@ REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@ REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_C32RTOMB = @REPLACE_C32RTOMB@ REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@ REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ @@ -1678,6 +1740,7 @@ REPLACE_EXECVE = @REPLACE_EXECVE@ REPLACE_EXECVP = @REPLACE_EXECVP@ REPLACE_EXECVPE = @REPLACE_EXECVPE@ REPLACE_FACCESSAT = @REPLACE_FACCESSAT@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FCHMODAT = @REPLACE_FCHMODAT@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ @@ -1735,6 +1798,7 @@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@ +REPLACE_ISWPUNCT = @REPLACE_ISWPUNCT@ REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@ REPLACE_ITOLD = @REPLACE_ITOLD@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ @@ -1748,6 +1812,8 @@ REPLACE_LSTAT = @REPLACE_LSTAT@ REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@ REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@ REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOC16 = @REPLACE_MBRTOC16@ +REPLACE_MBRTOC32 = @REPLACE_MBRTOC32@ REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ REPLACE_MBSINIT = @REPLACE_MBSINIT@ REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ @@ -1759,6 +1825,7 @@ REPLACE_MB_CUR_MAX = @REPLACE_MB_CUR_MAX@ REPLACE_MEMCHR = @REPLACE_MEMCHR@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MEMPCPY = @REPLACE_MEMPCPY@ +REPLACE_MEMSET_EXPLICIT = @REPLACE_MEMSET_EXPLICIT@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@ @@ -1797,6 +1864,7 @@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_QSORT_R = @REPLACE_QSORT_R@ REPLACE_RAISE = @REPLACE_RAISE@ +REPLACE_RAND = @REPLACE_RAND@ REPLACE_RANDOM = @REPLACE_RANDOM@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ @@ -1839,6 +1907,7 @@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOF = @REPLACE_STRTOF@ REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRTOL = @REPLACE_STRTOL@ @@ -1849,11 +1918,13 @@ REPLACE_STRTOULL = @REPLACE_STRTOULL@ REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ +REPLACE_STRVERSCMP = @REPLACE_STRVERSCMP@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ REPLACE_TIME = @REPLACE_TIME@ REPLACE_TIMEGM = @REPLACE_TIMEGM@ REPLACE_TIMESPEC_GET = @REPLACE_TIMESPEC_GET@ +REPLACE_TIMESPEC_GETRES = @REPLACE_TIMESPEC_GETRES@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ @@ -1882,6 +1953,8 @@ REPLACE_WCSTOK = @REPLACE_WCSTOK@ REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ REPLACE_WCTOB = @REPLACE_WCTOB@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCTRANS = @REPLACE_WCTRANS@ +REPLACE_WCTYPE = @REPLACE_WCTYPE@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ REPLACE_WMEMCMP = @REPLACE_WMEMCMP@ REPLACE_WMEMPCPY = @REPLACE_WMEMPCPY@ @@ -1896,6 +1969,7 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SMALL_WCHAR_T = @SMALL_WCHAR_T@ STDCKDINT_H = @STDCKDINT_H@ STDDEF_H = @STDDEF_H@ STDINT_H = @STDINT_H@ @@ -1972,6 +2046,8 @@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ +localedir_c = @localedir_c@ +localedir_c_make = @localedir_c_make@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ @@ -2012,6 +2088,7 @@ DEFAULT_TESTS = \ Test-condget.py \ Test-Content-disposition-2.py \ Test-Content-disposition.py \ + test_css_url.py \ Test--convert-links--content-on-error.py \ Test-cookie-401.py \ Test-cookie-domain-mismatch.py \ @@ -2019,8 +2096,10 @@ DEFAULT_TESTS = \ Test-cookie.py \ Test-Head.py \ Test-hsts.py \ + Test-https-k.py \ Test--https.py \ Test--https-crl.py \ + Test-k.py \ Test-missing-scheme-retval.py \ Test-O.py \ Test-pinnedpubkey-der-https.py \ diff --git a/testenv/Test-https-k.py b/testenv/Test-https-k.py new file mode 100755 index 0000000..69b5cd3 --- /dev/null +++ b/testenv/Test-https-k.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python3 + +import os +import platform +from sys import exit + +from test.base_test import HTTPS, SKIP_TEST +from test.http_test import HTTPTest +from misc.wget_file import WgetFile + +""" +Test that Wget handles the --convert-links (-k) option correctly. + +Ensure that when downloading, Wget retains the protocol of the host URL +if the link wasn't followed and an absolute link is to be added to the +local file. +""" + +if os.getenv('SSL_TESTS') is None: + exit(SKIP_TEST) + +############################## File Definitions ############################## + +index = """ +<html> + <head> + <title>Index</title> + </head> + <body> + <a href="sub.html">Site</a> + <a href="missing.xhtml">Missing</a> + <a href="//localhost:{{port}}/missing2.html">Missing2</a> + </body> +</html> +""" + +converted = """ +<html> + <head> + <title>Index</title> + </head> + <body> + <a href="sub.html">Site</a> + <a href="https://localhost:{{port}}/missing.xhtml">Missing</a> + <a href="https://localhost:{{port}}/missing2.html">Missing2</a> + </body> +</html> +""" + +site = """ +<html> + <head> + <title>Site</title> + </head> + <body> + Subsite + </body> +</html> +""" + +IndexPage = WgetFile("index.html", index) +SubSite = WgetFile("sub.html", site) +LocalIndexPage = WgetFile("index.html", converted) + +print(platform.system()) +restrict = "unix" if platform.system() in ["Linux", "Darwin"] else "windows" + +WGET_OPTIONS = "-k -r -nH --reject-regex '.*\\.xhtml' --no-check-certificate" +WGET_URLS = [["index.html"]] + +Files = [[IndexPage, SubSite]] + +Servers = [HTTPS] + +ExpectedReturnCode = 8 +ExpectedDownloadedFiles = [LocalIndexPage, SubSite] + +########################### Pre and Post Test Hooks ########################## +pre_test = { + "ServerFiles": Files, +} +test_options = { + "WgetCommands": WGET_OPTIONS, + "Urls": WGET_URLS +} +post_test = { + "ExpectedFiles": ExpectedDownloadedFiles, + "ExpectedRetcode": ExpectedReturnCode +} + +err = HTTPTest( + pre_hook=pre_test, + test_params=test_options, + post_hook=post_test, + protocols=Servers, +).begin() + +exit(err) diff --git a/testenv/Test-k.py b/testenv/Test-k.py new file mode 100755 index 0000000..342887c --- /dev/null +++ b/testenv/Test-k.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python3 + +import platform +from sys import exit +from test.http_test import HTTPTest + +from misc.wget_file import WgetFile + +""" +Test that Wget handles the --convert-links (-k) option correctly. + +Also tests that the --restrict-file-names option works as expected by using a +filename with restricted characters and ensuring that it uses the correct +characterset based on the current OS +""" + +############################## File Definitions ############################## +index = """ +<html> + <head> + <title>Index</title> + </head> + <body> + <a href="site;sub:.html">Site</a> + </body> +</html> +""" + +converted = """ +<html> + <head> + <title>Index</title> + </head> + <body> + <a href="./site%3Bsub:.html">Site</a> + </body> +</html> +""" + +site = """ +<html> + <head> + <title>Site</title> + </head> + <body> + Subsite + </body> +</html> +""" + +IndexPage = WgetFile("index.html", index) +SubSite = WgetFile("site;sub:.html", site) +LocalIndexPage = WgetFile("index.html", converted) + +print(platform.system()) +restrict = "unix" if platform.system() in ["Linux", "Darwin"] else "windows" + +WGET_OPTIONS = f"-k -r -nH --restrict-file-names={restrict}" +WGET_URLS = [["index.html"]] + +Files = [[IndexPage, SubSite]] + +ExpectedReturnCode = 0 +ExpectedDownloadedFiles = [LocalIndexPage, SubSite] + +########################### Pre and Post Test Hooks ########################## +pre_test = { + "ServerFiles": Files, +} +test_options = { + "WgetCommands": WGET_OPTIONS, + "Urls": WGET_URLS +} +post_test = { + "ExpectedFiles": ExpectedDownloadedFiles, + "ExpectedRetcode": ExpectedReturnCode +} + +err = HTTPTest( + pre_hook=pre_test, + test_params=test_options, + post_hook=post_test, +).begin() + +exit(err) diff --git a/testenv/Test-recursive-include.py b/testenv/Test-recursive-include.py index 1fe33cd..d21b305 100755 --- a/testenv/Test-recursive-include.py +++ b/testenv/Test-recursive-include.py @@ -1,56 +1,77 @@ #!/usr/bin/env python3 from sys import exit from test.http_test import HTTPTest -from test.base_test import HTTP, HTTPS +from test.base_test import HTTP from misc.wget_file import WgetFile """ Basic test of --recursive. """ -############# File Definitions ############################################### +# File Definitions ############################################### File1 = """<html><body> <a href=\"/a/File2.html\">text</a> <a href=\"/b/File3.html\">text</a> +<picture> + Hey, a source <source type=\"image/svg+xml\" lolli=\"xxx\" srcset=\"/a/logo.svg\"/>. + Hey, a srcset <img src=\"/a/picture.png\" srcset=\"/a/picture1.png, /a/picture2.png 150w,/a/picture3.png 100x\"/>. +</picture> </body></html>""" File2 = "With lemon or cream?" File3 = "Surely you're joking Mr. Feynman" +File4 = "logosvg" +File5 = "picturepng" +File6 = "picture1png" +File7 = "picture2png" +File8 = "picture3png" -File1_File = WgetFile ("a/File1.html", File1) -File2_File = WgetFile ("a/File2.html", File2) -File3_File = WgetFile ("b/File3.html", File3) +File1_File = WgetFile("a/File1.html", File1) +File2_File = WgetFile("a/File2.html", File2) +File3_File = WgetFile("b/File3.html", File3) +File4_File = WgetFile("a/logo.svg", File4) +File5_File = WgetFile("a/picture.png", File5) +File6_File = WgetFile("a/picture1.png", File6) +File7_File = WgetFile("a/picture2.png", File7) +File8_File = WgetFile("a/picture3.png", File8) WGET_OPTIONS = "--recursive --no-host-directories --include-directories=a" WGET_URLS = [["a/File1.html"]] Servers = [HTTP] -Files = [[File1_File, File2_File, File3_File]] +Files = [[File1_File, File2_File, File3_File, File4_File, File5_File, File6_File, File7_File, File8_File]] Existing_Files = [] ExpectedReturnCode = 0 -ExpectedDownloadedFiles = [File1_File, File2_File] -Request_List = [["GET /a/File1.html", - "GET /a/File2.html"]] +ExpectedDownloadedFiles = [File1_File, File2_File, File4_File, File5_File, File6_File, File7_File, File8_File] +Request_List = [[ + "GET /a/File1.html", + "GET /a/File2.html", + "GET /a/logo.svg", + "GET /a/picture.png", + "GET /a/picture1.png", + "GET /a/picture2.png", + "GET /a/picture3.png", +]] -################ Pre and Post Test Hooks ##################################### +# Pre and Post Test Hooks ##################################### pre_test = { - "ServerFiles" : Files, - "LocalFiles" : Existing_Files + "ServerFiles": Files, + "LocalFiles": Existing_Files } test_options = { - "WgetCommands" : WGET_OPTIONS, - "Urls" : WGET_URLS + "WgetCommands": WGET_OPTIONS, + "Urls": WGET_URLS } post_test = { - "ExpectedFiles" : ExpectedDownloadedFiles, - "ExpectedRetcode" : ExpectedReturnCode + "ExpectedFiles": ExpectedDownloadedFiles, + "ExpectedRetcode": ExpectedReturnCode } -err = HTTPTest ( - pre_hook=pre_test, - test_params=test_options, - post_hook=post_test, - protocols=Servers -).begin () +err = HTTPTest( + pre_hook=pre_test, + test_params=test_options, + post_hook=post_test, + protocols=Servers +).begin() -exit (err) +exit(err) diff --git a/testenv/conf/expected_files.py b/testenv/conf/expected_files.py index 65adb70..e45a891 100644 --- a/testenv/conf/expected_files.py +++ b/testenv/conf/expected_files.py @@ -4,6 +4,7 @@ import sys from conf import hook from exc.test_failed import TestFailed + """ Post-Test Hook: ExpectedFiles This is a Post-Test hook that checks the test directory for the files it contains. A dictionary object is passed to it, which contains a mapping of @@ -22,18 +23,24 @@ class ExpectedFiles: @staticmethod def gen_local_fs_snapshot(): snapshot = {} - for parent, dirs, files in os.walk('.'): + for parent, dirs, files in os.walk("."): for name in files: - # pubring.gpg, pubring.kbx, dirmngr.conf, gpg.conf will be created by libgpgme + # pubring.gpg, pubring.kbx, common.conf, dirmngr.conf, gpg.conf will be created by libgpgme # if $HOME doesn't contain the .gnupg directory. # setting $HOME to CWD (in base_test.py) breaks two Metalink tests, so we skip this file here. - if name in [ 'pubring.gpg', 'pubring.kbx', 'dirmngr.conf', 'gpg.conf' ]: + if name in [ + "pubring.gpg", + "pubring.kbx", + "common.conf", + "dirmngr.conf", + "gpg.conf", + ]: continue - f = {'content': ''} + f = {"content": ""} file_path = os.path.join(parent, name) with open(file_path) as fp: - f['content'] = fp.read() + f["content"] = fp.read() snapshot[file_path[2:]] = f return snapshot @@ -44,15 +51,19 @@ class ExpectedFiles: if file.name in local_fs: local_file = local_fs.pop(file.name) formatted_content = test_obj._replace_substring(file.content) - if formatted_content != local_file['content']: - for line in unified_diff(local_file['content'], - formatted_content, - fromfile='Actual', - tofile='Expected'): - print(line, file=sys.stderr) - raise TestFailed('Contents of %s do not match' % file.name) + if formatted_content != local_file["content"]: + diff = "".join( + unified_diff( + local_file["content"].splitlines(1), + formatted_content.splitlines(1), + fromfile="Actual", + tofile="Expected", + ) + ) + print(diff, file=sys.stderr) + raise TestFailed("Contents of %s do not match" % file.name) else: - raise TestFailed('Expected file %s not found.' % file.name) + raise TestFailed("Expected file %s not found." % file.name) if local_fs: print(local_fs) - raise TestFailed('Extra files downloaded.') + raise TestFailed("Extra files downloaded.") diff --git a/testenv/server/http/http_server.py b/testenv/server/http/http_server.py index 2cc82fb..fd6121a 100644 --- a/testenv/server/http/http_server.py +++ b/testenv/server/http/http_server.py @@ -47,10 +47,10 @@ class HTTPSServer(StoppableHTTPServer): os.getenv('srcdir', '.'), 'certs', 'server-key.pem')) - self.socket = ssl.wrap_socket( + ctx = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_SERVER) + ctx.load_cert_chain(CERTFILE, KEYFILE) + self.socket = ctx.wrap_socket( sock=socket.socket(self.address_family, self.socket_type), - certfile=CERTFILE, - keyfile=KEYFILE, server_side=True ) self.server_bind() diff --git a/testenv/test_css_url.py b/testenv/test_css_url.py new file mode 100755 index 0000000..1c1c8f8 --- /dev/null +++ b/testenv/test_css_url.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 + +"""Ensure that Wget correctly encodes url() parameters in CSS.""" + +from test.base_test import HTTP +from test.http_test import HTTPTest + +from misc.wget_file import WgetFile + +############################## File Definitions ############################### +FILE1 = """<html> + <head> +<style> +body { + background-image: url(image%201.html); +} +</style> + </head> + <body>Hello</body> +</html>""" + + +FILE2 = "This is an image" + +File1_File = WgetFile("index.html", FILE1) +File2_File = WgetFile("image 1.html", FILE2) +File2_ServerFile = WgetFile("image%201.html", FILE2) + +WGET_OPTIONS = "--recursive --convert-links --no-host-directories" +WGET_URLS = [[""]] + +Servers = [HTTP] + +Files = [[File1_File, File2_ServerFile]] +Existing_Files = [] + +ExpectedReturnCode = 0 +ExpectedDownloadedFiles = [File1_File, File2_File] +# Request_List = [["GET /", +# "GET /image 1.html"]] + +################ Pre and Post Test Hooks ##################################### +pre_test = { + "ServerFiles" : Files, + "LocalFiles" : Existing_Files +} +test_options = { + "WgetCommands" : WGET_OPTIONS, + "Urls" : WGET_URLS +} +post_test = { + "ExpectedFiles" : ExpectedDownloadedFiles, + "ExpectedRetcode" : ExpectedReturnCode +} + +err = HTTPTest ( + pre_hook=pre_test, + test_params=test_options, + post_hook=post_test, + protocols=Servers +).begin () + +exit (err) |