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:
parent
3858500de4
commit
03f8babefe
@ -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>
|
||||
|
||||
* test/base_test.py (BaseTest.gen_cmd_line): Add support for running all
|
||||
|
@ -17,7 +17,7 @@ A_File = WgetFile ("File1", File1)
|
||||
B_File = WgetFile ("File2", File2)
|
||||
C_File = WgetFile ("File3", File3)
|
||||
|
||||
WGET_OPTIONS = "-d --no-check-certificate"
|
||||
WGET_OPTIONS = "--no-check-certificate"
|
||||
WGET_URLS = [["File1", "File2"]]
|
||||
|
||||
Files = [[A_File, B_File]]
|
||||
|
@ -74,7 +74,7 @@ Request_List = [
|
||||
]
|
||||
]
|
||||
|
||||
WGET_OPTIONS = "-d --spider -r"
|
||||
WGET_OPTIONS = "--spider -r"
|
||||
WGET_URLS = [[""]]
|
||||
|
||||
Files = [[index_html, secondpage_html, thirdpage_html, dummy_txt]]
|
||||
|
@ -20,7 +20,7 @@ File2_rules = {
|
||||
A_File = WgetFile ("HTTP.Teapot", File1)
|
||||
B_File = WgetFile ("File2", File2, rules=File2_rules)
|
||||
|
||||
WGET_OPTIONS = "-d --content-disposition"
|
||||
WGET_OPTIONS = "--content-disposition"
|
||||
WGET_URLS = [["File2"]]
|
||||
|
||||
Files = [[B_File]]
|
||||
|
@ -25,7 +25,7 @@ File1_rules = {
|
||||
}
|
||||
A_File = WgetFile ("LOTR", File1, rules=File1_rules)
|
||||
|
||||
WGET_OPTIONS = "-d --content-disposition"
|
||||
WGET_OPTIONS = "--content-disposition"
|
||||
WGET_URLS = [["LOTR"]]
|
||||
|
||||
Files = [[A_File]]
|
||||
|
@ -13,7 +13,7 @@ File1 = "You shall not pass!"
|
||||
|
||||
A_File = WgetFile ("File1", File1)
|
||||
|
||||
WGET_OPTIONS = "-d --method=HEAD"
|
||||
WGET_OPTIONS = "--method=HEAD"
|
||||
WGET_URLS = [["File1"]]
|
||||
|
||||
Files = [[A_File]]
|
||||
|
@ -13,7 +13,7 @@ File1 = "Test Contents."
|
||||
|
||||
A_File = WgetFile ("File1", File1)
|
||||
|
||||
WGET_OPTIONS = "-d -O NewFile.txt"
|
||||
WGET_OPTIONS = "-O NewFile.txt"
|
||||
WGET_URLS = [["File1"]]
|
||||
|
||||
Files = [[A_File]]
|
||||
|
@ -18,7 +18,7 @@ A_File = WgetFile ("File1", File1)
|
||||
B_File = WgetFile ("File2", File2)
|
||||
C_File = WgetFile ("File3", File3)
|
||||
|
||||
WGET_OPTIONS = "-d"
|
||||
WGET_OPTIONS = ""
|
||||
WGET_URLS = [["File1"], ["File2"]]
|
||||
|
||||
Files = [[A_File], [B_File]]
|
||||
|
@ -17,7 +17,7 @@ TestMessage"""
|
||||
|
||||
A_File = WgetFile ("File1", File1)
|
||||
|
||||
WGET_OPTIONS = "-d --method=post --body-data=TestMessage"
|
||||
WGET_OPTIONS = "--method=post --body-data=TestMessage"
|
||||
WGET_URLS = [["File1"]]
|
||||
|
||||
Files = [[A_File]]
|
||||
|
@ -39,7 +39,7 @@ A_File = WgetFile ("File1", File1, rules=File1_rules)
|
||||
B_File = WgetFile ("File2", File2, rules=File2_rules)
|
||||
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"]]
|
||||
|
||||
Servers = [HTTP]
|
||||
|
@ -20,7 +20,7 @@ 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"]]
|
||||
|
||||
Files = [[A_File]]
|
||||
|
@ -28,7 +28,7 @@ File2_rules = {
|
||||
A_File = WgetFile ("File1", File1, rules=File1_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"]]
|
||||
|
||||
Files = [[A_File, B_File]]
|
||||
|
@ -46,7 +46,7 @@ A_File = WgetFile ("File1", File1, rules=File1_rules)
|
||||
B_File = WgetFile ("File2", File2, rules=File2_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"]]
|
||||
|
||||
Files = [[A_File, B_File, C_File]]
|
||||
|
@ -19,7 +19,7 @@ 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"]]
|
||||
|
||||
Files = [[A_File]]
|
||||
|
@ -23,7 +23,7 @@ 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 = [[]]
|
||||
|
||||
Files = [[A_File]]
|
||||
|
@ -23,7 +23,7 @@ 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"]]
|
||||
|
||||
Files = [[A_File]]
|
||||
|
@ -19,7 +19,7 @@ File1_rules = {
|
||||
|
||||
A_File = WgetFile ("File1", File1, rules=File1_rules)
|
||||
|
||||
WGET_OPTIONS = "-d"
|
||||
WGET_OPTIONS = ""
|
||||
WGET_URLS = [["File1"]]
|
||||
|
||||
Files = [[A_File]]
|
||||
|
@ -23,7 +23,7 @@ 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"]]
|
||||
|
||||
Files = [[A_File]]
|
||||
|
@ -20,7 +20,7 @@ D_File = WgetFile ("File2", File2)
|
||||
|
||||
E_File = WgetFile ("File3", File1)
|
||||
|
||||
WGET_OPTIONS = "-d -c"
|
||||
WGET_OPTIONS = "-c"
|
||||
WGET_URLS = [["File1", "File2", "File3"]]
|
||||
|
||||
Files = [[A_File, C_File, E_File]]
|
||||
|
@ -28,7 +28,7 @@ File2_rules = {
|
||||
A_File = WgetFile ("File1", File1, rules=File1_rules)
|
||||
B_File = WgetFile ("File2", File2, rules=File2_rules)
|
||||
|
||||
WGET_OPTIONS = "-d"
|
||||
WGET_OPTIONS = ""
|
||||
WGET_URLS = [["File1", "File2"]]
|
||||
|
||||
Files = [[A_File, B_File]]
|
||||
|
@ -26,7 +26,7 @@ File2_rules = {
|
||||
A_File = WgetFile ("File1", File1, rules=File1_rules)
|
||||
B_File = WgetFile ("File2", File2, rules=File2_rules)
|
||||
|
||||
WGET_OPTIONS = "-d"
|
||||
WGET_OPTIONS = ""
|
||||
WGET_URLS = [["File1", "File2"]]
|
||||
|
||||
Files = [[A_File, B_File]]
|
||||
|
@ -49,7 +49,7 @@ B_File = WgetFile ("File2", File2, rules=File2_rules)
|
||||
C_File = WgetFile ("File3", File3, rules=File3_rules)
|
||||
D_File = WgetFile ("File4", File4, rules=File4_rules)
|
||||
|
||||
WGET_OPTIONS = "-d"
|
||||
WGET_OPTIONS = ""
|
||||
WGET_URLS = [["File1", "File2", "File3", "File4"]]
|
||||
|
||||
Files = [[A_File, B_File, C_File, D_File]]
|
||||
|
@ -26,7 +26,7 @@ File2_rules = {
|
||||
A_File = WgetFile ("File1", File1, rules=File1_rules)
|
||||
B_File = WgetFile ("File2", File2, rules=File2_rules)
|
||||
|
||||
WGET_OPTIONS = "-d"
|
||||
WGET_OPTIONS = ""
|
||||
WGET_URLS = [["File1", "File2"]]
|
||||
|
||||
Files = [[A_File, B_File]]
|
||||
|
@ -98,12 +98,13 @@ class BaseTest:
|
||||
test_path = os.path.abspath(".")
|
||||
wget_path = os.path.abspath(os.path.join(test_path,
|
||||
"..", '..', 'src', "wget"))
|
||||
wget_options = '--debug --no-config %s' % self.wget_options
|
||||
|
||||
if os.getenv("VALGRIND_TESTS"):
|
||||
valgrind_test = "valgrind --error-exitcode=301 --leak-check=full"
|
||||
else:
|
||||
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,
|
||||
self.urls,
|
||||
self.domains):
|
||||
|
Loading…
Reference in New Issue
Block a user