mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
SKIP SSL/TLS tests if configured without it
* testenv/Makefile.am: Set SSL_TESTS env variable * testenv/Test--https-crl.py, testenv/Test--https.py, testenv/Test-hsts.py: Return 77 (SKIP) if SSL/TLS is not configured
This commit is contained in:
parent
8977e63239
commit
ca0c272eae
@ -37,7 +37,10 @@ AUTOMAKE_OPTIONS = parallel-tests
|
|||||||
AM_TESTS_ENVIRONMENT = export WGETRC=/dev/null; MAKE_CHECK=True; export MAKE_CHECK;\
|
AM_TESTS_ENVIRONMENT = export WGETRC=/dev/null; MAKE_CHECK=True; export MAKE_CHECK;\
|
||||||
export PYTHONPATH=$$PYTHONPATH:$(srcdir); export VALGRIND_TESTS="@VALGRIND_TESTS@";
|
export PYTHONPATH=$$PYTHONPATH:$(srcdir); export VALGRIND_TESTS="@VALGRIND_TESTS@";
|
||||||
|
|
||||||
SSL_TESTS = Test--https.py Test--https-crl.py Test-hsts.py
|
if WITH_SSL
|
||||||
|
AM_TESTS_ENVIRONMENT += export SSL_TESTS=1;
|
||||||
|
endif
|
||||||
|
|
||||||
if HAVE_PYTHON3
|
if HAVE_PYTHON3
|
||||||
TESTS = Test-auth-basic-fail.py \
|
TESTS = Test-auth-basic-fail.py \
|
||||||
Test-auth-basic.py \
|
Test-auth-basic.py \
|
||||||
@ -58,6 +61,7 @@ if HAVE_PYTHON3
|
|||||||
Test-Head.py \
|
Test-Head.py \
|
||||||
Test--https.py \
|
Test--https.py \
|
||||||
Test--https-crl.py \
|
Test--https-crl.py \
|
||||||
|
Test-hsts.py \
|
||||||
Test-O.py \
|
Test-O.py \
|
||||||
Test-Post.py \
|
Test-Post.py \
|
||||||
Test-504.py \
|
Test-504.py \
|
||||||
@ -66,14 +70,8 @@ if HAVE_PYTHON3
|
|||||||
Test-redirect-crash.py \
|
Test-redirect-crash.py \
|
||||||
Test-reserved-chars.py \
|
Test-reserved-chars.py \
|
||||||
Test-condget.py \
|
Test-condget.py \
|
||||||
$(SSL_TESTS) \
|
|
||||||
$(METALINK_TESTS)
|
$(METALINK_TESTS)
|
||||||
|
|
||||||
# added test cases expected to fail here and under TESTS
|
|
||||||
if !WITH_SSL
|
|
||||||
XFAIL_TESTS = $(SSL_TESTS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_DIST = certs conf exc misc server test README $(TESTS)
|
EXTRA_DIST = certs conf exc misc server test README $(TESTS)
|
||||||
|
@ -9,6 +9,9 @@ import os
|
|||||||
This test ensures that Wget can download files from HTTPS Servers
|
This test ensures that Wget can download files from HTTPS Servers
|
||||||
"""
|
"""
|
||||||
TEST_NAME = "HTTPS CRL"
|
TEST_NAME = "HTTPS CRL"
|
||||||
|
if os.getenv('SSL_TESTS') is None:
|
||||||
|
exit (77)
|
||||||
|
|
||||||
############# File Definitions ###############################################
|
############# File Definitions ###############################################
|
||||||
File1 = "Would you like some Tea?"
|
File1 = "Would you like some Tea?"
|
||||||
File2 = "With lemon or cream?"
|
File2 = "With lemon or cream?"
|
||||||
|
@ -9,6 +9,9 @@ import os
|
|||||||
This test ensures that Wget can download files from HTTPS Servers
|
This test ensures that Wget can download files from HTTPS Servers
|
||||||
"""
|
"""
|
||||||
TEST_NAME = "HTTPS Downloads"
|
TEST_NAME = "HTTPS Downloads"
|
||||||
|
if os.getenv('SSL_TESTS') is None:
|
||||||
|
exit (77)
|
||||||
|
|
||||||
############# File Definitions ###############################################
|
############# File Definitions ###############################################
|
||||||
File1 = "Would you like some Tea?"
|
File1 = "Would you like some Tea?"
|
||||||
File2 = "With lemon or cream?"
|
File2 = "With lemon or cream?"
|
||||||
|
@ -9,6 +9,12 @@ import os
|
|||||||
"""
|
"""
|
||||||
This test makes sure Wget can parse a given HSTS database and apply the indicated HSTS policy.
|
This test makes sure Wget can parse a given HSTS database and apply the indicated HSTS policy.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
TEST_NAME = "HSTS basic test"
|
||||||
|
print (os.getenv('SSL_TESTS'))
|
||||||
|
if os.getenv('SSL_TESTS') is None:
|
||||||
|
exit (77)
|
||||||
|
|
||||||
def hsts_database_path():
|
def hsts_database_path():
|
||||||
hsts_file = ".wget-hsts-testenv"
|
hsts_file = ".wget-hsts-testenv"
|
||||||
return os.path.abspath(hsts_file)
|
return os.path.abspath(hsts_file)
|
||||||
@ -25,8 +31,6 @@ def create_hsts_database(path, host, port):
|
|||||||
f.write(host + "\t" + str(port) + "\t0\t" + str(curtime) + "\t" + max_age + "\n")
|
f.write(host + "\t" + str(port) + "\t0\t" + str(curtime) + "\t" + max_age + "\n")
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
TEST_NAME = "HSTS basic test"
|
|
||||||
|
|
||||||
File_Name = "hw"
|
File_Name = "hw"
|
||||||
File_Content = "Hello, world!"
|
File_Content = "Hello, world!"
|
||||||
File = WgetFile(File_Name, File_Content)
|
File = WgetFile(File_Name, File_Content)
|
||||||
|
Loading…
Reference in New Issue
Block a user