1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Group common switches in test suite together

Some command line switches are passed to Wget unconditionally. These
switches should exist in a single place instead of being redundantly
defined in each test file. We add the following two switches by default
here:
1. --debug: This causes wget to be most verbose and output a lot of
   debugging information. Hence, if a test fails, the test log should
   provide valuable information.
2. --no-config: Users may have their own wgetrc files on the system.
   However, for the tests, we want Wget to run with vanilla settings.
   Hence, disbale loading any config files.
This commit is contained in:
Darshit Shah 2014-07-26 23:45:57 +05:30
parent 3858500de4
commit 03f8babefe
24 changed files with 30 additions and 23 deletions

View File

@ -1,3 +1,9 @@
2014-07-26 Darshit Shah <darnir@gmail.com>
* Test-*.py: Remove the '-d' switch from WGET_OPTIONS.
* test/base_test (BaseTest.gen_cmd_line): Add --debug and --no-config to the
list of switches passed to wget unconditionally.
2014-07-23 Darshit Shah <darnir@gmail.com> 2014-07-23 Darshit Shah <darnir@gmail.com>
* test/base_test.py (BaseTest.gen_cmd_line): Add support for running all * test/base_test.py (BaseTest.gen_cmd_line): Add support for running all

View File

@ -17,7 +17,7 @@ A_File = WgetFile ("File1", File1)
B_File = WgetFile ("File2", File2) B_File = WgetFile ("File2", File2)
C_File = WgetFile ("File3", File3) C_File = WgetFile ("File3", File3)
WGET_OPTIONS = "-d --no-check-certificate" WGET_OPTIONS = "--no-check-certificate"
WGET_URLS = [["File1", "File2"]] WGET_URLS = [["File1", "File2"]]
Files = [[A_File, B_File]] Files = [[A_File, B_File]]

View File

@ -74,7 +74,7 @@ Request_List = [
] ]
] ]
WGET_OPTIONS = "-d --spider -r" WGET_OPTIONS = "--spider -r"
WGET_URLS = [[""]] WGET_URLS = [[""]]
Files = [[index_html, secondpage_html, thirdpage_html, dummy_txt]] Files = [[index_html, secondpage_html, thirdpage_html, dummy_txt]]

View File

@ -20,7 +20,7 @@ File2_rules = {
A_File = WgetFile ("HTTP.Teapot", File1) A_File = WgetFile ("HTTP.Teapot", File1)
B_File = WgetFile ("File2", File2, rules=File2_rules) B_File = WgetFile ("File2", File2, rules=File2_rules)
WGET_OPTIONS = "-d --content-disposition" WGET_OPTIONS = "--content-disposition"
WGET_URLS = [["File2"]] WGET_URLS = [["File2"]]
Files = [[B_File]] Files = [[B_File]]

View File

@ -25,7 +25,7 @@ File1_rules = {
} }
A_File = WgetFile ("LOTR", File1, rules=File1_rules) A_File = WgetFile ("LOTR", File1, rules=File1_rules)
WGET_OPTIONS = "-d --content-disposition" WGET_OPTIONS = "--content-disposition"
WGET_URLS = [["LOTR"]] WGET_URLS = [["LOTR"]]
Files = [[A_File]] Files = [[A_File]]

View File

@ -13,7 +13,7 @@ File1 = "You shall not pass!"
A_File = WgetFile ("File1", File1) A_File = WgetFile ("File1", File1)
WGET_OPTIONS = "-d --method=HEAD" WGET_OPTIONS = "--method=HEAD"
WGET_URLS = [["File1"]] WGET_URLS = [["File1"]]
Files = [[A_File]] Files = [[A_File]]

View File

@ -13,7 +13,7 @@ File1 = "Test Contents."
A_File = WgetFile ("File1", File1) A_File = WgetFile ("File1", File1)
WGET_OPTIONS = "-d -O NewFile.txt" WGET_OPTIONS = "-O NewFile.txt"
WGET_URLS = [["File1"]] WGET_URLS = [["File1"]]
Files = [[A_File]] Files = [[A_File]]

View File

@ -18,7 +18,7 @@ A_File = WgetFile ("File1", File1)
B_File = WgetFile ("File2", File2) B_File = WgetFile ("File2", File2)
C_File = WgetFile ("File3", File3) C_File = WgetFile ("File3", File3)
WGET_OPTIONS = "-d" WGET_OPTIONS = ""
WGET_URLS = [["File1"], ["File2"]] WGET_URLS = [["File1"], ["File2"]]
Files = [[A_File], [B_File]] Files = [[A_File], [B_File]]

View File

@ -17,7 +17,7 @@ TestMessage"""
A_File = WgetFile ("File1", File1) A_File = WgetFile ("File1", File1)
WGET_OPTIONS = "-d --method=post --body-data=TestMessage" WGET_OPTIONS = "--method=post --body-data=TestMessage"
WGET_URLS = [["File1"]] WGET_URLS = [["File1"]]
Files = [[A_File]] Files = [[A_File]]

View File

@ -39,7 +39,7 @@ A_File = WgetFile ("File1", File1, rules=File1_rules)
B_File = WgetFile ("File2", File2, rules=File2_rules) B_File = WgetFile ("File2", File2, rules=File2_rules)
C_File = WgetFile ("File3", File3) C_File = WgetFile ("File3", File3)
WGET_OPTIONS = "-d --content-disposition --user=Sauron --password=TheEye" WGET_OPTIONS = "--content-disposition --user=Sauron --password=TheEye"
WGET_URLS = [["File1", "File2"]] WGET_URLS = [["File1", "File2"]]
Servers = [HTTP] Servers = [HTTP]

View File

@ -20,7 +20,7 @@ File1_rules = {
} }
A_File = WgetFile ("File1", File1, rules=File1_rules) A_File = WgetFile ("File1", File1, rules=File1_rules)
WGET_OPTIONS = "-d --user=Sauron --password=Eye" WGET_OPTIONS = "--user=Sauron --password=Eye"
WGET_URLS = [["File1"]] WGET_URLS = [["File1"]]
Files = [[A_File]] Files = [[A_File]]

View File

@ -28,7 +28,7 @@ File2_rules = {
A_File = WgetFile ("File1", File1, rules=File1_rules) A_File = WgetFile ("File1", File1, rules=File1_rules)
B_File = WgetFile ("File2", File2, rules=File2_rules) B_File = WgetFile ("File2", File2, rules=File2_rules)
WGET_OPTIONS = "-d --user=Sauron --password=TheEye" WGET_OPTIONS = "--user=Sauron --password=TheEye"
WGET_URLS = [["File1", "File2"]] WGET_URLS = [["File1", "File2"]]
Files = [[A_File, B_File]] Files = [[A_File, B_File]]

View File

@ -46,7 +46,7 @@ A_File = WgetFile ("File1", File1, rules=File1_rules)
B_File = WgetFile ("File2", File2, rules=File2_rules) B_File = WgetFile ("File2", File2, rules=File2_rules)
C_File = WgetFile ("File3", File3, rules=File3_rules) C_File = WgetFile ("File3", File3, rules=File3_rules)
WGET_OPTIONS = "-d --user=Sauron --password=TheEye" WGET_OPTIONS = "--user=Sauron --password=TheEye"
WGET_URLS = [["File1", "File2", "File3"]] WGET_URLS = [["File1", "File2", "File3"]]
Files = [[A_File, B_File, C_File]] Files = [[A_File, B_File, C_File]]

View File

@ -19,7 +19,7 @@ File1_rules = {
} }
A_File = WgetFile ("File1", File1, rules=File1_rules) A_File = WgetFile ("File1", File1, rules=File1_rules)
WGET_OPTIONS = "-d --user=Pacman --password=Omnomnom" WGET_OPTIONS = "--user=Pacman --password=Omnomnom"
WGET_URLS = [["File1"]] WGET_URLS = [["File1"]]
Files = [[A_File]] Files = [[A_File]]

View File

@ -23,7 +23,7 @@ File1_rules = {
} }
A_File = WgetFile ("File1", File1, rules=File1_rules) A_File = WgetFile ("File1", File1, rules=File1_rules)
WGET_OPTIONS = "-d --auth-no-challenge http://Pacman:Omnomnom@localhost:{{port}}/File1" WGET_OPTIONS = "--auth-no-challenge http://Pacman:Omnomnom@localhost:{{port}}/File1"
WGET_URLS = [[]] WGET_URLS = [[]]
Files = [[A_File]] Files = [[A_File]]

View File

@ -23,7 +23,7 @@ File1_rules = {
} }
A_File = WgetFile ("File1", File1, rules=File1_rules) A_File = WgetFile ("File1", File1, rules=File1_rules)
WGET_OPTIONS = "-d --auth-no-challenge --user=Pacman --password=Omnomnom" WGET_OPTIONS = "--auth-no-challenge --user=Pacman --password=Omnomnom"
WGET_URLS = [["File1"]] WGET_URLS = [["File1"]]
Files = [[A_File]] Files = [[A_File]]

View File

@ -19,7 +19,7 @@ File1_rules = {
A_File = WgetFile ("File1", File1, rules=File1_rules) A_File = WgetFile ("File1", File1, rules=File1_rules)
WGET_OPTIONS = "-d" WGET_OPTIONS = ""
WGET_URLS = [["File1"]] WGET_URLS = [["File1"]]
Files = [[A_File]] Files = [[A_File]]

View File

@ -23,7 +23,7 @@ File1_rules = {
} }
A_File = WgetFile ("File1", File1, rules=File1_rules) A_File = WgetFile ("File1", File1, rules=File1_rules)
WGET_OPTIONS = "-d --user=Pacman --password=Omnomnom --content-disposition" WGET_OPTIONS = "--user=Pacman --password=Omnomnom --content-disposition"
WGET_URLS = [["File1"]] WGET_URLS = [["File1"]]
Files = [[A_File]] Files = [[A_File]]

View File

@ -20,7 +20,7 @@ D_File = WgetFile ("File2", File2)
E_File = WgetFile ("File3", File1) E_File = WgetFile ("File3", File1)
WGET_OPTIONS = "-d -c" WGET_OPTIONS = "-c"
WGET_URLS = [["File1", "File2", "File3"]] WGET_URLS = [["File1", "File2", "File3"]]
Files = [[A_File, C_File, E_File]] Files = [[A_File, C_File, E_File]]

View File

@ -28,7 +28,7 @@ File2_rules = {
A_File = WgetFile ("File1", File1, rules=File1_rules) A_File = WgetFile ("File1", File1, rules=File1_rules)
B_File = WgetFile ("File2", File2, rules=File2_rules) B_File = WgetFile ("File2", File2, rules=File2_rules)
WGET_OPTIONS = "-d" WGET_OPTIONS = ""
WGET_URLS = [["File1", "File2"]] WGET_URLS = [["File1", "File2"]]
Files = [[A_File, B_File]] Files = [[A_File, B_File]]

View File

@ -26,7 +26,7 @@ File2_rules = {
A_File = WgetFile ("File1", File1, rules=File1_rules) A_File = WgetFile ("File1", File1, rules=File1_rules)
B_File = WgetFile ("File2", File2, rules=File2_rules) B_File = WgetFile ("File2", File2, rules=File2_rules)
WGET_OPTIONS = "-d" WGET_OPTIONS = ""
WGET_URLS = [["File1", "File2"]] WGET_URLS = [["File1", "File2"]]
Files = [[A_File, B_File]] Files = [[A_File, B_File]]

View File

@ -49,7 +49,7 @@ B_File = WgetFile ("File2", File2, rules=File2_rules)
C_File = WgetFile ("File3", File3, rules=File3_rules) C_File = WgetFile ("File3", File3, rules=File3_rules)
D_File = WgetFile ("File4", File4, rules=File4_rules) D_File = WgetFile ("File4", File4, rules=File4_rules)
WGET_OPTIONS = "-d" WGET_OPTIONS = ""
WGET_URLS = [["File1", "File2", "File3", "File4"]] WGET_URLS = [["File1", "File2", "File3", "File4"]]
Files = [[A_File, B_File, C_File, D_File]] Files = [[A_File, B_File, C_File, D_File]]

View File

@ -26,7 +26,7 @@ File2_rules = {
A_File = WgetFile ("File1", File1, rules=File1_rules) A_File = WgetFile ("File1", File1, rules=File1_rules)
B_File = WgetFile ("File2", File2, rules=File2_rules) B_File = WgetFile ("File2", File2, rules=File2_rules)
WGET_OPTIONS = "-d" WGET_OPTIONS = ""
WGET_URLS = [["File1", "File2"]] WGET_URLS = [["File1", "File2"]]
Files = [[A_File, B_File]] Files = [[A_File, B_File]]

View File

@ -98,12 +98,13 @@ class BaseTest:
test_path = os.path.abspath(".") test_path = os.path.abspath(".")
wget_path = os.path.abspath(os.path.join(test_path, wget_path = os.path.abspath(os.path.join(test_path,
"..", '..', 'src', "wget")) "..", '..', 'src', "wget"))
wget_options = '--debug --no-config %s' % self.wget_options
if os.getenv("VALGRIND_TESTS"): if os.getenv("VALGRIND_TESTS"):
valgrind_test = "valgrind --error-exitcode=301 --leak-check=full" valgrind_test = "valgrind --error-exitcode=301 --leak-check=full"
else: else:
valgrind_test = "" valgrind_test = ""
cmd_line = '%s %s %s ' % (valgrind_test, wget_path, self.wget_options) cmd_line = '%s %s %s ' % (valgrind_test, wget_path, wget_options)
for protocol, urls, domain in zip(self.protocols, for protocol, urls, domain in zip(self.protocols,
self.urls, self.urls,
self.domains): self.domains):